Skip to content
Snippets Groups Projects
Commit 1e77e32f authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

TEST: increase coverage for WriterWatcher

parent 353addc7
Branches
Tags
No related merge requests found
...@@ -50,13 +50,14 @@ int otbStandardWriterWatcher(int argc, char * argv[]) ...@@ -50,13 +50,14 @@ int otbStandardWriterWatcher(int argc, char * argv[])
writer1->SetInput(gradient->GetOutput()); writer1->SetInput(gradient->GetOutput());
writer1->SetFileName(outfname); writer1->SetFileName(outfname);
otb::StandardWriterWatcher watcher1(writer1, "Gradient (streaming)"); typedef otb::StandardWriterWatcher WatcherType;
WatcherType watcher1(writer1, "Gradient (streaming)");
otb::StandardWriterWatcher watcher3(writer1, gradient, "Gradient"); // otb::StandardWriterWatcher watcher3(writer1, gradient, "Gradient");
//
otb::StandardWriterWatcher watcher4(watcher1); // otb::StandardWriterWatcher watcher4(watcher1);
//
otb::StandardWriterWatcher watcher5 = watcher1; // otb::StandardWriterWatcher watcher5 = watcher1;
writer1->Update(); writer1->Update();
...@@ -67,5 +68,28 @@ int otbStandardWriterWatcher(int argc, char * argv[]) ...@@ -67,5 +68,28 @@ int otbStandardWriterWatcher(int argc, char * argv[])
otb::StandardWriterWatcher watcher2(writer2, "Gradient (non streaming)"); otb::StandardWriterWatcher watcher2(writer2, "Gradient (non streaming)");
writer2->Update(); writer2->Update();
// Test copy constructor.
WatcherType watcher3( watcher1 );
if ( watcher1.GetNameOfClass() != watcher3.GetNameOfClass()
|| watcher1.GetProcess() != watcher3.GetProcess()
|| watcher1.GetComment() != watcher3.GetComment() )
{
std::cout << "Copy constructor failed." << std::endl;
return EXIT_FAILURE;
}
// Test default constructor.
WatcherType watcher4;
// Test assignment operator.
watcher4 = watcher3;
if ( watcher4.GetNameOfClass() != watcher3.GetNameOfClass()
|| watcher4.GetProcess() != watcher3.GetProcess()
|| watcher4.GetComment() != watcher3.GetComment() )
{
std::cout << "Operator= failed." << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment