void testClear( ) { FileBasedStore store( DIRECTORY_BASE ); std::string sectionName = "alpha"; SerializableList allValues; allValues.push_back( makeSerializableWrapperPtr( 10 ) ); store.saveSection( sectionName, allValues ); store.clear(); CPPUNIT_ASSERT( ! store.hasSection( sectionName ) ); }
void testSaveSection( ) { FileBasedStore store( DIRECTORY_BASE ); RecordedGrip grip = makeSerializableWrapperPtr( 10 ); SerializableList allValues; allValues.push_back( grip ); store.saveSection( "anExample", allValues ); CPPUNIT_ASSERT( store.hasSection( "anExample" ) ); SerializableList retrievedValues; store.retrieveSection( "anExample", retrievedValues ); CPPUNIT_ASSERT( grip == *( retrievedValues.begin( ) ) ); }