]> git.localhorst.tv Git - blobs.git/blob - tst/app/AssetTest.cpp
bd067d39cf3853527dfe7df38e8e1ef23d66aab9
[blobs.git] / tst / app / AssetTest.cpp
1 #include "AssetTest.hpp"
2
3 #include "app/Assets.hpp"
4 #include "app/init.hpp"
5
6 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(blobs::app::test::AssetTest, "headed");
7
8
9 namespace blobs {
10 namespace app {
11 namespace test {
12
13 void AssetTest::setUp() {
14 }
15
16 void AssetTest::tearDown() {
17 }
18
19
20 void AssetTest::testLoadAll() {
21         Init init(true, 8);
22         Assets assets;
23
24         CPPUNIT_ASSERT_MESSAGE(
25                 "no resources loaded",
26                 assets.data.resources.Size() > 0
27         );
28         CPPUNIT_ASSERT_MESSAGE(
29                 "no tile types loaded",
30                 assets.data.resources.Size() > 0
31         );
32
33         CPPUNIT_ASSERT_MESSAGE(
34                 "tile texture has no width",
35                 assets.textures.tiles.Width() > 0
36         );
37         CPPUNIT_ASSERT_MESSAGE(
38                 "tile texture has no height",
39                 assets.textures.tiles.Height() > 0
40         );
41         CPPUNIT_ASSERT_MESSAGE(
42                 "tile texture has no depth",
43                 assets.textures.tiles.Depth() > 0
44         );
45
46         CPPUNIT_ASSERT_MESSAGE(
47                 "skin texture has no width",
48                 assets.textures.skins.Width() > 0
49         );
50         CPPUNIT_ASSERT_MESSAGE(
51                 "skin texture has no height",
52                 assets.textures.skins.Height() > 0
53         );
54         CPPUNIT_ASSERT_MESSAGE(
55                 "skin texture has no depth",
56                 assets.textures.skins.Depth() > 0
57         );
58
59         CPPUNIT_ASSERT_EQUAL_MESSAGE(
60                 "large font has wrong family",
61                 std::string("DejaVu Sans"), std::string(assets.fonts.large.FamilyName())
62         );
63         CPPUNIT_ASSERT_EQUAL_MESSAGE(
64                 "medium font has wrong family",
65                 std::string("DejaVu Sans"), std::string(assets.fonts.medium.FamilyName())
66         );
67         CPPUNIT_ASSERT_EQUAL_MESSAGE(
68                 "small font has wrong family",
69                 std::string("DejaVu Sans"), std::string(assets.fonts.small.FamilyName())
70         );
71 }
72
73 }
74 }
75 }