12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #ifdef NICE_USELIB_CPPUNIT
- #include "TestGenericLocalFeatureSelectionPersistent.h"
- using namespace std;
- using namespace NICE;
- const bool verboseStartEnd = true;
- const bool verbose = true;
- CPPUNIT_TEST_SUITE_REGISTRATION( TestGenericLocalFeatureSelectionPersistent );
- void TestGenericLocalFeatureSelectionPersistent::setUp() {
- }
- void TestGenericLocalFeatureSelectionPersistent::tearDown() {
- }
- void TestGenericLocalFeatureSelectionPersistent::testPersistentMethods()
- {
-
- if (verboseStartEnd)
- std::cerr << "================== TestGenericLocalFeatureSelectionPersistent::testPersistentMethods ===================== " << std::endl;
-
- NICE::Config conf;
- conf.sS( "GenericLocalFeatureSelection", "localfeature_type", "LocalFeatureSift" );
- OBJREC::LocalFeature * lf;
-
- lf = OBJREC::GenericLocalFeatureSelection::selectLocalFeature ( &conf, "GenericLocalFeatureSelection");
-
-
- if ( verbose )
- std::cerr << " TEST STORING ABILITIES FOR STANDARD LOCALFEATURE" << std::endl;
-
- std::string s_destination_save ( "myLocalFeatureSelection.txt" );
-
- std::filebuf fbOut;
- fbOut.open ( s_destination_save.c_str(), ios::out );
- std::ostream os (&fbOut);
-
- lf->store( os );
-
- fbOut.close();
-
-
- if ( verbose )
- std::cerr << " TEST RESTORING ABILITIES FOR STANDARD LOCALFEATURE" << std::endl;
-
- OBJREC::LocalFeature * lfRestore = NULL;
-
- std::string s_destination_load ( "myLocalFeatureSelection.txt" );
-
- std::filebuf fbIn;
- fbIn.open ( s_destination_load.c_str(), ios::in );
- std::istream is (&fbIn);
-
- OBJREC::GenericLocalFeatureSelection::restoreLocalFeature ( lfRestore, is );
-
- fbIn.close();
-
-
-
-
-
-
- if ( lf != NULL )
- delete lf;
-
- if ( lfRestore != NULL )
- delete lfRestore;
-
-
- if (verboseStartEnd)
- std::cerr << "================== TestGenericLocalFeatureSelectionPersistent::testPersistentMethods done ===================== " << std::endl;
-
- }
- #endif
|