#include "mitkClassName.h"#include "mitkTestingMacros.h"#include <iostream>Go to the source code of this file.
Functions | |
| int | mitkClassNameTest (int, char *[]) |
| int mitkClassNameTest | ( | int | , |
| char * | [] | ||
| ) |
Simple example for a test for the (non-existent) class "ClassName".
argc and argv are the command line parameters which were passed to the ADD_TEST command in the CMakeLists.txt file. For the automatic tests, argv is either empty for the simple tests or contains the filename of a test image for the image tests (see CMakeLists.txt).
Definition at line 32 of file mitkTestTemplate.cpp.
References MITK_TEST_BEGIN, MITK_TEST_CONDITION_REQUIRED, and MITK_TEST_END.
{
// always start with this!
MITK_TEST_BEGIN("ClassName")
// let's create an object of our class
mitk::ClassName::Pointer myClassName = mitk::ClassName::New();
// first test: did this work?
// using MITK_TEST_CONDITION_REQUIRED makes the test stop after failure, since
// it makes no sense to continue without an object.
MITK_TEST_CONDITION_REQUIRED(myClassName.IsNotNull(),"Testing instantiation")
// write your own tests here and use the macros from mitkTestingMacros.h !!!
// do not write to std::cout and do not return from this function yourself!
// always end with this!
MITK_TEST_END()
}
1.7.2