ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkGTest.h File Reference
#include "gtest/gtest.h"
#include "itkGTestPredicate.h"
#include "itkGTestTypedefsAndConstructors.h"
+ Include dependency graph for itkGTest.h:

Go to the source code of this file.

Namespaces

namespace  itk::GTest
 

Macros

#define ITK_GTEST_EXERCISE_BASIC_OBJECT_METHODS(object, ClassName, SuperclassName)
 
#define ITK_GTEST_SET_GET_BOOLEAN(object, variable, value)
 

Macro Definition Documentation

◆ ITK_GTEST_EXERCISE_BASIC_OBJECT_METHODS

#define ITK_GTEST_EXERCISE_BASIC_OBJECT_METHODS ( object,
ClassName,
SuperclassName )
Value:
[object] { \
std::ostringstream outputStreamForPrintExercise; \
object->Print(outputStreamForPrintExercise); \
EXPECT_FALSE(outputStreamForPrintExercise.str().empty()); \
EXPECT_STREQ(object->Self::GetNameOfClass(), #ClassName); \
EXPECT_STREQ(object->Superclass::GetNameOfClass(), #SuperclassName); \
}()

A lightweight alternative for ITK_EXERCISE_BASIC_OBJECT_METHODS, using GoogleTest macro's.

Definition at line 36 of file itkGTest.h.

◆ ITK_GTEST_SET_GET_BOOLEAN

#define ITK_GTEST_SET_GET_BOOLEAN ( object,
variable,
value )
Value:
object->Set##variable(false); \
object->Set##variable(true); \
EXPECT_TRUE(object->Get##variable()); \
object->Set##variable(false); \
EXPECT_FALSE(object->Get##variable()); \
object->variable##On(); \
EXPECT_TRUE(object->Get##variable()); \
object->variable##Off(); \
EXPECT_FALSE(object->Get##variable()); \
object->Set##variable(value)

A lightweight alternative for ITK_TEST_SET_GET_BOOLEAN, using GoogleTest macro's.

Definition at line 47 of file itkGTest.h.