12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #ifdef NICE_USELIB_CPPUNIT
- #include "TestGenericLFSelectionPersistent.h"
- using namespace std;
- using namespace NICE;
- const bool verboseStartEnd = true;
- const bool verbose = true;
- CPPUNIT_TEST_SUITE_REGISTRATION( TestGenericLFSelectionPersistent );
- void TestGenericLFSelectionPersistent::setUp() {
- }
- void TestGenericLFSelectionPersistent::tearDown() {
- }
- void TestGenericLFSelectionPersistent::testPersistentMethods()
- {
-
- if (verboseStartEnd)
- std::cerr << "================== TestGenericLFSelectionPersistent::testPersistentMethods ===================== " << std::endl;
-
- NICE::Config conf;
- conf.sS( "GenericLFSelection", "localfeature_type", "sift" );
- OBJREC::LocalFeatureRepresentation * lfrep;
-
- lfrep = OBJREC::GenericLFSelection::selectLocalFeatureRep ( &conf, "GenericLFSelection");
-
-
- if ( verbose )
- std::cerr << " TEST STORING ABILITIES " << std::endl;
-
- std::string s_destination_save ( "myLFSelection.txt" );
-
- std::filebuf fbOut;
- fbOut.open ( s_destination_save.c_str(), ios::out );
- std::ostream os (&fbOut);
-
- lfrep->store( os );
-
- fbOut.close();
-
-
- if ( verbose )
- std::cerr << " TEST RESTORING ABILITIES " << std::endl;
-
- OBJREC::LocalFeatureRepresentation * lfrepRestore = NULL;
-
- std::string s_destination_load ( "myLFSelection.txt" );
-
- std::filebuf fbIn;
- fbIn.open ( s_destination_load.c_str(), ios::in );
- std::istream is (&fbIn);
-
- OBJREC::GenericLFSelection::restoreLocalFeatureRep ( lfrepRestore, is );
-
- fbIn.close();
-
-
-
-
-
-
- if ( lfrep != NULL )
- delete lfrep;
-
- if ( lfrepRestore != NULL )
- delete lfrepRestore;
-
-
- if (verboseStartEnd)
- std::cerr << "================== TestGenericLFSelectionPersistent::testPersistentMethods done ===================== " << std::endl;
-
- }
- #endif
|