additional test for release and reset

master
Marc Wäckerlin 20 years ago
parent 7fd9fbc634
commit 0fe2e6ea60
  1. 10
      mrw/auto_test.cpp

@ -9,6 +9,9 @@
@license LGPL, see file <a href="license.html">COPYING</a> @license LGPL, see file <a href="license.html">COPYING</a>
$Log$ $Log$
Revision 1.4 2004/11/25 18:27:03 marc
additional test for release and reset
Revision 1.3 2004/08/28 16:21:25 marc Revision 1.3 2004/08/28 16:21:25 marc
mrw-c++-0.92 (mrw) mrw-c++-0.92 (mrw)
- new file: version.cpp - new file: version.cpp
@ -63,8 +66,11 @@ public:
CPPUNIT_ASSERT(c); CPPUNIT_ASSERT(c);
strncpy(c, C, sizeof(C)); strncpy(c, C, sizeof(C));
CPPUNIT_ASSERT(std::string(c)==C); CPPUNIT_ASSERT(std::string(c)==C);
c.release(); mrw::Auto<char*>::Free c2(c.release());
CPPUNIT_ASSERT(c==0); CPPUNIT_ASSERT(c==0 && c2!=0);
CPPUNIT_ASSERT(std::string(c2)==C);
c2.reset();
CPPUNIT_ASSERT(c2==0);
} }
CPPUNIT_TEST_SUITE(AutoTest); CPPUNIT_TEST_SUITE(AutoTest);
CPPUNIT_TEST(AutoFile); CPPUNIT_TEST(AutoFile);

Loading…
Cancel
Save