|
Slicer 5.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
#include <vtkMath.h>#include <iostream>#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. | |
| #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. | |
| #define | EXERCISE_ALL_BASIC_MRML_METHODS(node) |
| Tests all applicable common MRML node methods. | |
| #define | EXERCISE_BASIC_DISPLAY_MRML_METHODS(className, node) |
| #define | EXERCISE_BASIC_DISPLAYABLE_MRML_METHODS(className, node) |
| #define | EXERCISE_BASIC_MRML_METHODS(className, node) |
| #define | EXERCISE_BASIC_OBJECT_METHODS(node) |
| #define | EXERCISE_BASIC_STORABLE_MRML_METHODS(className, node) |
| #define | EXERCISE_BASIC_STORAGE_MRML_METHODS(className, node) |
| #define | EXERCISE_BASIC_TRANSFORM_MRML_METHODS(className, node) |
| #define | EXERCISE_BASIC_TRANSFORMABLE_MRML_METHODS(className, node) |
| #define | TEST_GET_OBJECT(object, variable) |
| test an object variable via Get | |
| #define | TEST_ITK_SET_GET(variable, command) |
| test itk set/get | |
| #define | TEST_ITK_SET_GET_VALUE(variable, command) |
| test itk set/get | |
| #define | TEST_SET_GET_BOOLEAN(object, variable) |
| test object by calling Set on the variable with false, true, 0, 1, On, Off | |
| #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_STD_STRING(object, variable) |
| test a string variable on the object by calling Set/Get | |
| #define | TEST_SET_GET_STRING(object, variable) |
| test a string variable on the object by calling Set/Get | |
| #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 | |
| #define | TRY_EXPECT_NO_ITK_EXCEPTION(command) |
| try the command passed in, succeeding if no exception | |
| #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 38 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 29 of file vtkMRMLCoreTestingMacros.h.
| #define EXERCISE_ALL_BASIC_MRML_METHODS | ( | node | ) |
Tests all applicable common MRML node methods.
Definition at line 407 of file vtkMRMLCoreTestingMacros.h.
| #define EXERCISE_BASIC_DISPLAY_MRML_METHODS | ( | className, | |
| node ) |
Definition at line 422 of file vtkMRMLCoreTestingMacros.h.
| #define EXERCISE_BASIC_DISPLAYABLE_MRML_METHODS | ( | className, | |
| node ) |
Definition at line 420 of file vtkMRMLCoreTestingMacros.h.
| #define EXERCISE_BASIC_MRML_METHODS | ( | className, | |
| node ) |
Definition at line 414 of file vtkMRMLCoreTestingMacros.h.
| #define EXERCISE_BASIC_OBJECT_METHODS | ( | node | ) |
Definition at line 397 of file vtkMRMLCoreTestingMacros.h.
| #define EXERCISE_BASIC_STORABLE_MRML_METHODS | ( | className, | |
| node ) |
Definition at line 416 of file vtkMRMLCoreTestingMacros.h.
| #define EXERCISE_BASIC_STORAGE_MRML_METHODS | ( | className, | |
| node ) |
Definition at line 424 of file vtkMRMLCoreTestingMacros.h.
| #define EXERCISE_BASIC_TRANSFORM_MRML_METHODS | ( | className, | |
| node ) |
Definition at line 426 of file vtkMRMLCoreTestingMacros.h.
| #define EXERCISE_BASIC_TRANSFORMABLE_MRML_METHODS | ( | className, | |
| node ) |
Definition at line 418 of file vtkMRMLCoreTestingMacros.h.
| #define TEST_GET_OBJECT | ( | object, | |
| variable ) |
test an object variable via Get
Definition at line 255 of file vtkMRMLCoreTestingMacros.h.
| #define TEST_ITK_SET_GET | ( | variable, | |
| command ) |
test itk set/get
Definition at line 78 of file vtkMRMLCoreTestingMacros.h.
| #define TEST_ITK_SET_GET_VALUE | ( | variable, | |
| command ) |
test itk set/get
Definition at line 89 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 100 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 205 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 242 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 220 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 130 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 167 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 145 of file vtkMRMLCoreTestingMacros.h.
| #define TEST_SET_GET_STD_STRING | ( | object, | |
| variable ) |
test a string variable on the object by calling Set/Get
Definition at line 371 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 329 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 183 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 266 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 279 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 312 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 296 of file vtkMRMLCoreTestingMacros.h.
| #define TRY_EXPECT_ITK_EXCEPTION | ( | command | ) |
try the itk command passed in, succeeding if catch an exception
Definition at line 48 of file vtkMRMLCoreTestingMacros.h.
| #define TRY_EXPECT_NO_ITK_EXCEPTION | ( | command | ) |
try the command passed in, succeeding if no exception
Definition at line 64 of file vtkMRMLCoreTestingMacros.h.