+void ScopeGuardTestCase::BlockExitSetVar()
+{
+ m_count = 1;
+ {
+ wxON_BLOCK_EXIT_SET(m_count, 17);
+
+ CPPUNIT_ASSERT_EQUAL( 1, m_count );
+ }
+ CPPUNIT_ASSERT_EQUAL( 17, m_count );
+
+
+ int count = 1;
+ {
+ wxON_BLOCK_EXIT_SET(count, 17);
+
+ CPPUNIT_ASSERT_EQUAL( 1, count );
+ }
+ CPPUNIT_ASSERT_EQUAL( 17, count );
+
+
+ wxString s("hi");
+ {
+ wxON_BLOCK_EXIT_SET(s, "bye");
+
+ CPPUNIT_ASSERT_EQUAL( "hi", s );
+ }
+ CPPUNIT_ASSERT_EQUAL( "bye", s );
+
+ ScopeGuardTestCase *p = this;
+ {
+ wxON_BLOCK_EXIT_NULL(p);
+
+ CPPUNIT_ASSERT( p );
+ }
+ CPPUNIT_ASSERT( !p );
+}