Slicer
5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
#include <vtkMath.h>
#include "vtkMRMLCoreTestingUtilities.h"
#include "vtkMRMLNode.h"
#include <vtkAddonTestingMacros.h>
Go to the source code of this file.
Macros | |
#define | CHECK_NODE_ID_AND_NAME(node, expectedID, expectedName) |
Verifies if the node's ID and name are the same as expected. More... | |
#define | CHECK_NODE_IN_SCENE_BY_ID(scene, nodeID, expected) |
Verifies if the node's pointer defined by nodeID in scene is the same as expected. More... | |
#define | EXERCISE_ALL_BASIC_MRML_METHODS(node) CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseAllBasicMRMLMethods(node)); |
Tests all applicable common MRML node methods. More... | |
#define | EXERCISE_BASIC_DISPLAY_MRML_METHODS(className, node) CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicDisplayMRMLMethods(node)); |
#define | EXERCISE_BASIC_DISPLAYABLE_MRML_METHODS(className, node) CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicDisplayableMRMLMethods(node)); |
#define | EXERCISE_BASIC_MRML_METHODS(className, node) CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicMRMLMethods(node)); |
#define | EXERCISE_BASIC_OBJECT_METHODS(node) |
#define | EXERCISE_BASIC_STORABLE_MRML_METHODS(className, node) CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicStorableMRMLMethods(node)); |
#define | EXERCISE_BASIC_STORAGE_MRML_METHODS(className, node) CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicStorageMRMLMethods(node)); |
#define | EXERCISE_BASIC_TRANSFORM_MRML_METHODS(className, node) CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicTransformMRMLMethods(node)); |
#define | EXERCISE_BASIC_TRANSFORMABLE_MRML_METHODS(className, node) CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicTransformableMRMLMethods(node)); |
#define | TEST_GET_OBJECT(object, variable) |
test an object variable via Get More... | |
#define | TEST_ITK_SET_GET(variable, command) |
test itk set/get More... | |
#define | TEST_ITK_SET_GET_VALUE(variable, command) |
test itk set/get More... | |
#define | TEST_SET_GET_BOOLEAN(object, variable) |
test object by calling Set on the variable with false, true, 0, 1, On, Off More... | |
#define | TEST_SET_GET_DOUBLE(object, variable, value) |
#define | TEST_SET_GET_DOUBLE_RANDOM(object, variable, max) |
#define | TEST_SET_GET_DOUBLE_RANGE(object, variable, min, max) |
#define | TEST_SET_GET_INT(object, variable, value) |
#define | TEST_SET_GET_INT_RANDOM(object, variable, max) |
#define | TEST_SET_GET_INT_RANGE(object, variable, min, max) |
#define | TEST_SET_GET_STRING(object, variable) |
test a string variable on the object by calling Set/Get More... | |
#define | TEST_SET_GET_UNSIGNED_INT_RANGE(object, variable, min, max) |
#define | TEST_SET_GET_VALUE(object, variable, value) |
#define | TEST_SET_GET_VECTOR3_DOUBLE(object, variable, x, y, z) |
#define | TEST_SET_GET_VECTOR3_DOUBLE_RANDOM(object, variable, max) |
#define | TEST_SET_GET_VECTOR3_DOUBLE_RANGE(object, variable, min, max) |
#define | TRY_EXPECT_ITK_EXCEPTION(command) |
try the itk command passed in, succeeding if catch an exception More... | |
#define | TRY_EXPECT_NO_ITK_EXCEPTION(command) |
try the command passed in, succeeding if no exception More... | |
#define CHECK_NODE_ID_AND_NAME | ( | node, | |
expectedID, | |||
expectedName | |||
) |
Verifies if the node's ID and name are the same as expected.
Definition at line 35 of file vtkMRMLCoreTestingMacros.h.
#define CHECK_NODE_IN_SCENE_BY_ID | ( | scene, | |
nodeID, | |||
expected | |||
) |
Verifies if the node's pointer defined by nodeID in scene is the same as expected.
Convenience macros for unit tests.
The macro returns from the current method with EXIT_FAILURE if the check fails. Expressions can be passed as arguments, they are guaranteed to be executed only once.
Definition at line 26 of file vtkMRMLCoreTestingMacros.h.
#define EXERCISE_ALL_BASIC_MRML_METHODS | ( | node | ) | CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseAllBasicMRMLMethods(node)); |
Tests all applicable common MRML node methods.
Definition at line 374 of file vtkMRMLCoreTestingMacros.h.
#define EXERCISE_BASIC_DISPLAY_MRML_METHODS | ( | className, | |
node | |||
) | CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicDisplayMRMLMethods(node)); |
Definition at line 394 of file vtkMRMLCoreTestingMacros.h.
#define EXERCISE_BASIC_DISPLAYABLE_MRML_METHODS | ( | className, | |
node | |||
) | CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicDisplayableMRMLMethods(node)); |
Definition at line 391 of file vtkMRMLCoreTestingMacros.h.
#define EXERCISE_BASIC_MRML_METHODS | ( | className, | |
node | |||
) | CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicMRMLMethods(node)); |
Definition at line 382 of file vtkMRMLCoreTestingMacros.h.
#define EXERCISE_BASIC_OBJECT_METHODS | ( | node | ) |
Definition at line 364 of file vtkMRMLCoreTestingMacros.h.
#define EXERCISE_BASIC_STORABLE_MRML_METHODS | ( | className, | |
node | |||
) | CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicStorableMRMLMethods(node)); |
Definition at line 385 of file vtkMRMLCoreTestingMacros.h.
#define EXERCISE_BASIC_STORAGE_MRML_METHODS | ( | className, | |
node | |||
) | CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicStorageMRMLMethods(node)); |
Definition at line 397 of file vtkMRMLCoreTestingMacros.h.
#define EXERCISE_BASIC_TRANSFORM_MRML_METHODS | ( | className, | |
node | |||
) | CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicTransformMRMLMethods(node)); |
Definition at line 400 of file vtkMRMLCoreTestingMacros.h.
#define EXERCISE_BASIC_TRANSFORMABLE_MRML_METHODS | ( | className, | |
node | |||
) | CHECK_EXIT_SUCCESS(vtkMRMLCoreTestingUtilities::ExerciseBasicTransformableMRMLMethods(node)); |
Definition at line 388 of file vtkMRMLCoreTestingMacros.h.
#define TEST_GET_OBJECT | ( | object, | |
variable | |||
) |
test an object variable via Get
Definition at line 252 of file vtkMRMLCoreTestingMacros.h.
#define TEST_ITK_SET_GET | ( | variable, | |
command | |||
) |
test itk set/get
Definition at line 75 of file vtkMRMLCoreTestingMacros.h.
#define TEST_ITK_SET_GET_VALUE | ( | variable, | |
command | |||
) |
test itk set/get
Definition at line 86 of file vtkMRMLCoreTestingMacros.h.
#define TEST_SET_GET_BOOLEAN | ( | object, | |
variable | |||
) |
test object by calling Set on the variable with false, true, 0, 1, On, Off
Definition at line 97 of file vtkMRMLCoreTestingMacros.h.
#define TEST_SET_GET_DOUBLE | ( | object, | |
variable, | |||
value | |||
) |
test a double variable on the object by setting it to input value using Set, and testing it via the Get
Definition at line 202 of file vtkMRMLCoreTestingMacros.h.
#define TEST_SET_GET_DOUBLE_RANDOM | ( | object, | |
variable, | |||
max | |||
) |
test an integer variable on the object by setting it to a random value up to max using Set, and testing it via the Get
Definition at line 239 of file vtkMRMLCoreTestingMacros.h.
#define TEST_SET_GET_DOUBLE_RANGE | ( | object, | |
variable, | |||
min, | |||
max | |||
) |
Test a double variable on object over the range, calls test set get in with min - epsilon, min, min + epsilon, (min+max)/2, max - epsilon, max, max + epsilon, where first and last test should report errors epsilon set to 1.0
Definition at line 217 of file vtkMRMLCoreTestingMacros.h.
#define TEST_SET_GET_INT | ( | object, | |
variable, | |||
value | |||
) |
test an integer variable on the object by setting it to input value using Set, and testing it via the Get
Definition at line 127 of file vtkMRMLCoreTestingMacros.h.
#define TEST_SET_GET_INT_RANDOM | ( | object, | |
variable, | |||
max | |||
) |
test an integer variable on the object by setting it to a random value up to max using Set, and testing it via the Get
Definition at line 164 of file vtkMRMLCoreTestingMacros.h.
#define TEST_SET_GET_INT_RANGE | ( | object, | |
variable, | |||
min, | |||
max | |||
) |
Test an integer variable on object over the range, calls test set get in with min - epsilon, min, min + epsilon, (min+max)/2, max - epsilon, max, max + epsilon, where first and last test should report errors epsilon defined as 1
Definition at line 142 of file vtkMRMLCoreTestingMacros.h.
#define TEST_SET_GET_STRING | ( | object, | |
variable | |||
) |
test a string variable on the object by calling Set/Get
Definition at line 326 of file vtkMRMLCoreTestingMacros.h.
#define TEST_SET_GET_UNSIGNED_INT_RANGE | ( | object, | |
variable, | |||
min, | |||
max | |||
) |
Test an unsigned integer variable on object over the range, calls test set get in with min - epsilon, min, min + epsilon, (min+max)/2, max - epsilon, max, max + epsilon, where first and last test should report errors epsilon defined as 1
Definition at line 180 of file vtkMRMLCoreTestingMacros.h.
#define TEST_SET_GET_VALUE | ( | object, | |
variable, | |||
value | |||
) |
test an object variable on the object by setting it to input value using Set, and testing it via the Get
Definition at line 263 of file vtkMRMLCoreTestingMacros.h.
#define TEST_SET_GET_VECTOR3_DOUBLE | ( | object, | |
variable, | |||
x, | |||
y, | |||
z | |||
) |
test a vector variable on the object by setting it to a the values x, y, z passed in using Set, and testing it via the Get
Definition at line 276 of file vtkMRMLCoreTestingMacros.h.
#define TEST_SET_GET_VECTOR3_DOUBLE_RANDOM | ( | object, | |
variable, | |||
max | |||
) |
test a vector variable on the object by setting all it's elements to the same random value up to max using Set, and testing it via the Get
Definition at line 309 of file vtkMRMLCoreTestingMacros.h.
#define TEST_SET_GET_VECTOR3_DOUBLE_RANGE | ( | object, | |
variable, | |||
min, | |||
max | |||
) |
Test a double vector variable on object over the range, calls test set get in with min - epsilon, min, min + epsilon, (min+max)/2, max - epsilon, max, max + epsilon, where first and last test should report errors. For now all three elements are set to the same thing each time. epsilon set to 1.0
Definition at line 293 of file vtkMRMLCoreTestingMacros.h.
#define TRY_EXPECT_ITK_EXCEPTION | ( | command | ) |
try the itk command passed in, succeeding if catch an exception
Definition at line 45 of file vtkMRMLCoreTestingMacros.h.
#define TRY_EXPECT_NO_ITK_EXCEPTION | ( | command | ) |
try the command passed in, succeeding if no exception
Definition at line 61 of file vtkMRMLCoreTestingMacros.h.