fixed CountedTest compilation problem attempting to access a private variable. Also fixed TestRunner exit status.

git-svn-id: https://zxing.googlecode.com/svn/trunk@543 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
christian.brunschen 2008-08-02 08:36:54 +00:00
parent 81c1368068
commit 0fe5931684
2 changed files with 5 additions and 5 deletions

View file

@ -27,5 +27,5 @@ int main(int argc, char **argv)
CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry(); CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest(registry.makeTest()); runner.addTest(registry.makeTest());
bool wasSuccessful = runner.run("", false); bool wasSuccessful = runner.run("", false);
return wasSuccessful; return wasSuccessful ? 0 : 1;
} }

View file

@ -39,14 +39,14 @@ namespace common {
void CountedTest::test() { void CountedTest::test() {
Foo foo; Foo foo;
CPPUNIT_ASSERT_EQUAL(0U, foo.count_); CPPUNIT_ASSERT_EQUAL(0, foo.count());
foo.retain(); foo.retain();
CPPUNIT_ASSERT_EQUAL(1U, foo.count_); CPPUNIT_ASSERT_EQUAL(1, foo.count());
{ {
Ref<Foo> fooRef(foo); Ref<Foo> fooRef(foo);
CPPUNIT_ASSERT_EQUAL(2U, foo.count_); CPPUNIT_ASSERT_EQUAL(2, foo.count());
} }
CPPUNIT_ASSERT_EQUAL(1U, foo.count_); CPPUNIT_ASSERT_EQUAL(1, foo.count());
} }
} }