-
Notifications
You must be signed in to change notification settings - Fork 0
/
beerwantermaindialog_test.cpp
38 lines (35 loc) · 1.05 KB
/
beerwantermaindialog_test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <boost/test/unit_test.hpp>
#include "beerwantermaindialog.h"
#include "fileio.h"
#include <QFile>
BOOST_AUTO_TEST_CASE(BeerWanterMainDialog_test)
{
const int screen_width = 640;
const int screen_height = 400;
const int sprite_width = 32;
const int sprite_height = 48;
const int window_width = 320;
const int window_height = 200;
ribi::BeerWanterMainDialog d(
screen_width,
screen_height,
sprite_width,
sprite_height,
window_width,
window_height
);
BOOST_CHECK(d.GetWindowWidth() == window_width);
BOOST_CHECK(d.GetWindowHeight() == window_height);
BOOST_CHECK(d.GetSpriteWidth() == sprite_width);
BOOST_CHECK(d.GetSpriteHeight() == sprite_height);
}
BOOST_AUTO_TEST_CASE(BeerWanterMainDialog_check_resources)
{
const ribi::FileIo f;
const std::string filename { f.GetTempFileName(".png") };
QFile qfile(ribi::BeerWanterMainDialog::GetResourceFilename().c_str());
qfile.copy(filename.c_str());
BOOST_CHECK(f.IsRegularFile(filename));
f.DeleteFile(filename);
BOOST_CHECK(!f.IsRegularFile(filename));
}