Debian Codegraph @

test/FTLibrary-Test.cpp

raw
1 #include <cppunit/extensions/HelperMacros.h>
2 #include <cppunit/TestCaller.h>
3 #include <cppunit/TestCase.h>
4 #include <cppunit/TestSuite.h>
5
6 #include "FTLibrary.h"
7
8 class FTLibraryTest : public CppUnit::TestCase
9 {
10 CPPUNIT_TEST_SUITE(FTLibraryTest);
11 CPPUNIT_TEST(testConstructor);
12 CPPUNIT_TEST(testError);
13 CPPUNIT_TEST_SUITE_END();
14
15 public:
16 FTLibraryTest() : CppUnit::TestCase("FTLibrary Test")
17 {}
18
19 FTLibraryTest(const std::string& name) : CppUnit::TestCase(name) {}
20
21 void testConstructor()
22 {
23 const FTLibrary& libraryOne = FTLibrary::Instance();
24 const FTLibrary& libraryTwo = FTLibrary::Instance();
25
26 CPPUNIT_ASSERT(&libraryOne == &libraryTwo);
27 CPPUNIT_ASSERT(&libraryOne == &FTLibrary::Instance());
28 }
29
30
31 void testError()
32 {
33 const FTLibrary& library = FTLibrary::Instance();
34
35 CPPUNIT_ASSERT(library.Error() == 0);
36 }
37
38
39 void setUp()
40 {}
41
42
43 void tearDown()
44 {}
45
46 private:
47
48 };
49
50 CPPUNIT_TEST_SUITE_REGISTRATION(FTLibraryTest);
51