From 5deae229597d0c706d2bfadc6288366153ff8bd5 Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Mon, 10 Aug 2026 19:07:54 +0100 Subject: [PATCH 1/4] tests: make CoinTests filterable for crash diagnosis --- testsuite/CoinTest.h | 98 +++++++++++++++++++++++++++++++++++-- testsuite/TestSuiteMain.cpp | 2 +- 2 files changed, 96 insertions(+), 4 deletions(-) diff --git a/testsuite/CoinTest.h b/testsuite/CoinTest.h index 7689a2fc484..3396d79ba8b 100644 --- a/testsuite/CoinTest.h +++ b/testsuite/CoinTest.h @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -100,14 +101,91 @@ inline void check_equal(const A & a, const B & b, } } -inline int run_all(void) +inline void print_usage(const char * program) +{ + std::fprintf(stderr, + "Usage: %s [--list] [--test NAME | --filter TEXT] [--max-tests N]\n", + program); +} + +inline bool parse_max_tests(const char * text, size_t & value) +{ + if (!text || !text[0]) return false; + char * end = NULL; + const unsigned long parsed = std::strtoul(text, &end, 10); + if (*end != '\0' || parsed == 0) return false; + value = static_cast(parsed); + return true; +} + +inline int run_all(int argc, char ** argv) { const std::vector & tests = registry(); + const char * exact_name = NULL; + const char * name_filter = NULL; + size_t max_tests = 0; + bool list_tests = false; + + for (int i = 1; i < argc; ++i) { + const char * arg = argv[i]; + if (std::strcmp(arg, "--list") == 0) { + list_tests = true; + } + else if (std::strcmp(arg, "--test") == 0 || + std::strcmp(arg, "--filter") == 0) { + if (i + 1 >= argc) { + print_usage(argv[0]); + return 2; + } + if (std::strcmp(arg, "--test") == 0) { + if (exact_name || name_filter) { + print_usage(argv[0]); + return 2; + } + exact_name = argv[++i]; + } + else { + if (exact_name || name_filter) { + print_usage(argv[0]); + return 2; + } + name_filter = argv[++i]; + } + } + else if (std::strcmp(arg, "--max-tests") == 0) { + if (i + 1 >= argc || !parse_max_tests(argv[++i], max_tests)) { + print_usage(argv[0]); + return 2; + } + } + else { + print_usage(argv[0]); + return 2; + } + } + + if (list_tests) { + for (size_t i = 0; i < tests.size(); ++i) { + const TestCase & tc = tests[i]; + std::fprintf(stdout, "%zu\t%s\t%s:%d\n", i + 1, tc.name, tc.file, tc.line); + } + return 0; + } + int failedtests = 0; int totalchecks = 0; + size_t selectedtests = 0; for (size_t i = 0; i < tests.size(); ++i) { const TestCase & tc = tests[i]; + if (exact_name && std::strcmp(tc.name, exact_name) != 0) continue; + if (name_filter && !std::strstr(tc.name, name_filter)) continue; + if (max_tests && selectedtests >= max_tests) break; + selectedtests += 1; + + std::fprintf(stderr, "[RUN %zu/%zu] %s (%s:%d)\n", + i + 1, tests.size(), tc.name, tc.file, tc.line); + std::fflush(stderr); Context ctx; current_context() = &ctx; @@ -123,6 +201,9 @@ inline int run_all(void) } current_context() = NULL; + std::fprintf(stderr, "[DONE %zu/%zu] %s\n", + i + 1, tests.size(), tc.name); + std::fflush(stderr); totalchecks += ctx.checks; if (ctx.failed) { @@ -135,15 +216,26 @@ inline int run_all(void) } } + if (selectedtests == 0) { + std::fprintf(stderr, "[ERROR] no tests selected\n"); + return 2; + } + if (failedtests == 0) { - std::fprintf(stderr, "[OK] %zu tests, %d checks\n", tests.size(), totalchecks); + std::fprintf(stderr, "[OK] %zu tests, %d checks\n", selectedtests, totalchecks); return 0; } - std::fprintf(stderr, "[FAIL] %d/%zu tests failed, %d checks\n", failedtests, tests.size(), totalchecks); + std::fprintf(stderr, "[FAIL] %d/%zu tests failed, %d checks\n", + failedtests, selectedtests, totalchecks); return 1; } +inline int run_all(void) +{ + return run_all(0, NULL); +} + } // namespace CoinTest // --------------------------------------------------------------------------- diff --git a/testsuite/TestSuiteMain.cpp b/testsuite/TestSuiteMain.cpp index aeb890d6d3e..4810427f765 100644 --- a/testsuite/TestSuiteMain.cpp +++ b/testsuite/TestSuiteMain.cpp @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) SoInteraction::init(); TestSuite::Init(); - int rc = CoinTest::run_all(); + int rc = CoinTest::run_all(argc, argv); SoDB::finish(); From 5f5ce98a63be55dd77db6574984d43113101da24 Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Sat, 15 Aug 2026 17:30:45 +0100 Subject: [PATCH 2/4] tests: extract component tests from library sources --- src/actions/SoCallbackAction.cpp | 38 -- src/actions/SoWriteAction.cpp | 79 ----- src/base/SbBSPTree.cpp | 45 --- src/base/SbBox2d.cpp | 31 -- src/base/SbBox2f.cpp | 31 -- src/base/SbBox2i32.cpp | 16 - src/base/SbBox2s.cpp | 16 - src/base/SbBox3d.cpp | 20 -- src/base/SbBox3f.cpp | 20 -- src/base/SbBox3i32.cpp | 32 -- src/base/SbBox3s.cpp | 31 -- src/base/SbByteBuffer.cpp | 64 ---- src/base/SbDPMatrix.cpp | 14 - src/base/SbDPPlane.cpp | 152 -------- src/base/SbDPRotation.cpp | 8 - src/base/SbImage.cpp | 34 -- src/base/SbMatrix.cpp | 14 - src/base/SbPlane.cpp | 22 -- src/base/SbRotation.cpp | 59 ---- src/base/SbString.cpp | 29 -- src/base/SbVec3d.cpp | 21 -- src/base/SbVec3f.cpp | 39 --- src/base/SbVec3s.cpp | 30 -- src/base/SbVec3us.cpp | 4 - src/base/SbVec4f.cpp | 49 --- src/base/SbViewVolume.cpp | 70 ---- src/base/heap.cpp | 109 ------ src/base/rbptree.cpp | 56 --- src/draggers/SoTransformerDragger.cpp | 75 ---- src/fields/SoMFBitMask.cpp | 12 - src/fields/SoMFBool.cpp | 25 -- src/fields/SoMFColor.cpp | 12 - src/fields/SoMFColorRGBA.cpp | 12 - src/fields/SoMFDouble.cpp | 12 - src/fields/SoMFEngine.cpp | 13 - src/fields/SoMFEnum.cpp | 13 - src/fields/SoMFFloat.cpp | 12 - src/fields/SoMFInt32.cpp | 12 - src/fields/SoMFMatrix.cpp | 12 - src/fields/SoMFName.cpp | 12 - src/fields/SoMFNode.cpp | 38 -- src/fields/SoMFPath.cpp | 12 - src/fields/SoMFPlane.cpp | 12 - src/fields/SoMFRotation.cpp | 12 - src/fields/SoMFShort.cpp | 12 - src/fields/SoMFString.cpp | 12 - src/fields/SoMFTime.cpp | 12 - src/fields/SoMFUInt32.cpp | 12 - src/fields/SoMFUShort.cpp | 12 - src/fields/SoMFVec2b.cpp | 12 - src/fields/SoMFVec2d.cpp | 12 - src/fields/SoMFVec2f.cpp | 12 - src/fields/SoMFVec2i32.cpp | 12 - src/fields/SoMFVec2s.cpp | 12 - src/fields/SoMFVec3b.cpp | 12 - src/fields/SoMFVec3d.cpp | 12 - src/fields/SoMFVec3f.cpp | 12 - src/fields/SoMFVec3i32.cpp | 12 - src/fields/SoMFVec3s.cpp | 12 - src/fields/SoMFVec4b.cpp | 12 - src/fields/SoMFVec4d.cpp | 12 - src/fields/SoMFVec4f.cpp | 12 - src/fields/SoMFVec4i32.cpp | 12 - src/fields/SoMFVec4s.cpp | 12 - src/fields/SoMFVec4ub.cpp | 35 -- src/fields/SoMFVec4ui32.cpp | 12 - src/fields/SoMFVec4us.cpp | 12 - src/fields/SoSFBitMask.cpp | 83 ----- src/fields/SoSFBool.cpp | 48 --- src/fields/SoSFBox2d.cpp | 13 - src/fields/SoSFBox2f.cpp | 13 - src/fields/SoSFBox2i32.cpp | 13 - src/fields/SoSFBox2s.cpp | 13 - src/fields/SoSFBox3d.cpp | 13 - src/fields/SoSFBox3f.cpp | 13 - src/fields/SoSFBox3i32.cpp | 13 - src/fields/SoSFBox3s.cpp | 13 - src/fields/SoSFColor.cpp | 13 - src/fields/SoSFColorRGBA.cpp | 26 -- src/fields/SoSFDouble.cpp | 13 - src/fields/SoSFEngine.cpp | 13 - src/fields/SoSFEnum.cpp | 13 - src/fields/SoSFFloat.cpp | 13 - src/fields/SoSFImage.cpp | 13 - src/fields/SoSFImage3.cpp | 13 - src/fields/SoSFInt32.cpp | 13 - src/fields/SoSFMatrix.cpp | 13 - src/fields/SoSFName.cpp | 13 - src/fields/SoSFNode.cpp | 38 -- src/fields/SoSFPath.cpp | 14 - src/fields/SoSFPlane.cpp | 13 - src/fields/SoSFRotation.cpp | 13 - src/fields/SoSFShort.cpp | 13 - src/fields/SoSFString.cpp | 13 - src/fields/SoSFTime.cpp | 13 - src/fields/SoSFTrigger.cpp | 13 - src/fields/SoSFUInt32.cpp | 13 - src/fields/SoSFUShort.cpp | 13 - src/fields/SoSFVec2b.cpp | 13 - src/fields/SoSFVec2d.cpp | 13 - src/fields/SoSFVec2f.cpp | 13 - src/fields/SoSFVec2i32.cpp | 13 - src/fields/SoSFVec2s.cpp | 13 - src/fields/SoSFVec3b.cpp | 13 - src/fields/SoSFVec3d.cpp | 13 - src/fields/SoSFVec3f.cpp | 13 - src/fields/SoSFVec3i32.cpp | 13 - src/fields/SoSFVec3s.cpp | 13 - src/fields/SoSFVec4b.cpp | 13 - src/fields/SoSFVec4d.cpp | 13 - src/fields/SoSFVec4f.cpp | 13 - src/fields/SoSFVec4i32.cpp | 13 - src/fields/SoSFVec4s.cpp | 13 - src/fields/SoSFVec4ub.cpp | 28 -- src/fields/SoSFVec4ui32.cpp | 13 - src/fields/SoSFVec4us.cpp | 35 -- src/geo/SoGeoCoordinate.cpp | 14 - src/geo/SoGeoElement.cpp | 10 - src/geo/SoGeoLocation.cpp | 14 - src/geo/SoGeoOrigin.cpp | 14 - src/geo/SoGeoSeparator.cpp | 13 - src/misc/SoBase.cpp | 270 --------------- src/misc/SoBaseP.cpp | 59 ---- src/misc/SoDB.cpp | 214 ------------ src/misc/SoType.cpp | 26 -- src/nodes/SoAnnotation.cpp | 14 - src/scxml/SbStringConvert.cpp | 113 ------ src/scxml/ScXMLMinimumEvaluator.cpp | 44 --- src/shaders/SoFragmentShader.cpp | 14 - src/shaders/SoGeometryShader.cpp | 14 - src/shaders/SoShaderParameter.cpp | 163 --------- src/shaders/SoShaderProgram.cpp | 14 - src/shaders/SoVertexShader.cpp | 14 - src/shadows/SoGLShadowCullingElement.cpp | 11 - src/shadows/SoShadowCulling.cpp | 15 - src/shadows/SoShadowDirectionalLight.cpp | 14 - src/shadows/SoShadowGroup.cpp | 14 - src/shadows/SoShadowSpotLight.cpp | 16 - src/shadows/SoShadowStyle.cpp | 16 - src/shadows/SoShadowStyleElement.cpp | 11 - src/soscxml/ScXMLCoinEvaluator.cpp | 80 ----- src/xml/document.cpp | 35 -- testsuite/CMakeLists.txt | 44 +-- testsuite/actions/SoCallbackActionTest.cpp | 95 +++++ testsuite/actions/SoWriteActionTest.cpp | 135 ++++++++ testsuite/base/SbBSPTreeTest.cpp | 103 ++++++ testsuite/base/SbBox2dTest.cpp | 89 +++++ testsuite/base/SbBox2fTest.cpp | 89 +++++ testsuite/base/SbBox2i32Test.cpp | 74 ++++ testsuite/base/SbBox2sTest.cpp | 74 ++++ testsuite/base/SbBox3dTest.cpp | 78 +++++ testsuite/base/SbBox3fTest.cpp | 78 +++++ testsuite/base/SbBox3i32Test.cpp | 89 +++++ testsuite/base/SbBox3sTest.cpp | 90 +++++ testsuite/base/SbByteBufferTest.cpp | 121 +++++++ testsuite/base/SbDPMatrixTest.cpp | 72 ++++ testsuite/base/SbDPPlaneTest.cpp | 208 +++++++++++ testsuite/base/SbDPRotationTest.cpp | 65 ++++ testsuite/base/SbImageTest.cpp | 91 +++++ testsuite/base/SbMatrixTest.cpp | 72 ++++ testsuite/base/SbPlaneTest.cpp | 79 +++++ testsuite/base/SbRotationTest.cpp | 117 +++++++ testsuite/base/SbStringTest.cpp | 86 +++++ testsuite/base/SbVec3dTest.cpp | 79 +++++ testsuite/base/SbVec3fTest.cpp | 96 +++++ testsuite/base/SbVec3sTest.cpp | 87 +++++ testsuite/base/SbVec3usTest.cpp | 62 ++++ testsuite/base/SbVec4fTest.cpp | 107 ++++++ testsuite/base/SbViewVolumeTest.cpp | 126 +++++++ testsuite/base/heapTest.cpp | 166 +++++++++ testsuite/base/rbptreeTest.cpp | 112 ++++++ .../draggers/SoTransformerDraggerTest.cpp | 132 +++++++ testsuite/fields/SoMFBitMaskTest.cpp | 70 ++++ testsuite/fields/SoMFBoolTest.cpp | 83 +++++ testsuite/fields/SoMFColorRGBATest.cpp | 70 ++++ testsuite/fields/SoMFColorTest.cpp | 70 ++++ testsuite/fields/SoMFDoubleTest.cpp | 70 ++++ testsuite/fields/SoMFEngineTest.cpp | 70 ++++ testsuite/fields/SoMFEnumTest.cpp | 70 ++++ testsuite/fields/SoMFFloatTest.cpp | 70 ++++ testsuite/fields/SoMFInt32Test.cpp | 70 ++++ testsuite/fields/SoMFMatrixTest.cpp | 70 ++++ testsuite/fields/SoMFNameTest.cpp | 70 ++++ testsuite/fields/SoMFNodeTest.cpp | 94 +++++ testsuite/fields/SoMFPathTest.cpp | 70 ++++ testsuite/fields/SoMFPlaneTest.cpp | 70 ++++ testsuite/fields/SoMFRotationTest.cpp | 70 ++++ testsuite/fields/SoMFShortTest.cpp | 70 ++++ testsuite/fields/SoMFStringTest.cpp | 70 ++++ testsuite/fields/SoMFTimeTest.cpp | 70 ++++ testsuite/fields/SoMFUInt32Test.cpp | 70 ++++ testsuite/fields/SoMFUShortTest.cpp | 70 ++++ testsuite/fields/SoMFVec2bTest.cpp | 70 ++++ testsuite/fields/SoMFVec2dTest.cpp | 70 ++++ testsuite/fields/SoMFVec2fTest.cpp | 70 ++++ testsuite/fields/SoMFVec2i32Test.cpp | 70 ++++ testsuite/fields/SoMFVec2sTest.cpp | 70 ++++ testsuite/fields/SoMFVec3bTest.cpp | 70 ++++ testsuite/fields/SoMFVec3dTest.cpp | 70 ++++ testsuite/fields/SoMFVec3fTest.cpp | 70 ++++ testsuite/fields/SoMFVec3i32Test.cpp | 70 ++++ testsuite/fields/SoMFVec3sTest.cpp | 70 ++++ testsuite/fields/SoMFVec4bTest.cpp | 70 ++++ testsuite/fields/SoMFVec4dTest.cpp | 70 ++++ testsuite/fields/SoMFVec4fTest.cpp | 70 ++++ testsuite/fields/SoMFVec4i32Test.cpp | 70 ++++ testsuite/fields/SoMFVec4sTest.cpp | 70 ++++ testsuite/fields/SoMFVec4ubTest.cpp | 93 +++++ testsuite/fields/SoMFVec4ui32Test.cpp | 70 ++++ testsuite/fields/SoMFVec4usTest.cpp | 70 ++++ testsuite/fields/SoSFBitMaskTest.cpp | 139 ++++++++ testsuite/fields/SoSFBoolTest.cpp | 106 ++++++ testsuite/fields/SoSFBox2dTest.cpp | 71 ++++ testsuite/fields/SoSFBox2fTest.cpp | 71 ++++ testsuite/fields/SoSFBox2i32Test.cpp | 71 ++++ testsuite/fields/SoSFBox2sTest.cpp | 71 ++++ testsuite/fields/SoSFBox3dTest.cpp | 71 ++++ testsuite/fields/SoSFBox3fTest.cpp | 71 ++++ testsuite/fields/SoSFBox3i32Test.cpp | 71 ++++ testsuite/fields/SoSFBox3sTest.cpp | 71 ++++ testsuite/fields/SoSFColorRGBATest.cpp | 84 +++++ testsuite/fields/SoSFColorTest.cpp | 71 ++++ testsuite/fields/SoSFDoubleTest.cpp | 71 ++++ testsuite/fields/SoSFEngineTest.cpp | 71 ++++ testsuite/fields/SoSFEnumTest.cpp | 71 ++++ testsuite/fields/SoSFFloatTest.cpp | 71 ++++ testsuite/fields/SoSFImage3Test.cpp | 71 ++++ testsuite/fields/SoSFImageTest.cpp | 71 ++++ testsuite/fields/SoSFInt32Test.cpp | 71 ++++ testsuite/fields/SoSFMatrixTest.cpp | 71 ++++ testsuite/fields/SoSFNameTest.cpp | 71 ++++ testsuite/fields/SoSFNodeTest.cpp | 94 +++++ testsuite/fields/SoSFPathTest.cpp | 71 ++++ testsuite/fields/SoSFPlaneTest.cpp | 71 ++++ testsuite/fields/SoSFRotationTest.cpp | 71 ++++ testsuite/fields/SoSFShortTest.cpp | 71 ++++ testsuite/fields/SoSFStringTest.cpp | 71 ++++ testsuite/fields/SoSFTimeTest.cpp | 71 ++++ testsuite/fields/SoSFTriggerTest.cpp | 71 ++++ testsuite/fields/SoSFUInt32Test.cpp | 71 ++++ testsuite/fields/SoSFUShortTest.cpp | 71 ++++ testsuite/fields/SoSFVec2bTest.cpp | 71 ++++ testsuite/fields/SoSFVec2dTest.cpp | 71 ++++ testsuite/fields/SoSFVec2fTest.cpp | 71 ++++ testsuite/fields/SoSFVec2i32Test.cpp | 71 ++++ testsuite/fields/SoSFVec2sTest.cpp | 71 ++++ testsuite/fields/SoSFVec3bTest.cpp | 71 ++++ testsuite/fields/SoSFVec3dTest.cpp | 71 ++++ testsuite/fields/SoSFVec3fTest.cpp | 71 ++++ testsuite/fields/SoSFVec3i32Test.cpp | 71 ++++ testsuite/fields/SoSFVec3sTest.cpp | 71 ++++ testsuite/fields/SoSFVec4bTest.cpp | 71 ++++ testsuite/fields/SoSFVec4dTest.cpp | 71 ++++ testsuite/fields/SoSFVec4fTest.cpp | 71 ++++ testsuite/fields/SoSFVec4i32Test.cpp | 71 ++++ testsuite/fields/SoSFVec4sTest.cpp | 71 ++++ testsuite/fields/SoSFVec4ubTest.cpp | 86 +++++ testsuite/fields/SoSFVec4ui32Test.cpp | 71 ++++ testsuite/fields/SoSFVec4usTest.cpp | 93 +++++ testsuite/geo/SoGeoCoordinateTest.cpp | 72 ++++ testsuite/geo/SoGeoElementTest.cpp | 68 ++++ testsuite/geo/SoGeoLocationTest.cpp | 72 ++++ testsuite/geo/SoGeoOriginTest.cpp | 72 ++++ testsuite/geo/SoGeoSeparatorTest.cpp | 71 ++++ testsuite/misc/SoBasePTest.cpp | 116 +++++++ testsuite/misc/SoBaseTest.cpp | 327 ++++++++++++++++++ testsuite/misc/SoDBTest.cpp | 270 +++++++++++++++ testsuite/misc/SoTypeTest.cpp | 83 +++++ testsuite/nodes/SoAnnotationTest.cpp | 72 ++++ testsuite/scxml/SbStringConvertTest.cpp | 169 +++++++++ testsuite/scxml/ScXMLMinimumEvaluatorTest.cpp | 99 ++++++ testsuite/shaders/SoFragmentShaderTest.cpp | 72 ++++ testsuite/shaders/SoGeometryShaderTest.cpp | 72 ++++ testsuite/shaders/SoShaderParameterTest.cpp | 222 ++++++++++++ testsuite/shaders/SoShaderProgramTest.cpp | 72 ++++ testsuite/shaders/SoVertexShaderTest.cpp | 72 ++++ .../shadows/SoGLShadowCullingElementTest.cpp | 68 ++++ testsuite/shadows/SoShadowCullingTest.cpp | 72 ++++ .../shadows/SoShadowDirectionalLightTest.cpp | 72 ++++ testsuite/shadows/SoShadowGroupTest.cpp | 72 ++++ testsuite/shadows/SoShadowSpotLightTest.cpp | 72 ++++ .../shadows/SoShadowStyleElementTest.cpp | 68 ++++ testsuite/shadows/SoShadowStyleTest.cpp | 72 ++++ testsuite/soscxml/ScXMLCoinEvaluatorTest.cpp | 135 ++++++++ testsuite/xml/documentTest.cpp | 91 +++++ 285 files changed, 11981 insertions(+), 3815 deletions(-) create mode 100644 testsuite/actions/SoCallbackActionTest.cpp create mode 100644 testsuite/actions/SoWriteActionTest.cpp create mode 100644 testsuite/base/SbBSPTreeTest.cpp create mode 100644 testsuite/base/SbBox2dTest.cpp create mode 100644 testsuite/base/SbBox2fTest.cpp create mode 100644 testsuite/base/SbBox2i32Test.cpp create mode 100644 testsuite/base/SbBox2sTest.cpp create mode 100644 testsuite/base/SbBox3dTest.cpp create mode 100644 testsuite/base/SbBox3fTest.cpp create mode 100644 testsuite/base/SbBox3i32Test.cpp create mode 100644 testsuite/base/SbBox3sTest.cpp create mode 100644 testsuite/base/SbByteBufferTest.cpp create mode 100644 testsuite/base/SbDPMatrixTest.cpp create mode 100644 testsuite/base/SbDPPlaneTest.cpp create mode 100644 testsuite/base/SbDPRotationTest.cpp create mode 100644 testsuite/base/SbImageTest.cpp create mode 100644 testsuite/base/SbMatrixTest.cpp create mode 100644 testsuite/base/SbPlaneTest.cpp create mode 100644 testsuite/base/SbRotationTest.cpp create mode 100644 testsuite/base/SbStringTest.cpp create mode 100644 testsuite/base/SbVec3dTest.cpp create mode 100644 testsuite/base/SbVec3fTest.cpp create mode 100644 testsuite/base/SbVec3sTest.cpp create mode 100644 testsuite/base/SbVec3usTest.cpp create mode 100644 testsuite/base/SbVec4fTest.cpp create mode 100644 testsuite/base/SbViewVolumeTest.cpp create mode 100644 testsuite/base/heapTest.cpp create mode 100644 testsuite/base/rbptreeTest.cpp create mode 100644 testsuite/draggers/SoTransformerDraggerTest.cpp create mode 100644 testsuite/fields/SoMFBitMaskTest.cpp create mode 100644 testsuite/fields/SoMFBoolTest.cpp create mode 100644 testsuite/fields/SoMFColorRGBATest.cpp create mode 100644 testsuite/fields/SoMFColorTest.cpp create mode 100644 testsuite/fields/SoMFDoubleTest.cpp create mode 100644 testsuite/fields/SoMFEngineTest.cpp create mode 100644 testsuite/fields/SoMFEnumTest.cpp create mode 100644 testsuite/fields/SoMFFloatTest.cpp create mode 100644 testsuite/fields/SoMFInt32Test.cpp create mode 100644 testsuite/fields/SoMFMatrixTest.cpp create mode 100644 testsuite/fields/SoMFNameTest.cpp create mode 100644 testsuite/fields/SoMFNodeTest.cpp create mode 100644 testsuite/fields/SoMFPathTest.cpp create mode 100644 testsuite/fields/SoMFPlaneTest.cpp create mode 100644 testsuite/fields/SoMFRotationTest.cpp create mode 100644 testsuite/fields/SoMFShortTest.cpp create mode 100644 testsuite/fields/SoMFStringTest.cpp create mode 100644 testsuite/fields/SoMFTimeTest.cpp create mode 100644 testsuite/fields/SoMFUInt32Test.cpp create mode 100644 testsuite/fields/SoMFUShortTest.cpp create mode 100644 testsuite/fields/SoMFVec2bTest.cpp create mode 100644 testsuite/fields/SoMFVec2dTest.cpp create mode 100644 testsuite/fields/SoMFVec2fTest.cpp create mode 100644 testsuite/fields/SoMFVec2i32Test.cpp create mode 100644 testsuite/fields/SoMFVec2sTest.cpp create mode 100644 testsuite/fields/SoMFVec3bTest.cpp create mode 100644 testsuite/fields/SoMFVec3dTest.cpp create mode 100644 testsuite/fields/SoMFVec3fTest.cpp create mode 100644 testsuite/fields/SoMFVec3i32Test.cpp create mode 100644 testsuite/fields/SoMFVec3sTest.cpp create mode 100644 testsuite/fields/SoMFVec4bTest.cpp create mode 100644 testsuite/fields/SoMFVec4dTest.cpp create mode 100644 testsuite/fields/SoMFVec4fTest.cpp create mode 100644 testsuite/fields/SoMFVec4i32Test.cpp create mode 100644 testsuite/fields/SoMFVec4sTest.cpp create mode 100644 testsuite/fields/SoMFVec4ubTest.cpp create mode 100644 testsuite/fields/SoMFVec4ui32Test.cpp create mode 100644 testsuite/fields/SoMFVec4usTest.cpp create mode 100644 testsuite/fields/SoSFBitMaskTest.cpp create mode 100644 testsuite/fields/SoSFBoolTest.cpp create mode 100644 testsuite/fields/SoSFBox2dTest.cpp create mode 100644 testsuite/fields/SoSFBox2fTest.cpp create mode 100644 testsuite/fields/SoSFBox2i32Test.cpp create mode 100644 testsuite/fields/SoSFBox2sTest.cpp create mode 100644 testsuite/fields/SoSFBox3dTest.cpp create mode 100644 testsuite/fields/SoSFBox3fTest.cpp create mode 100644 testsuite/fields/SoSFBox3i32Test.cpp create mode 100644 testsuite/fields/SoSFBox3sTest.cpp create mode 100644 testsuite/fields/SoSFColorRGBATest.cpp create mode 100644 testsuite/fields/SoSFColorTest.cpp create mode 100644 testsuite/fields/SoSFDoubleTest.cpp create mode 100644 testsuite/fields/SoSFEngineTest.cpp create mode 100644 testsuite/fields/SoSFEnumTest.cpp create mode 100644 testsuite/fields/SoSFFloatTest.cpp create mode 100644 testsuite/fields/SoSFImage3Test.cpp create mode 100644 testsuite/fields/SoSFImageTest.cpp create mode 100644 testsuite/fields/SoSFInt32Test.cpp create mode 100644 testsuite/fields/SoSFMatrixTest.cpp create mode 100644 testsuite/fields/SoSFNameTest.cpp create mode 100644 testsuite/fields/SoSFNodeTest.cpp create mode 100644 testsuite/fields/SoSFPathTest.cpp create mode 100644 testsuite/fields/SoSFPlaneTest.cpp create mode 100644 testsuite/fields/SoSFRotationTest.cpp create mode 100644 testsuite/fields/SoSFShortTest.cpp create mode 100644 testsuite/fields/SoSFStringTest.cpp create mode 100644 testsuite/fields/SoSFTimeTest.cpp create mode 100644 testsuite/fields/SoSFTriggerTest.cpp create mode 100644 testsuite/fields/SoSFUInt32Test.cpp create mode 100644 testsuite/fields/SoSFUShortTest.cpp create mode 100644 testsuite/fields/SoSFVec2bTest.cpp create mode 100644 testsuite/fields/SoSFVec2dTest.cpp create mode 100644 testsuite/fields/SoSFVec2fTest.cpp create mode 100644 testsuite/fields/SoSFVec2i32Test.cpp create mode 100644 testsuite/fields/SoSFVec2sTest.cpp create mode 100644 testsuite/fields/SoSFVec3bTest.cpp create mode 100644 testsuite/fields/SoSFVec3dTest.cpp create mode 100644 testsuite/fields/SoSFVec3fTest.cpp create mode 100644 testsuite/fields/SoSFVec3i32Test.cpp create mode 100644 testsuite/fields/SoSFVec3sTest.cpp create mode 100644 testsuite/fields/SoSFVec4bTest.cpp create mode 100644 testsuite/fields/SoSFVec4dTest.cpp create mode 100644 testsuite/fields/SoSFVec4fTest.cpp create mode 100644 testsuite/fields/SoSFVec4i32Test.cpp create mode 100644 testsuite/fields/SoSFVec4sTest.cpp create mode 100644 testsuite/fields/SoSFVec4ubTest.cpp create mode 100644 testsuite/fields/SoSFVec4ui32Test.cpp create mode 100644 testsuite/fields/SoSFVec4usTest.cpp create mode 100644 testsuite/geo/SoGeoCoordinateTest.cpp create mode 100644 testsuite/geo/SoGeoElementTest.cpp create mode 100644 testsuite/geo/SoGeoLocationTest.cpp create mode 100644 testsuite/geo/SoGeoOriginTest.cpp create mode 100644 testsuite/geo/SoGeoSeparatorTest.cpp create mode 100644 testsuite/misc/SoBasePTest.cpp create mode 100644 testsuite/misc/SoBaseTest.cpp create mode 100644 testsuite/misc/SoDBTest.cpp create mode 100644 testsuite/misc/SoTypeTest.cpp create mode 100644 testsuite/nodes/SoAnnotationTest.cpp create mode 100644 testsuite/scxml/SbStringConvertTest.cpp create mode 100644 testsuite/scxml/ScXMLMinimumEvaluatorTest.cpp create mode 100644 testsuite/shaders/SoFragmentShaderTest.cpp create mode 100644 testsuite/shaders/SoGeometryShaderTest.cpp create mode 100644 testsuite/shaders/SoShaderParameterTest.cpp create mode 100644 testsuite/shaders/SoShaderProgramTest.cpp create mode 100644 testsuite/shaders/SoVertexShaderTest.cpp create mode 100644 testsuite/shadows/SoGLShadowCullingElementTest.cpp create mode 100644 testsuite/shadows/SoShadowCullingTest.cpp create mode 100644 testsuite/shadows/SoShadowDirectionalLightTest.cpp create mode 100644 testsuite/shadows/SoShadowGroupTest.cpp create mode 100644 testsuite/shadows/SoShadowSpotLightTest.cpp create mode 100644 testsuite/shadows/SoShadowStyleElementTest.cpp create mode 100644 testsuite/shadows/SoShadowStyleTest.cpp create mode 100644 testsuite/soscxml/ScXMLCoinEvaluatorTest.cpp create mode 100644 testsuite/xml/documentTest.cpp diff --git a/src/actions/SoCallbackAction.cpp b/src/actions/SoCallbackAction.cpp index 2d23c800c09..75c9ea751bd 100644 --- a/src/actions/SoCallbackAction.cpp +++ b/src/actions/SoCallbackAction.cpp @@ -1300,41 +1300,3 @@ SbBool SoCallbackAction::isCallbackAll(void) const } #undef PRIVATE - -#ifdef COIN_TEST_SUITE - -#include -#include - -static SoCallbackAction::Response -preCB(void * userdata, SoCallbackAction *, const SoNode * node) -{ - SbString *str = (SbString *)userdata; - (*str) += node->getName(); - return SoCallbackAction::CONTINUE; -} - -BOOST_AUTO_TEST_CASE(callbackall) -{ - SbString str; - SoSwitch * sw = new SoSwitch; - sw->setName("switch"); - SoCube * cube = new SoCube; - cube->setName("cube"); - sw->addChild(cube); - sw->ref(); - - SoCallbackAction cba; - cba.addPreCallback(SoNode::getClassTypeId(), preCB, &str); - cba.apply(sw); - BOOST_CHECK_MESSAGE(str == "switch", "Should not traverse under switch node"); - - str = ""; - cba.setCallbackAll(true); - cba.apply(sw); - BOOST_CHECK_MESSAGE(str == "switchcube", "Should traverse under switch node"); - - sw->unref(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/actions/SoWriteAction.cpp b/src/actions/SoWriteAction.cpp index 6dcfe40e515..d846944bb3b 100644 --- a/src/actions/SoWriteAction.cpp +++ b/src/actions/SoWriteAction.cpp @@ -281,82 +281,3 @@ SoWriteAction::shouldCompactPathLists(void) const { return FALSE; } - -#ifdef COIN_TEST_SUITE - -// check that the realTime GlobalField is written if it has any -// forward connections. - -#include -#include -#include -#include -#include -#include -#include - -BOOST_AUTO_TEST_CASE(GlobalField) -{ - SoDB::init(); - - //Store away the state before we mess with the global realTime field - SoSFTime * realtime = static_cast(SoDB::getGlobalField("realTime")); - assert(realtime); - SbTime realTimeStorage = realtime->getValue(); - - static const char inlinescenegraph[] = - "#Inventor V2.1 ascii\n" - "\n" - "\n" - "Separator {\n" - "\n" - " Text2 { \n" - " string \"\" = GlobalField { \n" - " type \"SFTime\" realTime 0 \n" - "\n" - " } . realTime \n" - " }\n" - "}\n"; - - // read scene - SoInput in; - in.setBuffer(inlinescenegraph, strlen(inlinescenegraph)); - SoSeparator * top = SoDB::readAll(&in); - BOOST_REQUIRE(top); - top->ref(); - - // write scene - SoOutput out; - const int buffer_size = 1024; - char * buffer = (char *)malloc(buffer_size); - out.setBuffer(buffer, buffer_size, NULL); - - SoWriteAction wa(&out); - wa.apply((SoNode *)top); - - top->unref(); - top = NULL; - - // read scene again to check if realTime field was written - in.setBuffer(buffer, strlen(buffer)); - top = SoDB::readAll(&in); - BOOST_REQUIRE(top); - top->ref(); - - SoText2 * text = (SoText2 *)top->getChild(0); - BOOST_REQUIRE(text); - - SoField * string = text->getField("string"); - BOOST_REQUIRE(string); - BOOST_CHECK_MESSAGE(string->isConnected(), "String field not connected to realTime field in written scene graph"); - - free(buffer); - - top->unref(); - - //Restore state - realtime->setValue(realTimeStorage); - -} - -#endif // COIN_TEST_SUITE diff --git a/src/base/SbBSPTree.cpp b/src/base/SbBSPTree.cpp index 517571b8ed7..d209ec79a41 100644 --- a/src/base/SbBSPTree.cpp +++ b/src/base/SbBSPTree.cpp @@ -675,48 +675,3 @@ SbBSPTree::findPoints(const SbSphere &sphere, { this->topnode->findPoints(sphere, array); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SbBSPTree bsp; - SbVec3f p0(0.0f, 0.0f, 0.0f); - SbVec3f p1(1.0f, 0.0f, 0.0f); - SbVec3f p2(2.0f, 0.0f, 0.0f); - void * userdata0 = reinterpret_cast (&p0); - void * userdata1 = reinterpret_cast (&p1); - void * userdata2 = reinterpret_cast (&p2); - - BOOST_CHECK_MESSAGE(bsp.addPoint(p0, userdata0) == 0, "unexpected index"); - BOOST_CHECK_MESSAGE(bsp.addPoint(p1, userdata1) == 1, "unexpected index"); - BOOST_CHECK_MESSAGE(bsp.addPoint(p2, userdata2) == 2, "unexpected index"); - BOOST_CHECK_MESSAGE(bsp.addPoint(p2, userdata2) == 2, "unexpected index"); - BOOST_CHECK_MESSAGE(bsp.numPoints() == 3, "wrong number of points in the tree"); - - BOOST_CHECK_MESSAGE(bsp.findPoint(p0) == 0, "wrong index"); - BOOST_CHECK_MESSAGE(bsp.getUserData(0) == userdata0, "wrong userdata"); - BOOST_CHECK_MESSAGE(bsp.findPoint(p1) == 1, "wrong index"); - BOOST_CHECK_MESSAGE(bsp.getUserData(1) == userdata1, "wrong userdata"); - BOOST_CHECK_MESSAGE(bsp.findPoint(p2) == 2, "wrong index"); - BOOST_CHECK_MESSAGE(bsp.getUserData(2) == userdata2, "wrong userdata"); - - BOOST_CHECK_MESSAGE(bsp.numPoints() == 3, "wrong number of points in the tree"); - BOOST_CHECK_MESSAGE(bsp.getPointsArrayPtr()[0] == p0, "wrong point at index 0"); - BOOST_CHECK_MESSAGE(bsp.getPointsArrayPtr()[1] == p1, "wrong point at index 1"); - BOOST_CHECK_MESSAGE(bsp.getPointsArrayPtr()[2] == p2, "wrong point at index 2"); - - BOOST_CHECK_MESSAGE(bsp.removePoint(p1) == 1, "unable to remove point"); - BOOST_CHECK_MESSAGE(bsp.numPoints() == 2, "wrong number of points after removePoint()."); - BOOST_CHECK_MESSAGE(bsp.getPointsArrayPtr()[0] == p0, "wrong point at index 0"); - BOOST_CHECK_MESSAGE(bsp.getUserData(0) == userdata0, "wrong userdata"); - BOOST_CHECK_MESSAGE(bsp.getPointsArrayPtr()[1] == p2, "wrong point at index 1"); - BOOST_CHECK_MESSAGE(bsp.getUserData(1) == userdata2, "wrong userdata"); - - BOOST_CHECK_MESSAGE(bsp.removePoint(p0) >= 0, "unable to remove point"); - BOOST_CHECK_MESSAGE(bsp.removePoint(p2) >= 0, "unable to remove point"); - BOOST_CHECK_MESSAGE(bsp.numPoints() == 0, "wrong number of points after removing all points."); - -} - -#endif // COIN_TEST_SUITE diff --git a/src/base/SbBox2d.cpp b/src/base/SbBox2d.cpp index 426bae338f2..783b36026d6 100644 --- a/src/base/SbBox2d.cpp +++ b/src/base/SbBox2d.cpp @@ -560,34 +560,3 @@ SbBox2d::getClosestPoint(const SbVec2d & point) const Check \a b1 and \a b2 for inequality. */ - -#ifdef COIN_TEST_SUITE -BOOST_AUTO_TEST_CASE(checkSize) { - SbVec2d min(1,2); - SbVec2d max(3,4); - - SbVec2d diff = max - min; - - SbBox2d box(min, max); - - BOOST_CHECK_MESSAGE(box.getSize() == diff, - "Box has incorrect size"); -} -BOOST_AUTO_TEST_CASE(checkGetClosestPoint) { - SbVec2d point(1524, 13794); - SbVec2d min(1557, 3308); - SbVec2d max(3113, 30157); - - SbBox2d box(min, max); - SbVec2d expected(1557, 13794); - - BOOST_CHECK_MESSAGE(box.getClosestPoint(point) == expected, - "Closest point does not fit"); - - SbVec2d sizes = box.getSize(); - SbVec2d expectedCenterQuery(max[0], sizes[1] / 2.0); - - BOOST_CHECK_MESSAGE(box.getClosestPoint(box.getCenter()) == expectedCenterQuery, - "Closest point for center query does not fit"); -} -#endif //COIN_TEST_SUITE diff --git a/src/base/SbBox2f.cpp b/src/base/SbBox2f.cpp index 4c7056b6c64..bad4a960c21 100644 --- a/src/base/SbBox2f.cpp +++ b/src/base/SbBox2f.cpp @@ -412,34 +412,3 @@ SbBox2f::getClosestPoint(const SbVec2f & point) const Check \a b1 and \a b2 for inequality. */ - -#ifdef COIN_TEST_SUITE -BOOST_AUTO_TEST_CASE(checkSize) { - SbVec2f min(1,2); - SbVec2f max(3,4); - - SbVec2f diff = max - min; - - SbBox2f box(min, max); - - BOOST_CHECK_MESSAGE(box.getSize() == diff, - "Box has incorrect size"); -} -BOOST_AUTO_TEST_CASE(checkGetClosestPoint) { - SbVec2f point(1524, 13794); - SbVec2f min(1557, 3308); - SbVec2f max(3113, 30157); - - SbBox2f box(min, max); - SbVec2f expected(1557, 13794); - - BOOST_CHECK_MESSAGE(box.getClosestPoint(point) == expected, - "Closest point does not fit"); - - SbVec2f sizes = box.getSize(); - SbVec2f expectedCenterQuery(max[0], sizes[1] / 2.0f); - - BOOST_CHECK_MESSAGE(box.getClosestPoint(box.getCenter()) == expectedCenterQuery, - "Closest point for center query does not fit"); -} -#endif //COIN_TEST_SUITE diff --git a/src/base/SbBox2i32.cpp b/src/base/SbBox2i32.cpp index 07df545e9ee..91ab392c984 100644 --- a/src/base/SbBox2i32.cpp +++ b/src/base/SbBox2i32.cpp @@ -367,19 +367,3 @@ SbBox2i32::intersect(const SbBox2i32 & box) const Check \a b1 and \a b2 for inequality. */ - -#ifdef COIN_TEST_SUITE -BOOST_AUTO_TEST_CASE(checkSize) { - SbVec2i32 min(1,2); - SbVec2i32 max(3,4); - - SbVec2i32 diff = max - min; - - - SbBox2i32 box(min, max); - - BOOST_CHECK_MESSAGE(box.getSize() == diff, - "Box has incorrect size"); - -} -#endif //COIN_TEST_SUITE diff --git a/src/base/SbBox2s.cpp b/src/base/SbBox2s.cpp index 077a9f7aee8..a3e334d519f 100644 --- a/src/base/SbBox2s.cpp +++ b/src/base/SbBox2s.cpp @@ -383,19 +383,3 @@ SbBox2s::intersect(const SbBox2s & box) const (the maximum point) are greater than the corresponding coordinates of its lower left corner (the minimum point). */ - -#ifdef COIN_TEST_SUITE -BOOST_AUTO_TEST_CASE(checkSize) { - SbVec2s min(1,2); - SbVec2s max(3,4); - - SbVec2s diff = max - min; - - - SbBox2s box(min, max); - - BOOST_CHECK_MESSAGE(box.getSize() == diff, - "Box has incorrect size"); - -} -#endif //COIN_TEST_SUITE diff --git a/src/base/SbBox3d.cpp b/src/base/SbBox3d.cpp index d53b7d8c360..d8e1160a1f5 100644 --- a/src/base/SbBox3d.cpp +++ b/src/base/SbBox3d.cpp @@ -589,23 +589,3 @@ SbBox3d::getClosestPoint(const SbVec3d & point) const return closest; } - -#ifdef COIN_TEST_SUITE -BOOST_AUTO_TEST_CASE(checkGetClosestPoint) { - SbVec3d point(1524, 13794, 851); - SbVec3d min(1557, 3308, 850); - SbVec3d max(3113, 30157, 1886); - - SbBox3d box(min, max); - SbVec3d expected(1557, 13794, 851); - - BOOST_CHECK_MESSAGE(box.getClosestPoint(point) == expected, - "Closest point does not fit"); - - SbVec3d sizes = box.getSize(); - SbVec3d expectedCenterQuery(sizes[0] / 2.0, sizes[1] / 2.0, max[2]); - - BOOST_CHECK_MESSAGE(box.getClosestPoint(box.getCenter()) == expectedCenterQuery, - "Closest point for center query does not fit"); -} -#endif //COIN_TEST_SUITE diff --git a/src/base/SbBox3f.cpp b/src/base/SbBox3f.cpp index 1614219d899..3a3eafdbb34 100644 --- a/src/base/SbBox3f.cpp +++ b/src/base/SbBox3f.cpp @@ -589,23 +589,3 @@ SbBox3f::getClosestPoint(const SbVec3f & point) const return closest; } - -#ifdef COIN_TEST_SUITE -BOOST_AUTO_TEST_CASE(checkGetClosestPoint) { - SbVec3f point(1524 , 13794 , 851); - SbVec3f min(1557, 3308, 850); - SbVec3f max(3113, 30157, 1886); - - SbBox3f box(min, max); - SbVec3f expected(1557, 13794, 851); - - BOOST_CHECK_MESSAGE(box.getClosestPoint(point) == expected, - "Closest point does not fit"); - - SbVec3f sizes = box.getSize(); - SbVec3f expectedCenterQuery(sizes[0]/2.0f, sizes[1]/2.0f, max[2]); - - BOOST_CHECK_MESSAGE(box.getClosestPoint(box.getCenter()) == expectedCenterQuery, - "Closest point for center query does not fit"); -} -#endif //COIN_TEST_SUITE diff --git a/src/base/SbBox3i32.cpp b/src/base/SbBox3i32.cpp index 296d8f8d647..4f6cd72482a 100644 --- a/src/base/SbBox3i32.cpp +++ b/src/base/SbBox3i32.cpp @@ -587,35 +587,3 @@ SbBox3i32::getSpan(const SbVec3f & dir, float & dmin, float & dmax) const dmin = mindist; dmax = maxdist; } - - -#ifdef COIN_TEST_SUITE -BOOST_AUTO_TEST_CASE(checkSize) { - SbVec3i32 min(1,2,3); - SbVec3i32 max(3,4,5); - - SbVec3i32 diff = max - min; - - SbBox3i32 box(min, max); - - BOOST_CHECK_MESSAGE(box.getSize() == diff, - "Box has incorrect size"); -} -BOOST_AUTO_TEST_CASE(checkGetClosestPoint) { - SbVec3f point(1524 , 13794 , 851); - SbVec3i32 min(1557, 3308, 850); - SbVec3i32 max(3113, 30157, 1886); - - SbBox3i32 box(min, max); - SbVec3f expected(1557, 13794, 851); - - BOOST_CHECK_MESSAGE(box.getClosestPoint(point) == expected, - "Closest point does not fit"); - - SbVec3i32 sizes = box.getSize(); - SbVec3f expectedCenterQuery(sizes[0]/2.0f, sizes[1]/2.0f, (float)max[2]); - - BOOST_CHECK_MESSAGE(box.getClosestPoint(box.getCenter()) == expectedCenterQuery, - "Closest point for center query does not fit"); -} -#endif //COIN_TEST_SUITE diff --git a/src/base/SbBox3s.cpp b/src/base/SbBox3s.cpp index 3efe4fdd912..bc506f50d3e 100644 --- a/src/base/SbBox3s.cpp +++ b/src/base/SbBox3s.cpp @@ -438,34 +438,3 @@ SbBox3s::getClosestPoint(const SbVec3f & point) const Returns the volume of the box. */ - -#ifdef COIN_TEST_SUITE -BOOST_AUTO_TEST_CASE(checkSize) { - SbVec3s min(1,2,3); - SbVec3s max(3,4,5); - - SbVec3s diff = max - min; - - SbBox3s box(min, max); - - BOOST_CHECK_MESSAGE(box.getSize() == diff, - "Box has incorrect size"); -} -BOOST_AUTO_TEST_CASE(checkGetClosestPoint) { - SbVec3f point(1524 , 13794 , 851); - SbVec3s min(1557, 3308, 850); - SbVec3s max(3113, 30157, 1886); - - SbBox3s box(min, max); - SbVec3f expected(1557, 13794, 851); - - BOOST_CHECK_MESSAGE(box.getClosestPoint(point) == expected, - "Closest point does not fit"); - - SbVec3s sizes = box.getSize(); - SbVec3f expectedCenterQuery(sizes[0]/2.0f, sizes[1]/2.0f, max[2]); - - BOOST_CHECK_MESSAGE(box.getClosestPoint(box.getCenter()) == expectedCenterQuery, - "Closest point for center query does not fit"); -} -#endif //COIN_TEST_SUITE diff --git a/src/base/SbByteBuffer.cpp b/src/base/SbByteBuffer.cpp index 59fce3e0184..9e3fcdf13af 100644 --- a/src/base/SbByteBuffer.cpp +++ b/src/base/SbByteBuffer.cpp @@ -8,67 +8,3 @@ SbByteBuffer SbByteBuffer::invalidBuffer_; SbByteBuffer SbByteBufferP::invalidBuffer_; #endif - -#ifdef COIN_TEST_SUITE -BOOST_AUTO_TEST_CASE(pushUnique) -{ - - static const char A [] = "ABC"; - static const char B [] = "XYZ"; - static char C [sizeof(A)+sizeof(B)-1]; - strcpy(C,A); - strcat(C,B); - - SbByteBuffer a(sizeof(A)-1,A); - SbByteBuffer b(sizeof(B)-1,B); - SbByteBuffer c=a; - - c.push(b); - - bool allOk=true; - for (size_t i=0;i - -BOOST_AUTO_TEST_CASE(constructFromSbMatrix) { - SbMatrix a(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); - SbMatrixd b; - double c[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; - b.setValue(c); - SbDPMatrix d = SbMatrixd(a); - BOOST_CHECK_MESSAGE(b == d, - "Equality comparison failed!"); -} -#endif //COIN_TEST_SUITE diff --git a/src/base/SbDPPlane.cpp b/src/base/SbDPPlane.cpp index 1a517245da5..7a5eec22b0a 100644 --- a/src/base/SbDPPlane.cpp +++ b/src/base/SbDPPlane.cpp @@ -377,155 +377,3 @@ SbDPPlane::print(FILE * fp) const (void)fprintf(fp, " %f", this->getDistanceFromOrigin()); #endif // COIN_DEBUG } - -#ifdef COIN_TEST_SUITE -#include -#include -#include -#include -#include - -#include -#include -#include - -using namespace SIM::Coin::TestSuite; - -float slew(float Start, float End, int steps, int step) { - const float S = log(Start<0?-Start:Start); - const float E = log(End<0?-End:End); - - --steps; - - float res=0; - - assert(Start0 && End>0) { - res=exp(S+step*(E-S)/steps); - } - else { - float ZeroPoint = S*steps/(E+S); - if(stepquat.print(fp); #endif // COIN_DEBUG } - -#ifdef COIN_TEST_SUITE -#include - -BOOST_AUTO_TEST_CASE(tgsCompliance) { - SbDPRotation v = SbRotationd(SbVec3d(0,1,2),3); -} -#endif //COIN_TEST_SUITE diff --git a/src/base/SbImage.cpp b/src/base/SbImage.cpp index a38c9e2a286..68496d183ba 100644 --- a/src/base/SbImage.cpp +++ b/src/base/SbImage.cpp @@ -720,37 +720,3 @@ SbImage::removeReadImageCB(SbImageReadImageCB * cb, void * closure) } #undef PRIVATE - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(copyConstruct) -{ - unsigned char buf [4]; - - for (int i=0;i - -BOOST_AUTO_TEST_CASE(constructFromSbDPMatrix) { - SbMatrixd a(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); - SbMatrix b; - float c[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; - b.setValue(c); - SbMatrix d = SbMatrix(a); - BOOST_CHECK_MESSAGE(b == d, - "Equality comparison failed!"); -} -#endif //COIN_TEST_SUITE diff --git a/src/base/SbPlane.cpp b/src/base/SbPlane.cpp index 8cb8e63825f..5b32242cfaa 100644 --- a/src/base/SbPlane.cpp +++ b/src/base/SbPlane.cpp @@ -382,25 +382,3 @@ SbPlane::print(FILE * fp) const (void)fprintf(fp, " %f", this->getDistanceFromOrigin()); #endif // COIN_DEBUG } - -#ifdef COIN_TEST_SUITE -#include -#include - -using namespace SIM::Coin::TestSuite; - -BOOST_AUTO_TEST_CASE(signCorrect) -{ - SbPlane plane1(SbVec3f(0.0, 0.0, 1.0), 3.0); - SbPlane plane2(SbVec3f(1.0, 0.0, 0.0), 21.0); - SbLine line; - plane1.intersect(plane2, line); - - SbVec3f intersect = line.getPosition(); - SbVec3f vec(21, 0, 3); - - check_compare(intersect,vec, "SbPlane SignCorrect", .1f); - -} - -#endif //COIN_TEST_SUITE diff --git a/src/base/SbRotation.cpp b/src/base/SbRotation.cpp index ad2046171dd..05f5b3cc7e6 100644 --- a/src/base/SbRotation.cpp +++ b/src/base/SbRotation.cpp @@ -736,62 +736,3 @@ SbRotation::print(FILE * fp) const this->quat.print(fp); #endif // COIN_DEBUG } - -#ifdef COIN_TEST_SUITE -#include -#include -#include -#include -#include - -typedef SbRotation ToTest; -BOOST_AUTO_TEST_CASE(operatorBrackets) -{ - const int FLOAT_SENSITIVITY = 1; - const float SQRT2 = sqrt(2.f)/2.f; - SbRotation rot(0,-SQRT2,0,SQRT2); - - for (int i=0;i<4;++i) { - int premultiply = ((i&0x1)*((i&0x2)-1)); - float testVal = premultiply*SQRT2; - BOOST_CHECK_MESSAGE( - floatEquals(testVal,rot[i],FLOAT_SENSITIVITY), - std::string("Wrong value when trying to access value #") - + ::CoinTest::stringify(i) - + ": " - + ::CoinTest::stringify(rot[i]) + - " == " - + ::CoinTest::stringify(testVal) - ); - } -} - -BOOST_AUTO_TEST_CASE(toString) { - ToTest val(SbVec3f(0, -1, 0), 1); - SbString str("0 -1 0 1"); - SbVec4f expected(0.f, -1.f, 0.f, 1.f), actual; - sscanf(val.toString().getString(), "%f %f %f %f", &actual[0], &actual[1], &actual[2], &actual[3]); - BOOST_CHECK_MESSAGE(actual.equals(expected, 0.000001f), - std::string("Mismatch between ") + val.toString().getString() + " and control string " + str.getString()); - -} - -BOOST_AUTO_TEST_CASE(fromString) { - ToTest foo; - SbString test = "0 -1 0 1"; - ToTest trueVal(SbVec3f(0, -1, 0), 1); - SbBool conversionOk = foo.fromString(test); - BOOST_CHECK_MESSAGE(conversionOk && trueVal == foo, - std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); -} - -BOOST_AUTO_TEST_CASE(fromInvalidString) { - ToTest foo; - SbString test = "2.- 2 3 4"; - ToTest trueVal(1,2,3,4); - SbBool conversionOk = foo.fromString(test); - BOOST_CHECK_MESSAGE(conversionOk == FALSE, - std::string("Able to convert from ") + test.getString() + " which is not a valid " + SbTypeInfo::getTypeName() + " representation"); -} - -#endif //COIN_TEST_SUITE diff --git a/src/base/SbString.cpp b/src/base/SbString.cpp index 25ac65f0b04..aebd413090c 100644 --- a/src/base/SbString.cpp +++ b/src/base/SbString.cpp @@ -545,32 +545,3 @@ SbString::print(std::FILE * fp) const Note that this function is not part of the original Open Inventor API. */ - -#ifdef COIN_TEST_SUITE -#include - -static void * createInstance(void) -{ - return (void *)0x1234; -} - -BOOST_AUTO_TEST_CASE(testAddition) -{ - SbString str1("First"); - SbString str2("Second"); - const char *cstr1 = "Erste"; - const char *cstr2 = "Zweite"; - - SbString a = str1 + str2; - SbString b = cstr1 + str2; - SbString c = str1 + cstr2; - - BOOST_CHECK_MESSAGE(a == SbString("FirstSecond"), - "operator+ error"); - BOOST_CHECK_MESSAGE(b == SbString("ErsteSecond"), - "operator+ error"); - BOOST_CHECK_MESSAGE(c == SbString("FirstZweite"), - "operator+ error"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/base/SbVec3d.cpp b/src/base/SbVec3d.cpp index d058f315352..12f9dc2281c 100644 --- a/src/base/SbVec3d.cpp +++ b/src/base/SbVec3d.cpp @@ -559,24 +559,3 @@ SbVec3d::print(FILE * fp) const fputs(this->toString().getString(),fp); #endif // COIN_DEBUG } - -#ifdef COIN_TEST_SUITE -typedef SbVec3d ToTest; -BOOST_AUTO_TEST_CASE(toString) { - ToTest val(1.0/3,2,3); - SbString str("0.3333333333333333 2 3"); - BOOST_CHECK_MESSAGE(str == val.toString(), - std::string("Mismatch between ") + val.toString().getString() + " and control string " + str.getString()); - -} - -BOOST_AUTO_TEST_CASE(fromString) { - ToTest foo; - SbString test = "0.3333333333333333 -2 -3.0"; - ToTest trueVal(0.3333333333333333,-2,-3); - SbBool conversionOk = foo.fromString(test); - BOOST_CHECK_MESSAGE(conversionOk && trueVal == foo, - std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); -} - -#endif //COIN_TEST_SUITE diff --git a/src/base/SbVec3f.cpp b/src/base/SbVec3f.cpp index c16c290824e..7c1536766fe 100644 --- a/src/base/SbVec3f.cpp +++ b/src/base/SbVec3f.cpp @@ -622,42 +622,3 @@ SbVec3f::print(FILE * fp) const fputs(this->toString().getString(),fp); #endif // COIN_DEBUG } - -#ifdef COIN_TEST_SUITE -#include - -typedef SbVec3f ToTest; -BOOST_AUTO_TEST_CASE(toString) { - ToTest val(1.0f/3,2,3); - SbString str("0.33333334 2 3"); - BOOST_CHECK_MESSAGE(str == val.toString(), - std::string("Mismatch between ") + val.toString().getString() + " and control string " + str.getString()); - -} - -BOOST_AUTO_TEST_CASE(fromString) { - ToTest foo; - SbString test = "0.333333343 -2 -3.0"; - ToTest trueVal(0.333333343f,-2,-3); - SbBool conversionOk = foo.fromString(test); - BOOST_CHECK_MESSAGE(conversionOk && trueVal == foo, - std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); -} - -BOOST_AUTO_TEST_CASE(fromInvalidString1) { - ToTest foo; - SbString test = "a 2 3"; - SbBool conversionOk = foo.fromString(test); - BOOST_CHECK_MESSAGE(conversionOk == FALSE, - std::string("Able to convert from ") + test.getString() + " which is not a valid " + SbTypeInfo::getTypeName() + " representation"); -} - -BOOST_AUTO_TEST_CASE(fromInvalidString2) { - ToTest foo; - SbString test = "1,2,3"; - SbBool conversionOk = foo.fromString(test); - BOOST_CHECK_MESSAGE(conversionOk == FALSE, - std::string("Able to convert from ") + test.getString() + " which is not a valid " + SbTypeInfo::getTypeName() + " representation"); -} - -#endif //COIN_TEST_SUITE diff --git a/src/base/SbVec3s.cpp b/src/base/SbVec3s.cpp index 2912dc43ce5..b01a2b8e0ed 100644 --- a/src/base/SbVec3s.cpp +++ b/src/base/SbVec3s.cpp @@ -433,33 +433,3 @@ SbVec3s::print(FILE * fp) const fputs(str.getString(),fp); #endif // COIN_DEBUG } - -#ifdef COIN_TEST_SUITE -#include - -typedef SbVec3s ToTest; -BOOST_AUTO_TEST_CASE(toString) { - ToTest val(1,2,3); - SbString str("1 2 3"); - BOOST_CHECK_MESSAGE(str == val.toString(), - std::string("Mismatch between ") + val.toString().getString() + " and control string " + str.getString()); -} - -BOOST_AUTO_TEST_CASE(fromString) { - ToTest foo; - SbString test = "1 -2 3"; - ToTest trueVal(1,-2,3); - foo.fromString(test); - BOOST_CHECK_MESSAGE(trueVal == foo, - std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); -} - -BOOST_AUTO_TEST_CASE(fromInvalidString) { - ToTest foo; - SbString test = "a,2,3"; - SbBool conversionOk = foo.fromString(test); - BOOST_CHECK_MESSAGE(conversionOk == FALSE, - std::string("Able to convert from ") + test.getString() + " which is not a valid " + SbTypeInfo::getTypeName() + " representation"); -} - -#endif //COIN_TEST_SUITE diff --git a/src/base/SbVec3us.cpp b/src/base/SbVec3us.cpp index 66070c193c3..973765a3889 100644 --- a/src/base/SbVec3us.cpp +++ b/src/base/SbVec3us.cpp @@ -87,7 +87,3 @@ SbVec3us::operator *= (double d) vec[2] = static_cast(vec[2] * d); return *this; } - -#ifdef COIN_TEST_SUITE - -#endif //COIN_TEST_SUITE diff --git a/src/base/SbVec4f.cpp b/src/base/SbVec4f.cpp index 5e70df4ef9d..d8570b3ddbd 100644 --- a/src/base/SbVec4f.cpp +++ b/src/base/SbVec4f.cpp @@ -420,52 +420,3 @@ SbVec4f::print(FILE * fp) const this->vec[3] ); #endif // COIN_DEBUG } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(noNormalizingNormalized) -{ - const float SQRT2 = sqrt(2.f)/2.f; - SbVec4f vec(0,-SQRT2,0,SQRT2); - - vec.normalize(); - for (int i=0;i<4;++i) { - int premultiply = ((i&0x1)*((i&0x2)-1)); - float testVal = premultiply*SQRT2; - BOOST_CHECK_MESSAGE( - testVal==vec[i], - std::string("Wrong value when trying to access value #") - + ::CoinTest::stringify(i) - + ": " - + ::CoinTest::stringify(vec[i]) + - " == " - + ::CoinTest::stringify(testVal) - ); - } - -} - -BOOST_AUTO_TEST_CASE(normalizingDeNormalized) -{ - const int FLOAT_SENSITIVITY = 1; - const float SQRT2 = sqrt(2.f)/2.f; - SbVec4f vec(0,-1,0,1); - - vec.normalize(); - for (int i=0;i<4;++i) { - int premultiply = ((i&0x1)*((i&0x2)-1)); - float testVal = premultiply*SQRT2; - BOOST_CHECK_MESSAGE( - floatEquals(testVal,vec[i],FLOAT_SENSITIVITY), - std::string("Wrong value when trying to access value #") - + ::CoinTest::stringify(i) - + ": " - + ::CoinTest::stringify(vec[i]) + - " == " - + ::CoinTest::stringify(testVal) - ); - } - -} - -#endif //COIN_TEST_SUITE diff --git a/src/base/SbViewVolume.cpp b/src/base/SbViewVolume.cpp index 95034566871..12063d7d15d 100644 --- a/src/base/SbViewVolume.cpp +++ b/src/base/SbViewVolume.cpp @@ -987,73 +987,3 @@ SbViewVolume::getPlaneRectangle(const float distance, SbVec3f & lowerleft, upperright = near_ur + this->projDir * distance; } } - -#ifdef COIN_TEST_SUITE - -#include -#include - -BOOST_AUTO_TEST_CASE(intersect_ortho) -{ - SbViewVolume vv; - vv.ortho(-0.5, 0.5, -0.5, 0.5, -1, 10); - SbBox3f box(0, 0, 0, 1, 1, 1); - - SbBox3f isect = vv.intersectionBox(box); - COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[0], 0.0f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[1], 0.0f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[2], 0.0f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[0], 0.5f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[1], 0.5f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[2], 1.0f); -} - -BOOST_AUTO_TEST_CASE(intersect_bbox_inside_vv) -{ - SbViewVolume vv; - vv.ortho(-0.5, 0.5, -0.5, 0.5, -1, 10); - SbBox3f box(-0.25, -0.25, -0.25, 0.25, 0.25, 0.25); - - SbBox3f isect = vv.intersectionBox(box); - COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[0], -0.25); - COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[1], -0.25f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[2], -0.25f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[0], 0.25f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[1], 0.25f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[2], 0.25f); -} - -BOOST_AUTO_TEST_CASE(intersect_vv_inside_bbox) -{ - SbViewVolume vv; - vv.ortho(-0.5, 0.5, -0.5, 0.5, 0, 5); - SbBox3f box(-10, -10, -10, 10, 10, 10); - - SbBox3f isect = vv.intersectionBox(box); - COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[0], -0.5f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[1], -0.5f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[2], -5.0f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[0], 0.5f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[1], 0.5f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[2], 0.0f); -} - -BOOST_AUTO_TEST_CASE(intersect_perspective) -{ - // FIXME: set up a better perspective vv which also tests left/right/top/bottom - SbViewVolume vv; - vv.perspective(0.78f, 1.0f, 4.25, 4.75); - vv.translateCamera(SbVec3f(0.0f, 0.0f, 5.0f)); - - SbBox3f box(0, 0, 0, 1, 1, 1); - SbBox3f isect = vv.intersectionBox(box); - - COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[0], 0.0); - COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[1], 0.0f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[2], 0.25f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[0], 1.0f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[1], 1.0f); - COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[2], 0.75f); -} - -#endif // COIN_TEST_SUITE diff --git a/src/base/heap.cpp b/src/base/heap.cpp index ff2d47d6297..f0a2d999cb9 100644 --- a/src/base/heap.cpp +++ b/src/base/heap.cpp @@ -372,112 +372,3 @@ cc_heap_print(cc_heap * h, cc_heap_print_cb * printcb, SbString& str, SbBool pri #undef HEAP_LEFT #undef HEAP_PARENT #undef HEAP_RIGHT - -#ifdef COIN_TEST_SUITE -#include -class mock_up { -public: - typedef struct wrapped_value { - double x; - } wrapped_value; - - static void heap_print_cb(void * v, SbString& str) { - wrapped_value* value = reinterpret_cast(v); - std::ostringstream oss; - oss << value->x; - str += oss.str().c_str(); - } - - static double heap_evaluate_cb(void * v) - { - wrapped_value* value = reinterpret_cast(v); - return value->x; - } - - // strict weak ordering is needed for compare callbacks - static int min_heap_compare_cb(void * lhs, void * rhs) - { - return heap_evaluate_cb(lhs) < heap_evaluate_cb(rhs) ? 1 : 0; - } - - static int max_heap_compare_cb(void * lhs, void * rhs) - { - return heap_evaluate_cb(lhs) > heap_evaluate_cb(rhs) ? 1 : 0; - } -}; - -BOOST_AUTO_TEST_CASE(min_heap) { - mock_up::wrapped_value val[] = {3, 2, 1, 15, 5, 4, 45}; - cc_heap* heap = cc_heap_construct(256, reinterpret_cast(mock_up::min_heap_compare_cb), TRUE); - for (int i = 0, n = sizeof(val) / sizeof(val[0]); i < n; ++i) - cc_heap_add(heap, &val[i]); - SbString result; - cc_heap_print(heap, reinterpret_cast(mock_up::heap_print_cb), result, FALSE); - cc_heap_destruct(heap); - heap = NULL; - SbString str("1 3 2 15 5 4 45 "); - BOOST_CHECK_MESSAGE(str == result, - std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); -} - -BOOST_AUTO_TEST_CASE(max_heap) { - mock_up::wrapped_value val[] = {3, 2, 1, 15, 5, 4, 45}; - cc_heap* heap = cc_heap_construct(256, reinterpret_cast(mock_up::max_heap_compare_cb), TRUE); - for (int i = 0, n = sizeof(val) / sizeof(val[0]); i < n; ++i) - cc_heap_add(heap, &val[i]); - SbString result; - cc_heap_print(heap, reinterpret_cast(mock_up::heap_print_cb), result, FALSE); - cc_heap_destruct(heap); - heap = NULL; - SbString str("45 5 15 2 3 1 4 "); - BOOST_CHECK_MESSAGE(str == result, - std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); -} - -BOOST_AUTO_TEST_CASE(heap_add) { - mock_up::wrapped_value val[] = {3, 2, 1, 15, 5, 4, 45}; - cc_heap* heap = cc_heap_construct(256, reinterpret_cast(mock_up::min_heap_compare_cb), TRUE); - for (int i = 0, n = sizeof(val) / sizeof(val[0]); i < n; ++i) - cc_heap_add(heap, &val[i]); - double added_value = 12; - cc_heap_add(heap, &added_value); - SbString result; - cc_heap_print(heap, reinterpret_cast(mock_up::heap_print_cb), result, FALSE); - cc_heap_destruct(heap); - heap = NULL; - SbString str("1 3 2 12 5 4 45 15 "); - BOOST_CHECK_MESSAGE(str == result, - std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); -} - -BOOST_AUTO_TEST_CASE(heap_remove) { - mock_up::wrapped_value val[] = {3, 2, 1, 15, 5, 4, 45}; - cc_heap* heap = cc_heap_construct(256, reinterpret_cast(mock_up::min_heap_compare_cb), TRUE); - for (int i = 0, n = sizeof(val) / sizeof(val[0]); i < n; ++i) - cc_heap_add(heap, &val[i]); - cc_heap_remove(heap, &val[3]); - SbString result; - cc_heap_print(heap, reinterpret_cast(mock_up::heap_print_cb), result, FALSE); - cc_heap_destruct(heap); - heap = NULL; - SbString str("1 3 2 45 5 4 "); - BOOST_CHECK_MESSAGE(str == result, - std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); -} - -BOOST_AUTO_TEST_CASE(heap_update) { - mock_up::wrapped_value val[] = {3, 2, 1, 15, 5, 4, 45}; - cc_heap* heap = cc_heap_construct(256, reinterpret_cast(mock_up::min_heap_compare_cb), TRUE); - for (int i = 0, n = sizeof(val) / sizeof(val[0]); i < n; ++i) - cc_heap_add(heap, &val[i]); - val[3].x = 1; - cc_heap_update(heap, &val[3]); - SbString result; - cc_heap_print(heap, reinterpret_cast(mock_up::heap_print_cb), result, FALSE); - cc_heap_destruct(heap); - heap = NULL; - SbString str("1 1 2 3 5 4 45 "); - BOOST_CHECK_MESSAGE(str == result, - std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); -} -#endif //COIN_TEST_SUITE diff --git a/src/base/rbptree.cpp b/src/base/rbptree.cpp index 104127ee64b..6e7da7d0233 100644 --- a/src/base/rbptree.cpp +++ b/src/base/rbptree.cpp @@ -651,59 +651,3 @@ cc_rbptree_debug(const cc_rbptree * t) if (x != &rbptree_sentinel) rbptree_debug(x, 0); } - -#ifdef COIN_TEST_SUITE - -#include -#include - -#define FILL_TIMES (50) -#define FILL_COUNT (10000) - -BOOST_AUTO_TEST_CASE(rbptree_stress) -{ - srand(123); - cc_rbptree tree; - cc_rbptree_init(&tree); - - int i; - for (int c = 0; c < FILL_TIMES; ++c) { - SbList values; - for (i = 0; i < FILL_COUNT; ++i) { - void * entry = reinterpret_cast(static_cast(rand())); - cc_rbptree_insert(&tree, entry, NULL); - values.append(entry); - } - BOOST_ASSERT(cc_rbptree_size(&tree) == FILL_COUNT); - - if ((c & 1) == 0) { - for (i = (FILL_COUNT - 1); i >= 0; --i) cc_rbptree_remove(&tree, values[i]); - } else { - for (i = 0; i < FILL_COUNT; ++i) cc_rbptree_remove(&tree, values[i]); - } - BOOST_ASSERT(cc_rbptree_size(&tree) == 0); - } - - for (int c = 0; c < FILL_TIMES; ++c) { - SbList values; - for (i = 0; i < FILL_COUNT; ++i) { - void * entry = reinterpret_cast(static_cast(((c & 2) == 0) ? i : (FILL_COUNT - i))); - cc_rbptree_insert(&tree, entry, NULL); - values.append(entry); - } - BOOST_ASSERT(cc_rbptree_size(&tree) == FILL_COUNT); - - if ((c & 1) == 0) { - for (i = (FILL_COUNT - 1); i >= 0; --i) cc_rbptree_remove(&tree, values[i]); - } else { - for (i = 0; i < FILL_COUNT; ++i) cc_rbptree_remove(&tree, values[i]); - } - BOOST_ASSERT(cc_rbptree_size(&tree) == 0); - - } - - - cc_rbptree_clean(&tree); -} - -#endif // COIN_TEST_SUITE diff --git a/src/draggers/SoTransformerDragger.cpp b/src/draggers/SoTransformerDragger.cpp index 527511b1343..315c74a327a 100644 --- a/src/draggers/SoTransformerDragger.cpp +++ b/src/draggers/SoTransformerDragger.cpp @@ -2214,80 +2214,5 @@ SoTransformerDragger::setDynamicRotatorSwitches(const SoEvent *event) #undef PRIVATE #undef THISP -#ifdef COIN_TEST_SUITE - -#include -#include -#include - -static -SoCallbackAction::Response -register_cb(void * data, SoCallbackAction * action, const SoNode * node) -{ - assert(data); - SbDict * dict = static_cast(data); - dict->enter(reinterpret_cast(node), NULL); - return SoCallbackAction::CONTINUE; -} - -static -void -ensure_unique_cb(uintptr_t entry, void * value, void * data) -{ - SbDict * copydict = static_cast(data); - void * val = NULL; - BOOST_ASSERT(!copydict->find(entry, val)); -} - -BOOST_AUTO_TEST_CASE(dragger_deep_copy) -{ - SbDict origdict, copydict; - - SoSeparator * root = new SoSeparator; - root->setName("dragger_deep_copy_root"); - root->ref(); - root->addChild(new SoTransformerDragger); - - SoSeparator * copy = static_cast(root->copy()); - assert(copy); - copy->setName("dragger_deep_copy_copy"); - copy->ref(); - - { - SoCallbackAction cba; - cba.setCallbackAll(TRUE); - - cba.addPreCallback(SoNode::getClassTypeId(), register_cb, &origdict); - cba.apply(root); - } - - { - SoCallbackAction cba; - cba.setCallbackAll(TRUE); - - cba.addPreCallback(SoNode::getClassTypeId(), register_cb, ©dict); - cba.apply(copy); - } - - SbPList keys, values; - - origdict.makePList(keys, values); - const int origdictsize = keys.getLength(); - - keys.truncate(0); - values.truncate(0); - copydict.makePList(keys, values); - const int copydictsize = keys.getLength(); - - BOOST_ASSERT(origdictsize == copydictsize); - - // make sure pointer sets have an empty union - origdict.applyToAll(ensure_unique_cb, ©dict); - - root->unref(); - copy->unref(); -} - -#endif // COIN_TEST_SUITE #endif // HAVE_DRAGGERS diff --git a/src/fields/SoMFBitMask.cpp b/src/fields/SoMFBitMask.cpp index d6db4c61834..4f3191b09e8 100644 --- a/src/fields/SoMFBitMask.cpp +++ b/src/fields/SoMFBitMask.cpp @@ -93,15 +93,3 @@ SoMFBitMask::write1Value(SoOutput * out, int idx) const } #endif // DOXYGEN_SKIP_THIS - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFBitMask field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFBool.cpp b/src/fields/SoMFBool.cpp index 3599b21c458..e3bf4c08843 100644 --- a/src/fields/SoMFBool.cpp +++ b/src/fields/SoMFBool.cpp @@ -107,28 +107,3 @@ SoMFBool::getNumValuesPerLine(void) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFBool field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -BOOST_AUTO_TEST_CASE(array_ops) -{ - SoMFBool field; - field.set1Value(0, TRUE); - field.set1Value(1, FALSE); - field.set1Value(2, TRUE); - BOOST_CHECK_EQUAL(field.getNum(), 3); - field.deleteValues(1,1); - BOOST_CHECK_EQUAL(field.getNum(), 2); - BOOST_CHECK_EQUAL(field[0], TRUE); - BOOST_CHECK_EQUAL(field[1], TRUE); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFColor.cpp b/src/fields/SoMFColor.cpp index 2794ce322be..357ec94db9f 100644 --- a/src/fields/SoMFColor.cpp +++ b/src/fields/SoMFColor.cpp @@ -233,15 +233,3 @@ SoMFColor::set1HSVValue(int idx, const float hsv[3]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFColor field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFColorRGBA.cpp b/src/fields/SoMFColorRGBA.cpp index 1e62e9d7e39..87aa1bc8eb7 100644 --- a/src/fields/SoMFColorRGBA.cpp +++ b/src/fields/SoMFColorRGBA.cpp @@ -233,15 +233,3 @@ SoMFColorRGBA::set1HSVValue(int idx, const float hsva[4]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFColorRGBA field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFDouble.cpp b/src/fields/SoMFDouble.cpp index 51bf0d9d82d..ec3d3840dd7 100644 --- a/src/fields/SoMFDouble.cpp +++ b/src/fields/SoMFDouble.cpp @@ -106,15 +106,3 @@ SoMFDouble::getNumValuesPerLine(void) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFDouble field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFEngine.cpp b/src/fields/SoMFEngine.cpp index 9188e7a064d..be945f37852 100644 --- a/src/fields/SoMFEngine.cpp +++ b/src/fields/SoMFEngine.cpp @@ -467,16 +467,3 @@ SoMFEngine::referencesCopy(void) const // Kill the type-specific define. #undef COIN_INTERNAL_SOMFENGINE //$ END TEMPLATE MFNodeEnginePath - - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFEngine field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFEnum.cpp b/src/fields/SoMFEnum.cpp index b1f19aca244..7c58de71eac 100644 --- a/src/fields/SoMFEnum.cpp +++ b/src/fields/SoMFEnum.cpp @@ -334,16 +334,3 @@ SoMFEnum::getEnum(const int idx, SbName & name) const name = this->enumNames[idx]; return this->enumValues[idx]; } - - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFEnum field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFFloat.cpp b/src/fields/SoMFFloat.cpp index 93320c909c0..d94df691fc4 100644 --- a/src/fields/SoMFFloat.cpp +++ b/src/fields/SoMFFloat.cpp @@ -105,15 +105,3 @@ SoMFFloat::getNumValuesPerLine(void) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFFloat field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFInt32.cpp b/src/fields/SoMFInt32.cpp index abc243a4737..e41518a73d7 100644 --- a/src/fields/SoMFInt32.cpp +++ b/src/fields/SoMFInt32.cpp @@ -106,15 +106,3 @@ SoMFInt32::getNumValuesPerLine(void) const { return 8; } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFInt32 field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFMatrix.cpp b/src/fields/SoMFMatrix.cpp index 879327dbaf0..1658b6cdcc0 100644 --- a/src/fields/SoMFMatrix.cpp +++ b/src/fields/SoMFMatrix.cpp @@ -119,15 +119,3 @@ SoMFMatrix::setValue(const float a11, const float a12, } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFMatrix field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFName.cpp b/src/fields/SoMFName.cpp index 014520be1b0..a1d4d57e40f 100644 --- a/src/fields/SoMFName.cpp +++ b/src/fields/SoMFName.cpp @@ -128,15 +128,3 @@ SoMFName::setValue(const char * str) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFName field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFNode.cpp b/src/fields/SoMFNode.cpp index dd9b3722d25..950e6ac4dfd 100644 --- a/src/fields/SoMFNode.cpp +++ b/src/fields/SoMFNode.cpp @@ -630,41 +630,3 @@ SoMFNode::replaceNode(SoNode * oldnode, SoNode * newnode) int idx = this->findNode(oldnode); if (idx >= 0) this->replaceNode(idx, newnode); } - -#ifdef COIN_TEST_SUITE - -#include - -// Do-nothing error handler for ignoring read errors while testing. -static void -readErrorHandler(const SoError * error, void * data) -{ -} - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFNode field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -BOOST_AUTO_TEST_CASE(NULLreading) -{ - // FIXME: We are forced to restore the global state before terminating, - // or independent tests could fail. (sveinung 20071108) - SoErrorCB * prevErrorCB = SoReadError::getHandlerCallback(); - SoReadError::setHandlerCallback(readErrorHandler, NULL); - - const char file[] = - "[ DEF mycube Cube {} USE mycube ]"; - SoInput in; - in.setBuffer(reinterpret_cast(file), sizeof(file)); - SoMFNode field; - BOOST_CHECK_MESSAGE(field.read(&in, SbName("test")), - "DEF/USE reading in SoMFNode is broken"); - - SoReadError::setHandlerCallback(prevErrorCB, NULL); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFPath.cpp b/src/fields/SoMFPath.cpp index d40297d55b2..3749741c9b0 100644 --- a/src/fields/SoMFPath.cpp +++ b/src/fields/SoMFPath.cpp @@ -495,15 +495,3 @@ SoMFPath::notify(SoNotList * l) inherited::notify(l); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFPath field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFPlane.cpp b/src/fields/SoMFPlane.cpp index 4a1e6885a5f..c0fd2ad3934 100644 --- a/src/fields/SoMFPlane.cpp +++ b/src/fields/SoMFPlane.cpp @@ -101,15 +101,3 @@ SoMFPlane::getNumValuesPerLine(void) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFPlane field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFRotation.cpp b/src/fields/SoMFRotation.cpp index 24fa0369d15..03fe0219403 100644 --- a/src/fields/SoMFRotation.cpp +++ b/src/fields/SoMFRotation.cpp @@ -163,15 +163,3 @@ SoMFRotation::setValue(const SbVec3f & axis, const float angle) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFRotation field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFShort.cpp b/src/fields/SoMFShort.cpp index d74269a9f10..9c72ca154f8 100644 --- a/src/fields/SoMFShort.cpp +++ b/src/fields/SoMFShort.cpp @@ -106,15 +106,3 @@ SoMFShort::getNumValuesPerLine(void) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFShort field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFString.cpp b/src/fields/SoMFString.cpp index 0703a047b99..c646e42f9c0 100644 --- a/src/fields/SoMFString.cpp +++ b/src/fields/SoMFString.cpp @@ -148,15 +148,3 @@ SoMFString::deleteText(const int fromline, const int fromchar, } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFString field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFTime.cpp b/src/fields/SoMFTime.cpp index cfb71aaf7d1..86cb65b5565 100644 --- a/src/fields/SoMFTime.cpp +++ b/src/fields/SoMFTime.cpp @@ -94,15 +94,3 @@ SoMFTime::write1Value(SoOutput * out, int idx) const #endif // DOXYGEN_SKIP_THIS // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFTime field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFUInt32.cpp b/src/fields/SoMFUInt32.cpp index 4bdd046f11b..d7047668b68 100644 --- a/src/fields/SoMFUInt32.cpp +++ b/src/fields/SoMFUInt32.cpp @@ -111,15 +111,3 @@ SoMFUInt32::getNumValuesPerLine(void) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFUInt32 field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFUShort.cpp b/src/fields/SoMFUShort.cpp index fcc1697547f..a7b06f4d8d3 100644 --- a/src/fields/SoMFUShort.cpp +++ b/src/fields/SoMFUShort.cpp @@ -108,15 +108,3 @@ SoMFUShort::getNumValuesPerLine(void) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFUShort field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec2b.cpp b/src/fields/SoMFVec2b.cpp index 66f27a744ee..a94a301f92d 100644 --- a/src/fields/SoMFVec2b.cpp +++ b/src/fields/SoMFVec2b.cpp @@ -158,15 +158,3 @@ SoMFVec2b::setValue(const int8_t xy[2]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec2b field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec2d.cpp b/src/fields/SoMFVec2d.cpp index 2c2b5f02a54..a0c74271a2b 100644 --- a/src/fields/SoMFVec2d.cpp +++ b/src/fields/SoMFVec2d.cpp @@ -158,15 +158,3 @@ SoMFVec2d::setValue(const double xy[2]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec2d field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec2f.cpp b/src/fields/SoMFVec2f.cpp index 9f0b123cf46..d8df39d1bd4 100644 --- a/src/fields/SoMFVec2f.cpp +++ b/src/fields/SoMFVec2f.cpp @@ -156,15 +156,3 @@ SoMFVec2f::setValue(const float xy[2]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec2f field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec2i32.cpp b/src/fields/SoMFVec2i32.cpp index 81dae0fce92..30f3bee1f9a 100644 --- a/src/fields/SoMFVec2i32.cpp +++ b/src/fields/SoMFVec2i32.cpp @@ -158,15 +158,3 @@ SoMFVec2i32::setValue(const int32_t xy[2]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec2i32 field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec2s.cpp b/src/fields/SoMFVec2s.cpp index dcbce7d5d5f..ec0083995a9 100644 --- a/src/fields/SoMFVec2s.cpp +++ b/src/fields/SoMFVec2s.cpp @@ -158,15 +158,3 @@ SoMFVec2s::setValue(const short xy[2]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec2s field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec3b.cpp b/src/fields/SoMFVec3b.cpp index 3978f55483f..6d02f1fca18 100644 --- a/src/fields/SoMFVec3b.cpp +++ b/src/fields/SoMFVec3b.cpp @@ -169,15 +169,3 @@ SoMFVec3b::setValue(const int8_t xyz[3]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec3b field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec3d.cpp b/src/fields/SoMFVec3d.cpp index d670b76b7b7..186e1e6eebe 100644 --- a/src/fields/SoMFVec3d.cpp +++ b/src/fields/SoMFVec3d.cpp @@ -154,15 +154,3 @@ SoMFVec3d::setValue(const double xyz[3]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec3d field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec3f.cpp b/src/fields/SoMFVec3f.cpp index d0571ca4fa6..4c1b8b18961 100644 --- a/src/fields/SoMFVec3f.cpp +++ b/src/fields/SoMFVec3f.cpp @@ -167,15 +167,3 @@ SoMFVec3f::setValue(const float xyz[3]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec3f field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec3i32.cpp b/src/fields/SoMFVec3i32.cpp index f77ef2e1c7a..479f2acb517 100644 --- a/src/fields/SoMFVec3i32.cpp +++ b/src/fields/SoMFVec3i32.cpp @@ -169,15 +169,3 @@ SoMFVec3i32::setValue(const int32_t xyz[3]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec3i32 field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec3s.cpp b/src/fields/SoMFVec3s.cpp index 38c515c7870..39cee96934a 100644 --- a/src/fields/SoMFVec3s.cpp +++ b/src/fields/SoMFVec3s.cpp @@ -169,15 +169,3 @@ SoMFVec3s::setValue(const short xyz[3]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec3s field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec4b.cpp b/src/fields/SoMFVec4b.cpp index bb4fe5b24a2..03f103b6fd8 100644 --- a/src/fields/SoMFVec4b.cpp +++ b/src/fields/SoMFVec4b.cpp @@ -160,15 +160,3 @@ SoMFVec4b::setValue(const int8_t xyzw[4]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec4b field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec4d.cpp b/src/fields/SoMFVec4d.cpp index 2cca77dd4c1..e5f86f98aac 100644 --- a/src/fields/SoMFVec4d.cpp +++ b/src/fields/SoMFVec4d.cpp @@ -160,15 +160,3 @@ SoMFVec4d::setValue(const double xyzw[4]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec4d field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec4f.cpp b/src/fields/SoMFVec4f.cpp index 464268453ff..4b8e730c3cd 100644 --- a/src/fields/SoMFVec4f.cpp +++ b/src/fields/SoMFVec4f.cpp @@ -158,15 +158,3 @@ SoMFVec4f::setValue(const float xyzw[4]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec4f field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec4i32.cpp b/src/fields/SoMFVec4i32.cpp index 9d4ec6ed1e1..c1d670e66a1 100644 --- a/src/fields/SoMFVec4i32.cpp +++ b/src/fields/SoMFVec4i32.cpp @@ -160,15 +160,3 @@ SoMFVec4i32::setValue(const int32_t xyzw[4]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec4i32 field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec4s.cpp b/src/fields/SoMFVec4s.cpp index 86681185997..eb9ff2878bd 100644 --- a/src/fields/SoMFVec4s.cpp +++ b/src/fields/SoMFVec4s.cpp @@ -160,15 +160,3 @@ SoMFVec4s::setValue(const short xyzw[4]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec4s field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec4ub.cpp b/src/fields/SoMFVec4ub.cpp index d53db508990..b997a26b0a4 100644 --- a/src/fields/SoMFVec4ub.cpp +++ b/src/fields/SoMFVec4ub.cpp @@ -160,38 +160,3 @@ SoMFVec4ub::setValue(const uint8_t xyzw[4]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec4ub field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -BOOST_AUTO_TEST_CASE(textinput) -{ - SbBool ok; - SoMFVec4ub field; - ok = field.set("[]"); - BOOST_CHECK_EQUAL(ok, TRUE); - BOOST_CHECK_EQUAL(field.getNum(), 0); - ok = field.set("1 2 3 4"); - BOOST_CHECK_EQUAL(ok, TRUE); - BOOST_CHECK_EQUAL(field.getNum(), 1); - ok = field.set("[1 2 3 4]"); - BOOST_CHECK_EQUAL(ok, TRUE); - BOOST_CHECK_EQUAL(field.getNum(), 1); - ok = field.set("[1 2 3 4 1 2 3 4]"); - BOOST_CHECK_EQUAL(ok, TRUE); - BOOST_CHECK_EQUAL(field.getNum(), 2); - BOOST_CHECK_EQUAL(field[0], field[1]); - ok = field.set("[1 2 3 4, 1 2 3 4,]"); - BOOST_CHECK_EQUAL(ok, TRUE); - BOOST_CHECK_EQUAL(field.getNum(), 2); - BOOST_CHECK_EQUAL(field[0], field[1]); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec4ui32.cpp b/src/fields/SoMFVec4ui32.cpp index c20e0520574..116fcbf9c5b 100644 --- a/src/fields/SoMFVec4ui32.cpp +++ b/src/fields/SoMFVec4ui32.cpp @@ -160,15 +160,3 @@ SoMFVec4ui32::setValue(const uint32_t xyzw[4]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec4ui32 field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoMFVec4us.cpp b/src/fields/SoMFVec4us.cpp index 221f3d13d2b..578805294d6 100644 --- a/src/fields/SoMFVec4us.cpp +++ b/src/fields/SoMFVec4us.cpp @@ -160,15 +160,3 @@ SoMFVec4us::setValue(const unsigned short xyzw[4]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoMFVec4us field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(field.getNum(), 0); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFBitMask.cpp b/src/fields/SoSFBitMask.cpp index a314a51fbc9..39a090dc46d 100644 --- a/src/fields/SoSFBitMask.cpp +++ b/src/fields/SoSFBitMask.cpp @@ -231,86 +231,3 @@ SoSFBitMask::writeValue(SoOutput * out) const } #endif // DOXYGEN_SKIP_THIS - -#ifdef COIN_TEST_SUITE - -#include - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFBitMask field; - BOOST_CHECK_MESSAGE(SoSFBitMask::getClassTypeId() != SoType::badType(), - "SoSFBitMask class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "SoSFBitMask class not initialized"); -} - -// BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(textinput, 1) - -BOOST_AUTO_TEST_CASE(textinput) -{ - enum Values { VALUE1 = 0x01, VALUE2 = 0x02, VALUE3 = 0x04 }; - enum Other { OTHER1 = 0x01, OTHER2 = 0x02, OTHER3 = 0x04 }; - - SbBool ok; - - SbName names1[3] = { SbName("VALUE1"), SbName("VALUE2"), SbName("VALUE3") }; - int values1[3] = { 0x01, 0x02, 0x04 }; - - SbName names2[3] = { SbName("OTHER1"), SbName("OTHER2"), SbName("OTHER3") }; - int values2[3] = { 0x01, 0x02, 0x04 }; - - SoSFBitMask field1, field2, field3; - - field1.setEnums(3, values1, names1); - field2.setEnums(3, values1, names1); - field3.setEnums(3, values2, names2); - - TestSuite::ResetReadErrorCount(); - static const char * filters[] = { "Unknown SoSFBitMask bit mask value", NULL }; - TestSuite::PushMessageSuppressFilters(filters); - ok = field1.set("OTHER1"); // should output error - BOOST_CHECK_MESSAGE(ok == FALSE, "accepted 'OTHER1' erroneously"); - TestSuite::PopMessageSuppressFilters(); - BOOST_CHECK_EQUAL(TestSuite::GetReadErrorCount(), 1); - TestSuite::ResetReadErrorCount(); - - ok = field1.set("VALUE2"); - BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'VALUE2'"); - ok = field2.set("VALUE2"); - BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'VALUE2'"); - BOOST_CHECK_EQUAL(field1.getValue(), field2.getValue()); - BOOST_CHECK_MESSAGE(field1.isSame(field2), "SoSFBitmask.isSame() problem"); - - ok = field1.set("VALUE2"); - BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'VALUE2'"); - ok = field2.set("(VALUE1|VALUE3)"); - BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept '(VALUE1|VALUE3)'"); - BOOST_CHECK_EQUAL(field2.getValue(), VALUE1|VALUE3); - BOOST_CHECK_MESSAGE(!field2.isSame(field1), "SoSFBitmask.isSame() problem"); - - // failing test, but unclear if it is required to work - ok = field2.set("VALUE1|VALUE3"); // this ought to work too, right? - BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'VALUE1|VALUE2'"); - //BOOST_CHECK_EQUAL(field2.getValue(), VALUE1|VALUE3); - - // FIXME: try to read the same from a file? - // Solving this would go into the math-parsing problem? - - ok = field1.set("VALUE2"); - BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'VALUE2'"); - ok = field3.set("OTHER2"); - BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'OTHER2'"); - BOOST_CHECK_EQUAL(field1.getValue(), field3.getValue()); - BOOST_CHECK_MESSAGE(!field1.isSame(field3), "SoSFBitmask.isSame() false positive"); - - // Numeric values don't work. - //ok = field1.set("0"); - //BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept '0'"); - //BOOST_CHECK_MESSAGE(field1.getValue() == 0, "did not set value to 0"); - //ok = field1.set("1"); - //BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept '1'"); - //BOOST_CHECK_MESSAGE(field1.getValue() == 1, "did not set value to 1"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFBool.cpp b/src/fields/SoSFBool.cpp index 1a62f0235df..a395828ce38 100644 --- a/src/fields/SoSFBool.cpp +++ b/src/fields/SoSFBool.cpp @@ -95,51 +95,3 @@ SoSFBool::writeValue(SoOutput * out) const #endif // DOXYGEN_SKIP_THIS // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFBool field; - BOOST_CHECK_MESSAGE(SoSFBool::getClassTypeId() != SoType::badType(), - "SoSFBool class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -BOOST_AUTO_TEST_CASE(textinput) -{ - SbBool ok; - SoSFBool field; - ok = field.set("TRUE"); - BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'TRUE'"); - BOOST_CHECK_EQUAL(field.getValue(), TRUE); - ok = field.set("FALSE"); - BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'FALSE'"); - BOOST_CHECK_EQUAL(field.getValue(), FALSE); - - TestSuite::ResetReadErrorCount(); - static const char * filters[] = { "Invalid value", NULL }; - TestSuite::PushMessageSuppressFilters(filters); - ok = field.set("MAYBE"); // emits two error messages - BOOST_CHECK_MESSAGE(ok == FALSE, "did accept 'MAYBE'"); - BOOST_CHECK_MESSAGE(TestSuite::GetReadErrorCount() == 1, "did not emit error"); - TestSuite::PopMessageSuppressFilters(); - TestSuite::ResetReadErrorCount(); - - ok = field.set("0"); - BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept '0'"); - BOOST_CHECK_EQUAL(field.getValue(), FALSE); - ok = field.set("1"); - BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept '1'"); - BOOST_CHECK_EQUAL(field.getValue(), TRUE); - - static const char * filters2[] = { "Illegal value", NULL }; - TestSuite::PushMessageSuppressFilters(filters2); - ok = field.set("2"); - BOOST_CHECK_MESSAGE(ok == FALSE, "did accept '2'"); - TestSuite::PopMessageSuppressFilters(); - TestSuite::ResetReadErrorCount(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFBox2d.cpp b/src/fields/SoSFBox2d.cpp index dbffba94ffb..6e3aacec26c 100644 --- a/src/fields/SoSFBox2d.cpp +++ b/src/fields/SoSFBox2d.cpp @@ -142,16 +142,3 @@ SoSFBox2d::getValue(SbBox2d & box) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFBox2d field; - BOOST_CHECK_MESSAGE(SoSFBox2d::getClassTypeId() != SoType::badType(), - "SoSFBox2d class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFBox2f.cpp b/src/fields/SoSFBox2f.cpp index ad3e7ec0cd8..8744e8c5ee1 100644 --- a/src/fields/SoSFBox2f.cpp +++ b/src/fields/SoSFBox2f.cpp @@ -142,16 +142,3 @@ SoSFBox2f::getValue(SbBox2f & box) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFBox2f field; - BOOST_CHECK_MESSAGE(SoSFBox2f::getClassTypeId() != SoType::badType(), - "SoSFBox2f class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFBox2i32.cpp b/src/fields/SoSFBox2i32.cpp index 92fbd85f05f..92a2b644ad5 100644 --- a/src/fields/SoSFBox2i32.cpp +++ b/src/fields/SoSFBox2i32.cpp @@ -142,16 +142,3 @@ SoSFBox2i32::getValue(SbBox2i32 & box) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFBox2i32 field; - BOOST_CHECK_MESSAGE(SoSFBox2i32::getClassTypeId() != SoType::badType(), - "SoSFBox2i32 class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFBox2s.cpp b/src/fields/SoSFBox2s.cpp index 5d469af1e31..ccda86a721c 100644 --- a/src/fields/SoSFBox2s.cpp +++ b/src/fields/SoSFBox2s.cpp @@ -142,16 +142,3 @@ SoSFBox2s::getValue(SbBox2s & box) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFBox2s field; - BOOST_CHECK_MESSAGE(SoSFBox2s::getClassTypeId() != SoType::badType(), - "SoSFBox2s class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFBox3d.cpp b/src/fields/SoSFBox3d.cpp index 4352e9fa886..67b911e2601 100644 --- a/src/fields/SoSFBox3d.cpp +++ b/src/fields/SoSFBox3d.cpp @@ -148,16 +148,3 @@ SoSFBox3d::getValue(SbBox3d & box) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFBox3d field; - BOOST_CHECK_MESSAGE(SoSFBox3d::getClassTypeId() != SoType::badType(), - "SoSFBox3d class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFBox3f.cpp b/src/fields/SoSFBox3f.cpp index c1ae4e22b0d..fefaed1b653 100644 --- a/src/fields/SoSFBox3f.cpp +++ b/src/fields/SoSFBox3f.cpp @@ -148,16 +148,3 @@ SoSFBox3f::getValue(SbBox3f & box) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFBox3f field; - BOOST_CHECK_MESSAGE(SoSFBox3f::getClassTypeId() != SoType::badType(), - "SoSFBox3f class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFBox3i32.cpp b/src/fields/SoSFBox3i32.cpp index 7df39bf5535..b2cbea79e37 100644 --- a/src/fields/SoSFBox3i32.cpp +++ b/src/fields/SoSFBox3i32.cpp @@ -148,16 +148,3 @@ SoSFBox3i32::getValue(SbBox3i32 & box) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFBox3i32 field; - BOOST_CHECK_MESSAGE(SoSFBox3i32::getClassTypeId() != SoType::badType(), - "SoSFBox3i32 class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFBox3s.cpp b/src/fields/SoSFBox3s.cpp index e8e56a53159..826bb501313 100644 --- a/src/fields/SoSFBox3s.cpp +++ b/src/fields/SoSFBox3s.cpp @@ -154,16 +154,3 @@ SoSFBox3s::getValue(SbBox3s & box) const } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFBox3s field; - BOOST_CHECK_MESSAGE(SoSFBox3s::getClassTypeId() != SoType::badType(), - "SoSFBox3s class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFColor.cpp b/src/fields/SoSFColor.cpp index c220d52a099..819aa2ec302 100644 --- a/src/fields/SoSFColor.cpp +++ b/src/fields/SoSFColor.cpp @@ -153,16 +153,3 @@ SoSFColor::setHSVValue(const float hsv[3]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFColor field; - BOOST_CHECK_MESSAGE(SoSFColor::getClassTypeId() != SoType::badType(), - "SoSFColor class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFColorRGBA.cpp b/src/fields/SoSFColorRGBA.cpp index 108899ec4af..f4a6ea563d7 100644 --- a/src/fields/SoSFColorRGBA.cpp +++ b/src/fields/SoSFColorRGBA.cpp @@ -154,29 +154,3 @@ SoSFColorRGBA::setHSVValue(const float hsva[4]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFColorRGBA field; - BOOST_CHECK_MESSAGE(SoSFColorRGBA::getClassTypeId() != SoType::badType(), - "SoSFColorRGBA class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -BOOST_AUTO_TEST_CASE(textinput) -{ - SbBool ok; - SoSFColorRGBA field; - ok = field.set("0.0 .5 0 1"); - BOOST_CHECK_MESSAGE(ok == TRUE, "could not set value"); - BOOST_CHECK_EQUAL(field.getValue(), SbColorRGBA(0, .5, 0, 1)); - ok = field.set("0 0.5 1"); - BOOST_CHECK_MESSAGE(ok == FALSE, "accepted invalid (missing component) value"); - ok = field.set("1 2 3 4"); - //BOOST_CHECK_MESSAGE(ok == FALSE, "accepted out-of-range value"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFDouble.cpp b/src/fields/SoSFDouble.cpp index 9ed9f5c0e78..0be3be21d4a 100644 --- a/src/fields/SoSFDouble.cpp +++ b/src/fields/SoSFDouble.cpp @@ -89,16 +89,3 @@ SoSFDouble::writeValue(SoOutput * out) const #endif // DOXYGEN_SKIP_THIS // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFDouble field; - BOOST_CHECK_MESSAGE(SoSFDouble::getClassTypeId() != SoType::badType(), - "SoSFDouble class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFEngine.cpp b/src/fields/SoSFEngine.cpp index ef8ad824e6e..323f3069dfb 100644 --- a/src/fields/SoSFEngine.cpp +++ b/src/fields/SoSFEngine.cpp @@ -316,16 +316,3 @@ SoSFEngine::referencesCopy(void) const // Kill the type-specific define. #undef COIN_INTERNAL_SOSFENGINE //$ END TEMPLATE SFNodeEnginePath - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFEngine field; - BOOST_CHECK_MESSAGE(SoSFEngine::getClassTypeId() != SoType::badType(), - "SoSFEngine class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFEnum.cpp b/src/fields/SoSFEnum.cpp index 1af946b8166..a214f14ebac 100644 --- a/src/fields/SoSFEnum.cpp +++ b/src/fields/SoSFEnum.cpp @@ -375,16 +375,3 @@ SoSFEnum::getEnum(const int idx, SbName & name) const name = this->enumNames[idx]; return this->enumValues[idx]; } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFEnum field; - BOOST_CHECK_MESSAGE(SoSFEnum::getClassTypeId() != SoType::badType(), - "SoSFEnum class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFFloat.cpp b/src/fields/SoSFFloat.cpp index d66281468bf..36abf09de07 100644 --- a/src/fields/SoSFFloat.cpp +++ b/src/fields/SoSFFloat.cpp @@ -89,16 +89,3 @@ SoSFFloat::writeValue(SoOutput * out) const #endif // DOXYGEN_SKIP_THIS // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFFloat field; - BOOST_CHECK_MESSAGE(SoSFFloat::getClassTypeId() != SoType::badType(), - "SoSFFloat class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFImage.cpp b/src/fields/SoSFImage.cpp index b33d080b05f..cf7b921b790 100644 --- a/src/fields/SoSFImage.cpp +++ b/src/fields/SoSFImage.cpp @@ -594,16 +594,3 @@ SoSFImage::hasTransparency(void) const } #undef PRIVATE - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFImage field; - BOOST_CHECK_MESSAGE(SoSFImage::getClassTypeId() != SoType::badType(), - "SoSFImage class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFImage3.cpp b/src/fields/SoSFImage3.cpp index 6b8da92573f..6103bbd961c 100644 --- a/src/fields/SoSFImage3.cpp +++ b/src/fields/SoSFImage3.cpp @@ -352,16 +352,3 @@ SoSFImage3::finishEditing(void) { this->valueChanged(); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFImage3 field; - BOOST_CHECK_MESSAGE(SoSFImage3::getClassTypeId() != SoType::badType(), - "SoSFImage3 class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFInt32.cpp b/src/fields/SoSFInt32.cpp index 017b68f6e5b..af59e08407e 100644 --- a/src/fields/SoSFInt32.cpp +++ b/src/fields/SoSFInt32.cpp @@ -99,16 +99,3 @@ SoSFInt32::writeValue(SoOutput * out) const } #endif // DOXYGEN_SKIP_THIS - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFInt32 field; - BOOST_CHECK_MESSAGE(SoSFInt32::getClassTypeId() != SoType::badType(), - "SoSFInt32 class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFMatrix.cpp b/src/fields/SoSFMatrix.cpp index 7f15b9b46f2..18523caa443 100644 --- a/src/fields/SoSFMatrix.cpp +++ b/src/fields/SoSFMatrix.cpp @@ -112,16 +112,3 @@ SoSFMatrix::setValue(const float a11, const float a12, } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFMatrix field; - BOOST_CHECK_MESSAGE(SoSFMatrix::getClassTypeId() != SoType::badType(), - "SoSFMatrix class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFName.cpp b/src/fields/SoSFName.cpp index 25ae7612c6d..ca6c7cf43c3 100644 --- a/src/fields/SoSFName.cpp +++ b/src/fields/SoSFName.cpp @@ -120,16 +120,3 @@ SoSFName::setValue(const char * const name) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFName field; - BOOST_CHECK_MESSAGE(SoSFName::getClassTypeId() != SoType::badType(), - "SoSFName class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFNode.cpp b/src/fields/SoSFNode.cpp index dbd877368ed..0c6269139e3 100644 --- a/src/fields/SoSFNode.cpp +++ b/src/fields/SoSFNode.cpp @@ -343,41 +343,3 @@ SoSFNode::referencesCopy(void) const // Kill the type-specific define. #undef COIN_INTERNAL_SOSFNODE //$ END TEMPLATE SFNodeEnginePath - -#ifdef COIN_TEST_SUITE - -#include -#include - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFNode field; - BOOST_CHECK_MESSAGE(SoSFNode::getClassTypeId() != SoType::badType(), - "SoSFNode class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#ifdef HAVE_VRML97 -BOOST_AUTO_TEST_CASE(vrml97nullchild) -{ - // NULL values for children must be allowed, or we break VRML97 - // support. -mortene. - char scene[] = "#VRML V2.0 utf8\n\nAppearance { material NULL }"; - - SoInput * in = new SoInput; - in->setBuffer(reinterpret_cast(scene), strlen(scene)); - SoNode * g = NULL; - const SbBool readok = SoDB::read(in, g); - delete in; - - BOOST_CHECK_MESSAGE(readok, - "failed to read VRML97 with NULL child in graph"); - if (g) { - g->ref(); - g->unref(); - } -} -#endif - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFPath.cpp b/src/fields/SoSFPath.cpp index 3f7dceb3884..a20942fd62e 100644 --- a/src/fields/SoSFPath.cpp +++ b/src/fields/SoSFPath.cpp @@ -357,17 +357,3 @@ SoSFPath::notify(SoNotList * l) inherited::notify(l); } - - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFPath field; - BOOST_CHECK_MESSAGE(SoSFPath::getClassTypeId() != SoType::badType(), - "SoSFPath class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFPlane.cpp b/src/fields/SoSFPlane.cpp index 4568bce1ccf..7a9b4ec5dce 100644 --- a/src/fields/SoSFPlane.cpp +++ b/src/fields/SoSFPlane.cpp @@ -95,16 +95,3 @@ SoSFPlane::writeValue(SoOutput * out) const #endif // DOXYGEN_SKIP_THIS // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFPlane field; - BOOST_CHECK_MESSAGE(SoSFPlane::getClassTypeId() != SoType::badType(), - "SoSFPlane class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFRotation.cpp b/src/fields/SoSFRotation.cpp index e8cfe4d2a1d..9a4dab87a43 100644 --- a/src/fields/SoSFRotation.cpp +++ b/src/fields/SoSFRotation.cpp @@ -157,16 +157,3 @@ SoSFRotation::setValue(const SbVec3f & axis, const float angle) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFRotation field; - BOOST_CHECK_MESSAGE(SoSFRotation::getClassTypeId() != SoType::badType(), - "SoSFRotation class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFShort.cpp b/src/fields/SoSFShort.cpp index a67c96e9e5f..b5d14f4a367 100644 --- a/src/fields/SoSFShort.cpp +++ b/src/fields/SoSFShort.cpp @@ -89,16 +89,3 @@ SoSFShort::writeValue(SoOutput * out) const #endif // DOXYGEN_SKIP_THIS // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFShort field; - BOOST_CHECK_MESSAGE(SoSFShort::getClassTypeId() != SoType::badType(), - "SoSFShort class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFString.cpp b/src/fields/SoSFString.cpp index 8e1adc72841..ec521b61f69 100644 --- a/src/fields/SoSFString.cpp +++ b/src/fields/SoSFString.cpp @@ -101,16 +101,3 @@ SoSFString::setValue(const char * str) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFString field; - BOOST_CHECK_MESSAGE(SoSFString::getClassTypeId() != SoType::badType(), - "SoSFString class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFTime.cpp b/src/fields/SoSFTime.cpp index fe0e1f518e1..1800934c4f6 100644 --- a/src/fields/SoSFTime.cpp +++ b/src/fields/SoSFTime.cpp @@ -98,16 +98,3 @@ SoSFTime::writeValue(SoOutput * out) const #endif // DOXYGEN_SKIP_THIS // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFTime field; - BOOST_CHECK_MESSAGE(SoSFTime::getClassTypeId() != SoType::badType(), - "SoSFTime class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFTrigger.cpp b/src/fields/SoSFTrigger.cpp index 45a0c67cbff..6325475390b 100644 --- a/src/fields/SoSFTrigger.cpp +++ b/src/fields/SoSFTrigger.cpp @@ -154,16 +154,3 @@ SoSFTrigger::writeValue(SoOutput * COIN_UNUSED_ARG(out)) const { return; } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFTrigger field; - BOOST_CHECK_MESSAGE(SoSFTrigger::getClassTypeId() != SoType::badType(), - "SoSFTrigger class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFUInt32.cpp b/src/fields/SoSFUInt32.cpp index f31b5093b66..b69a9c738e1 100644 --- a/src/fields/SoSFUInt32.cpp +++ b/src/fields/SoSFUInt32.cpp @@ -93,16 +93,3 @@ SoSFUInt32::writeValue(SoOutput * out) const #endif // DOXYGEN_SKIP_THIS // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFUInt32 field; - BOOST_CHECK_MESSAGE(SoSFUInt32::getClassTypeId() != SoType::badType(), - "SoSFUInt32 class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFUShort.cpp b/src/fields/SoSFUShort.cpp index a41ac70ec5a..2a0b730eda2 100644 --- a/src/fields/SoSFUShort.cpp +++ b/src/fields/SoSFUShort.cpp @@ -89,16 +89,3 @@ SoSFUShort::writeValue(SoOutput * out) const #endif // DOXYGEN_SKIP_THIS // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFUShort field; - BOOST_CHECK_MESSAGE(SoSFUShort::getClassTypeId() != SoType::badType(), - "SoSFUShort class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec2b.cpp b/src/fields/SoSFVec2b.cpp index b9b91753680..73e6f099c99 100644 --- a/src/fields/SoSFVec2b.cpp +++ b/src/fields/SoSFVec2b.cpp @@ -114,16 +114,3 @@ SoSFVec2b::setValue(const int8_t xy[2]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec2b field; - BOOST_CHECK_MESSAGE(SoSFVec2b::getClassTypeId() != SoType::badType(), - "SoSFVec2b class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec2d.cpp b/src/fields/SoSFVec2d.cpp index ce92f857561..d8d7aab6a66 100644 --- a/src/fields/SoSFVec2d.cpp +++ b/src/fields/SoSFVec2d.cpp @@ -114,16 +114,3 @@ SoSFVec2d::setValue(const double xy[2]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec2d field; - BOOST_CHECK_MESSAGE(SoSFVec2d::getClassTypeId() != SoType::badType(), - "SoSFVec2d class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec2f.cpp b/src/fields/SoSFVec2f.cpp index bc2af7837bc..fa017aa3a3a 100644 --- a/src/fields/SoSFVec2f.cpp +++ b/src/fields/SoSFVec2f.cpp @@ -112,16 +112,3 @@ SoSFVec2f::setValue(const float xy[2]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec2f field; - BOOST_CHECK_MESSAGE(SoSFVec2f::getClassTypeId() != SoType::badType(), - "SoSFVec2f class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec2i32.cpp b/src/fields/SoSFVec2i32.cpp index 9418f8c453c..08318fde1ab 100644 --- a/src/fields/SoSFVec2i32.cpp +++ b/src/fields/SoSFVec2i32.cpp @@ -114,16 +114,3 @@ SoSFVec2i32::setValue(const int32_t xy[2]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec2i32 field; - BOOST_CHECK_MESSAGE(SoSFVec2i32::getClassTypeId() != SoType::badType(), - "SoSFVec2i32 class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec2s.cpp b/src/fields/SoSFVec2s.cpp index 49244f12cdc..c800e70b159 100644 --- a/src/fields/SoSFVec2s.cpp +++ b/src/fields/SoSFVec2s.cpp @@ -118,16 +118,3 @@ SoSFVec2s::setValue(const short xy[2]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec2s field; - BOOST_CHECK_MESSAGE(SoSFVec2s::getClassTypeId() != SoType::badType(), - "SoSFVec2s class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec3b.cpp b/src/fields/SoSFVec3b.cpp index 044f1464fc7..26240160ddd 100644 --- a/src/fields/SoSFVec3b.cpp +++ b/src/fields/SoSFVec3b.cpp @@ -116,16 +116,3 @@ SoSFVec3b::setValue(const int8_t xyz[3]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec3b field; - BOOST_CHECK_MESSAGE(SoSFVec3b::getClassTypeId() != SoType::badType(), - "SoSFVec3b class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec3d.cpp b/src/fields/SoSFVec3d.cpp index ae3b82c184f..a1a82ae7af7 100644 --- a/src/fields/SoSFVec3d.cpp +++ b/src/fields/SoSFVec3d.cpp @@ -110,16 +110,3 @@ SoSFVec3d::setValue(const double xyz[3]) { this->setValue(SbVec3d(xyz)); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec3d field; - BOOST_CHECK_MESSAGE(SoSFVec3d::getClassTypeId() != SoType::badType(), - "SoSFVec3d class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec3f.cpp b/src/fields/SoSFVec3f.cpp index 3a647fe9069..10ed6832233 100644 --- a/src/fields/SoSFVec3f.cpp +++ b/src/fields/SoSFVec3f.cpp @@ -114,16 +114,3 @@ SoSFVec3f::setValue(const float xyz[3]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec3f field; - BOOST_CHECK_MESSAGE(SoSFVec3f::getClassTypeId() != SoType::badType(), - "SoSFVec3f class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec3i32.cpp b/src/fields/SoSFVec3i32.cpp index 0aa6d373b30..2638152417a 100644 --- a/src/fields/SoSFVec3i32.cpp +++ b/src/fields/SoSFVec3i32.cpp @@ -114,16 +114,3 @@ SoSFVec3i32::setValue(const int32_t xyz[3]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec3i32 field; - BOOST_CHECK_MESSAGE(SoSFVec3i32::getClassTypeId() != SoType::badType(), - "SoSFVec3i32 class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec3s.cpp b/src/fields/SoSFVec3s.cpp index 68973a4e653..bd15fbac52b 100644 --- a/src/fields/SoSFVec3s.cpp +++ b/src/fields/SoSFVec3s.cpp @@ -118,16 +118,3 @@ SoSFVec3s::setValue(const short xyz[3]) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec3s field; - BOOST_CHECK_MESSAGE(SoSFVec3s::getClassTypeId() != SoType::badType(), - "SoSFVec3s class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec4b.cpp b/src/fields/SoSFVec4b.cpp index a417cd55cc9..a53c565156d 100644 --- a/src/fields/SoSFVec4b.cpp +++ b/src/fields/SoSFVec4b.cpp @@ -114,16 +114,3 @@ SoSFVec4b::setValue(const int8_t xyzw[4]) { this->setValue(SbVec4b(xyzw)); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec4b field; - BOOST_CHECK_MESSAGE(SoSFVec4b::getClassTypeId() != SoType::badType(), - "SoSFVec4b class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec4d.cpp b/src/fields/SoSFVec4d.cpp index 38400041745..5c1c18289b8 100644 --- a/src/fields/SoSFVec4d.cpp +++ b/src/fields/SoSFVec4d.cpp @@ -114,16 +114,3 @@ SoSFVec4d::setValue(const double xyzw[4]) { this->setValue(SbVec4d(xyzw)); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec4d field; - BOOST_CHECK_MESSAGE(SoSFVec4d::getClassTypeId() != SoType::badType(), - "SoSFVec4d class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec4f.cpp b/src/fields/SoSFVec4f.cpp index 02edf9e9091..92b274396c2 100644 --- a/src/fields/SoSFVec4f.cpp +++ b/src/fields/SoSFVec4f.cpp @@ -112,16 +112,3 @@ SoSFVec4f::setValue(const float xyzw[4]) { this->setValue(SbVec4f(xyzw)); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec4f field; - BOOST_CHECK_MESSAGE(SoSFVec4f::getClassTypeId() != SoType::badType(), - "SoSFVec4f class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec4i32.cpp b/src/fields/SoSFVec4i32.cpp index de55e635c9e..f37bf36ce62 100644 --- a/src/fields/SoSFVec4i32.cpp +++ b/src/fields/SoSFVec4i32.cpp @@ -114,16 +114,3 @@ SoSFVec4i32::setValue(const int32_t xyzw[4]) { this->setValue(SbVec4i32(xyzw)); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec4i32 field; - BOOST_CHECK_MESSAGE(SoSFVec4i32::getClassTypeId() != SoType::badType(), - "SoSFVec4i32 class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec4s.cpp b/src/fields/SoSFVec4s.cpp index ace2a871d99..59eaf68a9bd 100644 --- a/src/fields/SoSFVec4s.cpp +++ b/src/fields/SoSFVec4s.cpp @@ -114,16 +114,3 @@ SoSFVec4s::setValue(const short xyzw[4]) { this->setValue(SbVec4s(xyzw)); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec4s field; - BOOST_CHECK_MESSAGE(SoSFVec4s::getClassTypeId() != SoType::badType(), - "SoSFVec4s class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec4ub.cpp b/src/fields/SoSFVec4ub.cpp index 577c71825d6..f0a5e972677 100644 --- a/src/fields/SoSFVec4ub.cpp +++ b/src/fields/SoSFVec4ub.cpp @@ -114,31 +114,3 @@ SoSFVec4ub::setValue(const uint8_t xyzw[4]) { this->setValue(SbVec4ub(xyzw)); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - BOOST_CHECK_MESSAGE(SoSFVec4ub::getClassTypeId() != SoType::badType(), - "SoSFVec4ub class not initialized"); - SoSFVec4ub field; - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "SoSFVec4ub object wrongly initialized"); - // no default value initialization to test - field.setValue(1, 2, 3, 4); - BOOST_CHECK_EQUAL(field.getValue(), SbVec4ub(1, 2, 3, 4)); -} - -BOOST_AUTO_TEST_CASE(textinput) -{ - TestSuite::ResetReadErrorCount(); - SbBool ok; - SoSFVec4ub field; - ok = field.set("1 2 3 4"); - BOOST_CHECK_MESSAGE(ok == TRUE, "SoSFVec4ub read error"); - BOOST_CHECK_EQUAL(field.getValue(), SbVec4ub(1, 2, 3, 4)); - BOOST_CHECK_EQUAL(TestSuite::GetReadErrorCount(), 0); - TestSuite::ResetReadErrorCount(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec4ui32.cpp b/src/fields/SoSFVec4ui32.cpp index 1d88ae5b650..b5b31f28fb9 100644 --- a/src/fields/SoSFVec4ui32.cpp +++ b/src/fields/SoSFVec4ui32.cpp @@ -114,16 +114,3 @@ SoSFVec4ui32::setValue(const uint32_t xyzw[4]) { this->setValue(SbVec4ui32(xyzw)); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec4ui32 field; - BOOST_CHECK_MESSAGE(SoSFVec4ui32::getClassTypeId() != SoType::badType(), - "SoSFVec4ui32 class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/fields/SoSFVec4us.cpp b/src/fields/SoSFVec4us.cpp index 9d245f2d07b..dd5c8c22507 100644 --- a/src/fields/SoSFVec4us.cpp +++ b/src/fields/SoSFVec4us.cpp @@ -114,38 +114,3 @@ SoSFVec4us::setValue(const unsigned short xyzw[4]) { this->setValue(SbVec4us(xyzw)); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoSFVec4us field; - BOOST_CHECK_MESSAGE(SoSFVec4us::getClassTypeId() != SoType::badType(), - "SoSFVec4us class not initialized"); - BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), - "missing class initialization"); -} - -BOOST_AUTO_TEST_CASE(textinput) -{ - SoSFVec4us field; - field.set("1 2 3 4"); - BOOST_CHECK_EQUAL(field.getValue(), SbVec4us(1, 2, 3, 4)); - const char * filters[] = { "read error", NULL }; // all read error messages - TestSuite::ResetReadErrorCount(); - // TestSuite::PushMessageSuppressFilters(filters); - SbBool ok; - ok = field.set("-3 4 32 3"); // should emit error message on '-3' - BOOST_CHECK_EQUAL(ok, FALSE); - //BOOST_CHECK_EQUAL(TestSuite::GetReadErrorCount(), 1); - ok = field.set("3 525 32 3"); // should emit error message on '525' - //BOOST_CHECK_EQUAL(ok, FALSE); - //BOOST_CHECK_EQUAL(TestSuite::GetReadErrorCount(), 2); - ok = field.set("3 32 3"); // error on account of too few numbers - BOOST_CHECK_EQUAL(ok, FALSE); - //BOOST_CHECK_EQUAL(TestSuite::GetReadErrorCount(), 3); - // TestSuite::PopMessageSuppressFilters(); - TestSuite::ResetReadErrorCount(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/geo/SoGeoCoordinate.cpp b/src/geo/SoGeoCoordinate.cpp index 703474c2c21..c8858b645e1 100644 --- a/src/geo/SoGeoCoordinate.cpp +++ b/src/geo/SoGeoCoordinate.cpp @@ -212,17 +212,3 @@ SoGeoCoordinate::getTransform(SoGeoOrigin * origin, const int idx) const #undef PRIVATE // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - BOOST_CHECK_MESSAGE(SoGeoCoordinate::getClassTypeId() != SoType::badType(), - "SoGeoCoordinate class not initialized"); - SoRefPtr node(new SoGeoCoordinate); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "missing class initialization"); - BOOST_CHECK_EQUAL(node->point.getNum(), 1); -} - -#endif // COIN_TEST_SUITE diff --git a/src/geo/SoGeoElement.cpp b/src/geo/SoGeoElement.cpp index 23af7b2f180..cd0c8232600 100644 --- a/src/geo/SoGeoElement.cpp +++ b/src/geo/SoGeoElement.cpp @@ -129,13 +129,3 @@ SoGeoElement::setElt(SoGeoOrigin * origin) } #undef PRIVATE - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - BOOST_CHECK_MESSAGE(SoGeoElement::getClassStackIndex() != -1, - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/geo/SoGeoLocation.cpp b/src/geo/SoGeoLocation.cpp index 6cc30cbc339..d952ae9304c 100644 --- a/src/geo/SoGeoLocation.cpp +++ b/src/geo/SoGeoLocation.cpp @@ -210,17 +210,3 @@ SoGeoLocation::getTransform(SoState * state) const "No SoGeoOrigin node found on stack."); return SbMatrix::identity(); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoGeoLocation * node = new SoGeoLocation; - assert(node); - node->ref(); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "missing class initialization"); - node->unref(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/geo/SoGeoOrigin.cpp b/src/geo/SoGeoOrigin.cpp index d3e3b755b46..d7683770027 100644 --- a/src/geo/SoGeoOrigin.cpp +++ b/src/geo/SoGeoOrigin.cpp @@ -337,17 +337,3 @@ SoGeoOrigin::getPrimitiveCount(SoGetPrimitiveCountAction * action) { SoGeoOrigin::doAction((SoAction *)action); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoGeoOrigin * node = new SoGeoOrigin; - assert(node); - node->ref(); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "missing class initialization"); - node->unref(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/geo/SoGeoSeparator.cpp b/src/geo/SoGeoSeparator.cpp index e344b93e80c..9294bbdc721 100644 --- a/src/geo/SoGeoSeparator.cpp +++ b/src/geo/SoGeoSeparator.cpp @@ -257,16 +257,3 @@ SoGeoSeparator::getTransform(SoState * state) const "No SoGeoOrigin node found on stack."); return SbMatrix::identity(); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - BOOST_CHECK_MESSAGE(SoGeoSeparator::getClassTypeId() != SoType::badType(), - "SoGeoSeparator class not initialized"); - SoRefPtr node(new SoGeoSeparator); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "SoGeoSeparator object wrongly initialized"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/misc/SoBase.cpp b/src/misc/SoBase.cpp index 48871925b4d..e6930bc0aa2 100644 --- a/src/misc/SoBase.cpp +++ b/src/misc/SoBase.cpp @@ -1571,275 +1571,5 @@ SoBase::createNotRec(void) /* *********************************************************************** */ -#ifdef COIN_TEST_SUITE - -/*This test targets the implementation of SoWriterefCounter::getWriteName - in the source file SoWriterefCounter.cpp. Test is put here because the - SoWriterefCounter class is not part of the public API. It is being called - from here - */ - -#include -#include -#include -#include -#include -#include - - static char * buffer; - static size_t buffer_size = 0; - -// -// If function is copied from SoWriterefCounter.cpp as pricate classes cannot be called from the test suite -// - static SbBool -dont_mangle_output_names(const SoBase *base) -{ - static int COIN_DONT_MANGLE_OUTPUT_NAMES = -1; - - // Always unmangle node names in VRML1 and VRML2 - if (base->isOfType(SoNode::getClassTypeId()) && - (((SoNode *)base)->getNodeType()==SoNode::VRML1 || - ((SoNode *)base)->getNodeType()==SoNode::VRML2)) return TRUE; - - if (COIN_DONT_MANGLE_OUTPUT_NAMES < 0) { - COIN_DONT_MANGLE_OUTPUT_NAMES = 0; - const char * env = coin_getenv("COIN_DONT_MANGLE_OUTPUT_NAMES"); - if (env) COIN_DONT_MANGLE_OUTPUT_NAMES = atoi(env); - } - return COIN_DONT_MANGLE_OUTPUT_NAMES ? TRUE : FALSE; -} - - static void * - buffer_realloc(void * bufptr, size_t size) - { - buffer = (char *)realloc(bufptr, size); - buffer_size = size; - return buffer; - } - - -BOOST_AUTO_TEST_CASE(checkWriteWithMultiref) -{ - SoDB::init(); - SoNode* scenegraph; - SoSeparator *root = new SoSeparator; - root->ref(); - root->setName("root"); - scenegraph = root; - SoSeparator *n0 = new SoSeparator; - SoSeparator *a0 = new SoSeparator; - SoSeparator *a1 = new SoSeparator; - SoSeparator *a2 = new SoSeparator; - SoSeparator *a3 = new SoSeparator; - SoSeparator *b0 = new SoSeparator; - SoSeparator *b1 = new SoSeparator; - SoSeparator *b2 = new SoSeparator; - SoSeparator *b3 = new SoSeparator; - SoSeparator *b4 = new SoSeparator; - SoSeparator *c0 = new SoSeparator; - - a2->setName(SbName("MyName")); - b0->setName(SbName("MyName")); - b1->setName(SbName("MyName")); - b2->setName(SbName("MyName")); - b4->setName(SbName("MyName")); - c0->setName(SbName("MyName")); - - root->addChild(n0); - root->addChild(n0); - root->addChild(a0); - a0->addChild(b0); - a0->addChild(b1); - root->addChild(b0); - root->addChild(a1); - a1->addChild(b2); - a1->addChild(b1); - root->addChild(b1); - root->addChild(a2); - root->addChild(a2); - root->addChild(a3); - a3->addChild(b3); - b3->addChild(c0); - b3->addChild(c0); - a3->addChild(b4); - a3->addChild(a2); - - - -/* - Correct output file if dont_mangle_names: - -#VRML V1.0 ascii - -VRMLGroup { - children - DEF root VRMLGroup { - children [ - DEF _+0 VRMLGroup { - }, - USE _+0, - DEF _+1 VRMLGroup { - children [ - DEF MyName VRMLGroup { - }, - DEF MyName+2 VRMLGroup { - } ] - }, - USE MyName, - DEF _+3 VRMLGroup { - children [ - DEF MyName+4 VRMLGroup { - }, - USE MyName+2 ] - }, - USE MyName+2, - DEF MyName+5 VRMLGroup { - }, - USE MyName+5, - DEF _+6 VRMLGroup { - children [ - DEF _+7 VRMLGroup { - children [ - DEF MyName+8 VRMLGroup { - }, - USE MyName+8 ] - }, - DEF MyName+9 VRMLGroup { - }, - USE MyName+5 ] - } ] - } -} - */ - - /* correct outputfile for default OIV behavior: -#VRML V1.0 ascii - -DEF root Separator { - DEF _+0 Separator { - } - USE _+0 - Separator { - DEF MyName Separator { - } - DEF MyName+1 Separator { - } - } - USE MyName - Separator { - DEF MyName+2 Separator { - } - USE MyName+1 - } - USE MyName+1 - DEF MyName+3 Separator { - } - USE MyName+3 - Separator { - Separator { - DEF MyName+4 Separator { - } - USE MyName+4 - } - DEF MyName+5 Separator { - } - USE MyName+3 - } -} -*/ - -#ifdef HAVE_VRML97 - SoVRMLGroup *newroot; - for(int j=0;j<2;j++) { - if(j==1) { - SoToVRML2Action tovrml2; - tovrml2.apply(root); - newroot = tovrml2.getVRML2SceneGraph(); - newroot->ref(); - scenegraph = newroot; - } - - - buffer = (char*)malloc(1024); - SoOutput out; - // out.openFile("out.wrl"); - out.setBuffer(buffer, 1024,buffer_realloc); - out.setHeaderString(SbString("#VRML V1.0 ascii")); - SoWriteAction wra(&out); - wra.apply(scenegraph); - SbString s(buffer); - free(buffer); - - int pos; - SbString ss; - - SbList node_names(15); - if(j==1) - BOOST_CHECK_MESSAGE(dont_mangle_output_names(scenegraph)==TRUE,"don't mangle should be TRUE"); - else - BOOST_CHECK_MESSAGE(dont_mangle_output_names(scenegraph)==FALSE,"don't mangle should be FALSE"); - - if(dont_mangle_output_names(scenegraph)) { - node_names.append("_+0"); - node_names.append("_+0"); - node_names.append("_+1"); - node_names.append("MyName"); - node_names.append("MyName+2"); - node_names.append("MyName"); - node_names.append("_+3"); - node_names.append("MyName+4"); - node_names.append("MyName+2"); - node_names.append("MyName+2"); - node_names.append("MyName+5"); - node_names.append("MyName+5"); - node_names.append("_+6"); - node_names.append("_+7"); - node_names.append("MyName+8"); - node_names.append("MyName+8"); - node_names.append("MyName+9"); - node_names.append("MyName+5"); - } - else { - node_names.append("_+0"); - node_names.append("_+0"); - node_names.append("MyName"); - node_names.append("MyName+1"); - node_names.append("MyName"); - node_names.append("MyName+2"); - node_names.append("MyName+1"); - node_names.append("MyName+1"); - node_names.append("MyName+3"); - node_names.append("MyName+3"); - node_names.append("MyName+4"); - node_names.append("MyName+4"); - node_names.append("MyName+5"); - node_names.append("MyName+3"); - } - - int list_index = 0; - SbBool fail = false; - ss = s; - for(int i=0;iunref(); - newroot->unref(); -#endif - } - -#endif // COIN_TEST_SUITE /* *********************************************************************** */ diff --git a/src/misc/SoBaseP.cpp b/src/misc/SoBaseP.cpp index a3d8c0ee3d2..fae97b6a33d 100644 --- a/src/misc/SoBaseP.cpp +++ b/src/misc/SoBaseP.cpp @@ -579,64 +579,5 @@ SoBase::PImpl::flushInput(SoInput * in) // ************************************************************************* -#ifdef COIN_TEST_SUITE - -#include -#include -#include -#include -#include - -// Tests whether or not our mechanisms with the realTime field works -// correctly upon references to it in imported iv-files. -// -// (Added this test when it was suspected that a new realTime -// globalfield was made upon import due to bug(s) in -// SoBase::PImpl::readBaseInstance()). -// -// -mortene - -BOOST_AUTO_TEST_CASE(realTime_globalfield_import) -{ - // SoDB::init() already called by test-suite init, and the realTime - // global field will be set up there - - //Store away the state before we mess with the global realTime field - SoSFTime * realtime = (SoSFTime *)SoDB::getGlobalField("realTime"); - assert(realtime); - SbTime realTimeStorage = realtime->getValue(); - - char scene[] = - "#Inventor V2.1 ascii\n\n" - "RotationXYZ {" - " angle = GlobalField {" - " type \"SFTime\"" - " realTime 0" - " }" - " . realTime " - "}"; - - SoInput * in = new SoInput; - in->setBuffer(scene, strlen(scene)); - SoNode * g = NULL; - const SbBool readok = SoDB::read(in, g); - assert(readok); // that import is ok is tested by a case in SoDB.cpp - delete in; - - // check that the global field is still the same instance - SoSFTime * realtimeafter = (SoSFTime *)SoDB::getGlobalField("realTime"); - BOOST_CHECK_MESSAGE(realtime == realtimeafter, - "internal realTime SoGlobalField value changed upon iv import"); - - // clean up - g->ref(); - g->unref(); - - //Restore state - realtime->setValue(realTimeStorage); - -} - -#endif // COIN_TEST_SUITE // ************************************************************************* diff --git a/src/misc/SoDB.cpp b/src/misc/SoDB.cpp index 85238781028..34a5d8ba2cb 100644 --- a/src/misc/SoDB.cpp +++ b/src/misc/SoDB.cpp @@ -1685,217 +1685,3 @@ SoDB::removeRoute(SoNode * fromnode, const char * eventout, } /* *********************************************************************** */ - -#ifdef COIN_TEST_SUITE - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -BOOST_AUTO_TEST_CASE(globalRealTimeField) -{ - //Need to do this here, since we do not have any manager that calls it for us. - SoDB::getSensorManager()->processTimerQueue(); - SoSFTime * realtime = (SoSFTime *)SoDB::getGlobalField("realTime"); - - BOOST_REQUIRE(realtime != NULL); - BOOST_REQUIRE(realtime->getContainer() != NULL); - - // check that realtime field actually is initialized with something - // close to actual time - const double clockdiff = - fabs(SbTime::getTimeOfDay().getValue() - realtime->getValue().getValue()); - BOOST_CHECK_MESSAGE(clockdiff < 5.0, - "realTime global field not close to actual time"); -} - -// Do-nothing error handler for ignoring read errors while testing. -static void -readErrorHandler(const SoError * error, void * data) -{ -} - -#ifdef HAVE_VRML97 -BOOST_AUTO_TEST_CASE(readChildList) -{ - static const char scene[] = "#VRML V2.0 utf8\n" - "DEF TestGroup Group { children [Group{}, Group{}, Group{}] }"; - SoInput in; - in.setBuffer(scene, strlen(scene)); - SoSeparator * root = SoDB::readAll(&in); - BOOST_REQUIRE(root); - root->ref(); - SoGroup * group = (SoGroup *) SoNode::getByName("TestGroup"); - BOOST_REQUIRE_MESSAGE(group->getNumChildren() == 3, "Unexpected number of children"); - for (int i = 0; i < group->getNumChildren(); i++) { - BOOST_REQUIRE_MESSAGE(group->getChild(i)->isOfType(SoGroup::getClassTypeId()), "Unexpected type"); - } - root->unref(); -} -#endif - -BOOST_AUTO_TEST_CASE(readEmptyChildList) -{ - // FIXME: We are forced to restore the global state before terminating, - // or independent tests could fail. (sveinung 20071108) - SoErrorCB * prevErrorCB = SoReadError::getHandlerCallback(); - SoReadError::setHandlerCallback(readErrorHandler, NULL); - - static const char scene[] = "#VRML V2.0 utf8\n" - "DEF TestGroup Group { children }"; - SoInput in; - in.setBuffer(scene, strlen(scene)); - SoSeparator * root = SoDB::readAll(&in); - if (root) { - SoGroup * group = (SoGroup *) SoNode::getByName("TestGroup"); - BOOST_CHECK_MESSAGE(group->getNumChildren() == 0, "Should have no children"); - } - BOOST_CHECK_MESSAGE(root == NULL, "Expected the import to fail"); - - SoReadError::setHandlerCallback(prevErrorCB, NULL); -} - -BOOST_AUTO_TEST_CASE(readNullChildList) -{ - // FIXME: We are forced to restore the global state before terminating, - // or independent tests could fail. (sveinung 20071108) - SoErrorCB * prevErrorCB = SoReadError::getHandlerCallback(); - SoReadError::setHandlerCallback(readErrorHandler, NULL); - - static const char scene[] = "#VRML V2.0 utf8\n" - "PROTO Object [ field MFNode testChildren NULL ] { }\n" - "DEF TestObject Object { }"; - SoInput in; - in.setBuffer(scene, strlen(scene)); - SoSeparator * root = SoDB::readAll(&in); - if (root) { - SoNode * object = (SoNode *) SoNode::getByName("TestObject"); - SoMFNode * field = (SoMFNode *) object->getField("testChildren"); - BOOST_CHECK_MESSAGE(field->getNumNodes() == 0, "Should have no children"); - } - BOOST_CHECK_MESSAGE(root == NULL, "Expected the import to fail"); - - SoReadError::setHandlerCallback(prevErrorCB, NULL); -} - -BOOST_AUTO_TEST_CASE(readInvalidChildList) -{ - // FIXME: We are forced to restore the global state before terminating, - // or independent tests could fail. (sveinung 20071108) - SoErrorCB * prevErrorCB = SoReadError::getHandlerCallback(); - SoReadError::setHandlerCallback(readErrorHandler, NULL); - - static const char scene[] = "#VRML V2.0 utf8\n" - "Group { children[0] }"; - SoInput in; - in.setBuffer(scene, strlen(scene)); - SoSeparator * root = SoDB::readAll(&in); - BOOST_CHECK_MESSAGE(root == NULL, "Expected the import to fail"); - - SoReadError::setHandlerCallback(prevErrorCB, NULL); -} - -BOOST_AUTO_TEST_CASE(testAlternateRepNull) -{ - // FIXME: We are forced to restore the global state before terminating, - // or independent tests could fail. (sveinung 20071108) - SoErrorCB * prevErrorCB = SoReadError::getHandlerCallback(); - SoReadError::setHandlerCallback(readErrorHandler, NULL); - - static const char scene[] = "#Inventor V2.1 ascii\n" - "ExtensionNode { fields [ SFNode alternateRep ] }"; - SoInput in; - in.setBuffer(scene, strlen(scene)); - SoSeparator * root = SoDB::readAll(&in); - BOOST_CHECK_MESSAGE(root, "Import should succeed"); - root->ref(); - root->unref(); - - SoReadError::setHandlerCallback(prevErrorCB, NULL); -} - -BOOST_AUTO_TEST_CASE(testInitCleanup) -{ - // init already called - SoDB::finish(); - - SoDB::init(); - SoDB::finish(); - - - //FIXME: This is not a true unittest, as it touches state for other functions. - // init for the conntinuing test running - SoDB::init(); - SoNodeKit::init(); - SoInteraction::init(); - SIM::Coin3D::Coin::TestSuite::Init(); - -} - -// ************************************************************************* - -// Tests whether or not our mechanisms with the realTime global field -// works correctly upon references to it in imported iv-files. -// -// (This test might be better suited in the SoGlobalField.cpp file, -// but that code doesn't implement a public API part, which causes -// hickups for the automated test-suite code-grabbing & setup.) -// -// -mortene - -BOOST_AUTO_TEST_CASE(globalfield_import) -{ - char scene[] = - "#Inventor V2.1 ascii\n\n" - "DEF rotnode RotationXYZ {" - " angle = GlobalField {" - " type \"SFTime\"" - " realTime 0" - " }" - " . realTime " - "}"; - - SoInput * in = new SoInput; - in->setBuffer(scene, strlen(scene)); - SoNode * g = NULL; - const SbBool readok = SoDB::read(in, g); - - delete in; - - // just to see that we're correct with the syntax - BOOST_CHECK_MESSAGE(readok, - "failed to read scene graph with realTime global field"); - if (!readok) { return; } - - g->ref(); - - SoSFTime * realtime = (SoSFTime *)SoDB::getGlobalField("realTime"); - - // supposed to get new value from file - BOOST_CHECK_MESSAGE(realtime->getValue().getValue() == 0.0, - "realTime global field value not updated from imported value"); - - SoRotationXYZ * r = (SoRotationXYZ *) - SoBase::getNamedBase("rotnode", SoRotationXYZ::getClassTypeId()); - assert(r); - - // check connection - SoField * master; - BOOST_CHECK_MESSAGE((r->angle.getNumConnections() == 1) && - r->angle.getConnectedField(master) && - (master == realtime), - "connection to realTime global field not set up properly"); - - g->unref(); -} - -// ************************************************************************* - -#endif // COIN_TEST_SUITE diff --git a/src/misc/SoType.cpp b/src/misc/SoType.cpp index b40c7b07610..30792d103e6 100644 --- a/src/misc/SoType.cpp +++ b/src/misc/SoType.cpp @@ -962,29 +962,3 @@ SoType::isInternal(void) const Comparison operator for sorting type data according to some internal criterion. */ - -#ifdef COIN_TEST_SUITE -#include -#include -#include - -static void * createInstance(void) -{ - return (void *)0x1234; -} - -BOOST_AUTO_TEST_CASE(testRemoveType) -{ - BOOST_CHECK_MESSAGE(SoType::fromName(SbName("MyClass")) == SoType::badType(), - "Type didn't init to badType"); - SoType newtype = SoType::createType(SoNode::getClassTypeId(), SbName("MyClass"), createInstance, 0); - BOOST_CHECK_MESSAGE(SoType::fromName(SbName("MyClass")) != SoType::badType(), - "Type didn't init correctly"); - bool success = SoType::removeType(SbName("MyClass")); - BOOST_CHECK_MESSAGE(success, - "removeType() failed"); - BOOST_CHECK_MESSAGE(SoType::fromName(SbName("MyClass")) == SoType::badType(), - "Type didn't deregister correctly"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/nodes/SoAnnotation.cpp b/src/nodes/SoAnnotation.cpp index ae41b481d77..295c859509d 100644 --- a/src/nodes/SoAnnotation.cpp +++ b/src/nodes/SoAnnotation.cpp @@ -153,17 +153,3 @@ SoAnnotation::GLRenderOffPath(SoGLRenderAction *) { // should never render, this is a separator node } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoAnnotation * node = new SoAnnotation; - assert(node); - node->ref(); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "missing class initialization"); - node->unref(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/scxml/SbStringConvert.cpp b/src/scxml/SbStringConvert.cpp index d4f44a0da5f..c076d4df219 100644 --- a/src/scxml/SbStringConvert.cpp +++ b/src/scxml/SbStringConvert.cpp @@ -79,116 +79,3 @@ SbStringConvert::typeOf(const SbString & str) } return UNKNOWN; } - -#ifdef COIN_TEST_SUITE -#ifdef COIN_INT_TEST_SUITE -#include -#include -#include - -BOOST_AUTO_TEST_CASE(SbVec3sfromString) { - typedef SbVec3s ToTest; - ToTest foo; - SbString test = "SbVec3s(1,-2,3)"; - ToTest trueVal(1,-2,3); - foo = SbStringConvert::fromString(test); - BOOST_CHECK_MESSAGE(trueVal == foo, - std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); -} - -BOOST_AUTO_TEST_CASE(SbVec3sToString) { - typedef SbVec3s ToTest; - SbString foo; - ToTest test(1,-2,3); - SbString trueVal = "SbVec3s(1, -2, 3)"; - foo = SbStringConvert::toString(test); - BOOST_CHECK_MESSAGE(trueVal == foo, - std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); -} - -BOOST_AUTO_TEST_CASE(SbVec3sfromSbVec3f) { - typedef SbVec3s ToTest; - ToTest foo; - SbString test = "SbVec3f(1,-2,3)"; - ToTest trueVal(1,-2,3); - SbBool conversionOk = TRUE; - foo = SbStringConvert::fromString(test, &conversionOk); - BOOST_CHECK_MESSAGE(conversionOk == FALSE, - std::string("Able to create SbVec3s from ") + test.getString()); -} - -BOOST_AUTO_TEST_CASE(SbVec3fToString) { - typedef SbVec3f ToTest; - SbString foo; - ToTest test(0.5,-0.25,0.125); - SbString trueVal = "SbVec3f(0.5, -0.25, 0.125)"; - foo = SbStringConvert::toString(test); - BOOST_CHECK_MESSAGE(trueVal == foo, - std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); -} - -BOOST_AUTO_TEST_CASE(SbVec3fToIntString) { - typedef SbVec3f ToTest; - SbString foo; - ToTest test(1,-2,3); - SbString trueVal = "SbVec3f(1, -2, 3)"; - foo = SbStringConvert::toString(test); - BOOST_CHECK_MESSAGE(trueVal == foo, - std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); -} - -BOOST_AUTO_TEST_CASE(SbVec3fFromIntString) { - typedef SbVec3f ToTest; - ToTest foo; - SbString test = "SbVec3f(1,-2,3)"; - ToTest trueVal(1,-2,3); - SbBool conversionOk = TRUE; - foo = SbStringConvert::fromString(test, &conversionOk); - BOOST_CHECK_MESSAGE(conversionOk && trueVal == foo, - std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); -} - -BOOST_AUTO_TEST_CASE(SbVec3fFromFloatString) { - typedef SbVec3f ToTest; - ToTest foo; - SbString test = "SbVec3f( 1.3 , -2.0 , 3.3 )"; - ToTest trueVal(1.3,-2.0,3.3); - SbBool conversionOk = TRUE; - foo = SbStringConvert::fromString(test, &conversionOk); - BOOST_CHECK_MESSAGE(conversionOk && trueVal == foo, - std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); -} - -BOOST_AUTO_TEST_CASE(SbRotationFromString) { - typedef SbRotation ToTest; - ToTest foo; - SbString test = "SbRotation(0.5,0.5 , 0.5, 0.5 )"; - ToTest trueVal(0.5,0.5,0.5,0.5); - SbBool conversionOk = FALSE; - foo = SbStringConvert::fromString(test, &conversionOk); - BOOST_CHECK_MESSAGE(conversionOk && trueVal == foo, - std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); -} - -BOOST_AUTO_TEST_CASE(SbRotationToString) { - typedef SbRotation ToTest; - SbString foo; - ToTest test(0.5,-0.5,-0.5,0.5); - SbString trueVal = "SbRotation(0.5, -0.5, -0.5, 0.5)"; - foo = SbStringConvert::toString(test); - BOOST_CHECK_MESSAGE(trueVal == foo, - std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); -} - -BOOST_AUTO_TEST_CASE(SbRotationToIntString) { - typedef SbRotation ToTest; - SbString foo; - ToTest test(0,0,0,1); - SbString trueVal = "SbRotation(0, 0, 0, 1)"; - foo = SbStringConvert::toString(test); - BOOST_CHECK_MESSAGE(trueVal == foo, - std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); -} - -#endif //COIN_INT_TESTSUITE -#endif //COIN_TEST_SUITE diff --git a/src/scxml/ScXMLMinimumEvaluator.cpp b/src/scxml/ScXMLMinimumEvaluator.cpp index 47adced6077..8c334657eac 100644 --- a/src/scxml/ScXMLMinimumEvaluator.cpp +++ b/src/scxml/ScXMLMinimumEvaluator.cpp @@ -348,47 +348,3 @@ ScXMLAppendOpExprDataObj::evaluateNow(ScXMLStateMachine * sm, ScXMLDataObj *& po pointer = new ScXMLStringDataObj(string.get()); return TRUE; } - -#ifdef COIN_TEST_SUITE - -#include -#include - -#include -#include -#include -#include -#include -#include - -BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(MimimumExpressions,1); - -BOOST_AUTO_TEST_CASE(MimimumExpressions) -{ - std::unique_ptr sm(new ScXMLStateMachine); - std::unique_ptr evaluator(new ScXMLMinimumEvaluator); - - ScXMLDataObj * res = NULL; - ScXMLBoolDataObj * boolobj = NULL; - - //FIXME, this test is not finished. BFG 20090831 - - static const char foo [] = - ""; - /* - ScXMLDocument * doc = ScXMLDocument::readBuffer(SbByteBuffer(sizeof(foo),foo)); - assert(doc->getRoot()); - sm->setDescription(doc); - sm->setName(""); - sm->initialize(); - assert(sm->isActive() && !sm->isFinished()); - printf("%d\n", sm->getNumActiveStates()); - const ScXMLElt * elt = sm->getActiveState(0); - printf("%s\n",elt->getXMLAttribute("id")); - evaluator->setStateMachine(sm.get()); - res = evaluator->evaluate("In('active')"); - */ - -} - -#endif // !COIN_TEST_SUITE diff --git a/src/shaders/SoFragmentShader.cpp b/src/shaders/SoFragmentShader.cpp index 35a11eaae62..7a7240ddcc3 100644 --- a/src/shaders/SoFragmentShader.cpp +++ b/src/shaders/SoFragmentShader.cpp @@ -127,17 +127,3 @@ SoFragmentShader::isSupported(SourceType sourceType) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoFragmentShader * node = new SoFragmentShader; - assert(node); - node->ref(); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "missing class initialization"); - node->unref(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/shaders/SoGeometryShader.cpp b/src/shaders/SoGeometryShader.cpp index d3b6cbec82b..4708dacaadb 100644 --- a/src/shaders/SoGeometryShader.cpp +++ b/src/shaders/SoGeometryShader.cpp @@ -279,17 +279,3 @@ SoGeometryShader::isSupported(SourceType sourceType) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoGeometryShader * node = new SoGeometryShader; - assert(node); - node->ref(); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "missing class initialization"); - node->unref(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/shaders/SoShaderParameter.cpp b/src/shaders/SoShaderParameter.cpp index 8b9f6fb55e0..39091f50f4f 100644 --- a/src/shaders/SoShaderParameter.cpp +++ b/src/shaders/SoShaderParameter.cpp @@ -1331,166 +1331,3 @@ SoShaderParameterArray4i::updateParameter(SoGLShaderObject *shader) #undef PRIVATE // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - { - SoShaderParameter1f * parameter1f = new SoShaderParameter1f; - assert(parameter1f); - parameter1f->ref(); - BOOST_CHECK_MESSAGE(parameter1f->getTypeId() != SoType::badType(), - "missing class initialization"); - parameter1f->unref(); - } - { - SoShaderParameter1i * parameter1i = new SoShaderParameter1i; - assert(parameter1i); - parameter1i->ref(); - BOOST_CHECK_MESSAGE(parameter1i->getTypeId() != SoType::badType(), - "missing class initialization"); - parameter1i->unref(); - } - { - SoShaderParameter2f * parameter2f = new SoShaderParameter2f; - assert(parameter2f); - parameter2f->ref(); - BOOST_CHECK_MESSAGE(parameter2f->getTypeId() != SoType::badType(), - "missing class initialization"); - parameter2f->unref(); - } - { - SoShaderParameter2i * parameter2i = new SoShaderParameter2i; - assert(parameter2i); - parameter2i->ref(); - BOOST_CHECK_MESSAGE(parameter2i->getTypeId() != SoType::badType(), - "missing class initialization"); - parameter2i->unref(); - } - { - SoShaderParameter3f * parameter3f = new SoShaderParameter3f; - assert(parameter3f); - parameter3f->ref(); - BOOST_CHECK_MESSAGE(parameter3f->getTypeId() != SoType::badType(), - "missing class initialization"); - parameter3f->unref(); - } - { - SoShaderParameter3i * parameter3i = new SoShaderParameter3i; - assert(parameter3i); - parameter3i->ref(); - BOOST_CHECK_MESSAGE(parameter3i->getTypeId() != SoType::badType(), - "missing class initialization"); - parameter3i->unref(); - } - { - SoShaderParameter4f * parameter4f = new SoShaderParameter4f; - assert(parameter4f); - parameter4f->ref(); - BOOST_CHECK_MESSAGE(parameter4f->getTypeId() != SoType::badType(), - "missing class initialization"); - parameter4f->unref(); - } - { - SoShaderParameter4i * parameter4i = new SoShaderParameter4i; - assert(parameter4i); - parameter4i->ref(); - BOOST_CHECK_MESSAGE(parameter4i->getTypeId() != SoType::badType(), - "missing class initialization"); - parameter4i->unref(); - } - - { - SoShaderParameterArray1f * parametera1f = new SoShaderParameterArray1f; - assert(parametera1f); - parametera1f->ref(); - BOOST_CHECK_MESSAGE(parametera1f->getTypeId() != SoType::badType(), - "missing class initialization"); - parametera1f->unref(); - } - { - SoShaderParameterArray1i * parametera1i = new SoShaderParameterArray1i; - assert(parametera1i); - parametera1i->ref(); - BOOST_CHECK_MESSAGE(parametera1i->getTypeId() != SoType::badType(), - "missing class initialization"); - parametera1i->unref(); - } - { - SoShaderParameterArray2f * parametera2f = new SoShaderParameterArray2f; - assert(parametera2f); - parametera2f->ref(); - BOOST_CHECK_MESSAGE(parametera2f->getTypeId() != SoType::badType(), - "missing class initialization"); - parametera2f->unref(); - } - { - SoShaderParameterArray2i * parametera2i = new SoShaderParameterArray2i; - assert(parametera2i); - parametera2i->ref(); - BOOST_CHECK_MESSAGE(parametera2i->getTypeId() != SoType::badType(), - "missing class initialization"); - parametera2i->unref(); - } - { - SoShaderParameterArray3f * parametera3f = new SoShaderParameterArray3f; - assert(parametera3f); - parametera3f->ref(); - BOOST_CHECK_MESSAGE(parametera3f->getTypeId() != SoType::badType(), - "missing class initialization"); - parametera3f->unref(); - } - { - SoShaderParameterArray3i * parametera3i = new SoShaderParameterArray3i; - assert(parametera3i); - parametera3i->ref(); - BOOST_CHECK_MESSAGE(parametera3i->getTypeId() != SoType::badType(), - "missing class initialization"); - parametera3i->unref(); - } - { - SoShaderParameterArray4f * parametera4f = new SoShaderParameterArray4f; - assert(parametera4f); - parametera4f->ref(); - BOOST_CHECK_MESSAGE(parametera4f->getTypeId() != SoType::badType(), - "missing class initialization"); - parametera4f->unref(); - } - { - SoShaderParameterArray4i * parametera4i = new SoShaderParameterArray4i; - assert(parametera4i); - parametera4i->ref(); - BOOST_CHECK_MESSAGE(parametera4i->getTypeId() != SoType::badType(), - "missing class initialization"); - parametera4i->unref(); - } - - { - SoShaderParameterMatrix * matrix = new SoShaderParameterMatrix; - assert(matrix); - matrix->ref(); - BOOST_CHECK_MESSAGE(matrix->getTypeId() != SoType::badType(), - "missing class initialization"); - matrix->unref(); - } - { - SoShaderParameterMatrixArray * matrixarray = new SoShaderParameterMatrixArray; - assert(matrixarray); - matrixarray->ref(); - BOOST_CHECK_MESSAGE(matrixarray->getTypeId() != SoType::badType(), - "missing class initialization"); - matrixarray->unref(); - } - - { - SoShaderStateMatrixParameter * statematrix = new SoShaderStateMatrixParameter; - assert(statematrix); - statematrix->ref(); - BOOST_CHECK_MESSAGE(statematrix->getTypeId() != SoType::badType(), - "missing class initialization"); - statematrix->unref(); - } -} - -#endif // COIN_TEST_SUITE diff --git a/src/shaders/SoShaderProgram.cpp b/src/shaders/SoShaderProgram.cpp index 85e17797523..35f566abc25 100644 --- a/src/shaders/SoShaderProgram.cpp +++ b/src/shaders/SoShaderProgram.cpp @@ -405,17 +405,3 @@ SoShaderProgramP::sensorCB(void * COIN_UNUSED_ARG(data), SoSensor *) #undef PUBLIC // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoShaderProgram * node = new SoShaderProgram; - assert(node); - node->ref(); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "missing class initialization"); - node->unref(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/shaders/SoVertexShader.cpp b/src/shaders/SoVertexShader.cpp index 50b9a13242c..150e4559b89 100644 --- a/src/shaders/SoVertexShader.cpp +++ b/src/shaders/SoVertexShader.cpp @@ -123,17 +123,3 @@ SoVertexShader::isSupported(SourceType sourceType) return FALSE; } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoVertexShader * node = new SoVertexShader; - assert(node); - node->ref(); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "missing class initialization"); - node->unref(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/shadows/SoGLShadowCullingElement.cpp b/src/shadows/SoGLShadowCullingElement.cpp index 71b5bd4a1da..1ec2955c570 100644 --- a/src/shadows/SoGLShadowCullingElement.cpp +++ b/src/shadows/SoGLShadowCullingElement.cpp @@ -140,14 +140,3 @@ SoGLShadowCullingElement::updateGL(int32_t COIN_UNUSED_ARG(oldvalue), int32_t CO { // nothing to do yet. We might support more culling modes in the future though } - - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - BOOST_CHECK_MESSAGE(SoGLShadowCullingElement::getClassStackIndex() != -1, - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/shadows/SoShadowCulling.cpp b/src/shadows/SoShadowCulling.cpp index 739dbe772c0..f7d222cd3f7 100644 --- a/src/shadows/SoShadowCulling.cpp +++ b/src/shadows/SoShadowCulling.cpp @@ -148,18 +148,3 @@ SoShadowCulling::GLRender(SoGLRenderAction * action) } } } - - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoShadowCulling * node = new SoShadowCulling; - assert(node); - node->ref(); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "missing class initialization"); - node->unref(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/shadows/SoShadowDirectionalLight.cpp b/src/shadows/SoShadowDirectionalLight.cpp index 33794c4cfd2..44a95f3790b 100644 --- a/src/shadows/SoShadowDirectionalLight.cpp +++ b/src/shadows/SoShadowDirectionalLight.cpp @@ -179,17 +179,3 @@ SoShadowDirectionalLight::GLRender(SoGLRenderAction * action) { inherited::GLRender(action); } - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoShadowDirectionalLight * node = new SoShadowDirectionalLight; - assert(node); - node->ref(); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "missing class initialization"); - node->unref(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/shadows/SoShadowGroup.cpp b/src/shadows/SoShadowGroup.cpp index 524910f448f..4bae70ed560 100644 --- a/src/shadows/SoShadowGroup.cpp +++ b/src/shadows/SoShadowGroup.cpp @@ -2347,17 +2347,3 @@ SoShadowLightCache::shadowmap_post_glcallback(void * COIN_UNUSED_ARG(closure), S #undef PUBLIC #undef DISTRIBUTE_FACTOR #undef USE_NEGATIVE - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoShadowGroup * node = new SoShadowGroup; - assert(node); - node->ref(); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "missing class initialization"); - node->unref(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/shadows/SoShadowSpotLight.cpp b/src/shadows/SoShadowSpotLight.cpp index 505c44ef009..2723d886673 100644 --- a/src/shadows/SoShadowSpotLight.cpp +++ b/src/shadows/SoShadowSpotLight.cpp @@ -185,19 +185,3 @@ SoShadowSpotLight::GLRender(SoGLRenderAction * action) { inherited::GLRender(action); } - - - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoShadowSpotLight * node = new SoShadowSpotLight; - assert(node); - node->ref(); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "missing class initialization"); - node->unref(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/shadows/SoShadowStyle.cpp b/src/shadows/SoShadowStyle.cpp index df7f758f23e..210260143ac 100644 --- a/src/shadows/SoShadowStyle.cpp +++ b/src/shadows/SoShadowStyle.cpp @@ -151,19 +151,3 @@ SoShadowStyle::GLRender(SoGLRenderAction * action) } } } - - - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - SoShadowStyle * node = new SoShadowStyle; - assert(node); - node->ref(); - BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), - "missing class initialization"); - node->unref(); -} - -#endif // COIN_TEST_SUITE diff --git a/src/shadows/SoShadowStyleElement.cpp b/src/shadows/SoShadowStyleElement.cpp index 160e8c3c3eb..095513fe75c 100644 --- a/src/shadows/SoShadowStyleElement.cpp +++ b/src/shadows/SoShadowStyleElement.cpp @@ -110,14 +110,3 @@ SoShadowStyleElement::getDefault(void) { return CASTS_SHADOW_AND_SHADOWED; } - - -#ifdef COIN_TEST_SUITE - -BOOST_AUTO_TEST_CASE(initialized) -{ - BOOST_CHECK_MESSAGE(SoShadowStyleElement::getClassStackIndex() != -1, - "missing class initialization"); -} - -#endif // COIN_TEST_SUITE diff --git a/src/soscxml/ScXMLCoinEvaluator.cpp b/src/soscxml/ScXMLCoinEvaluator.cpp index 59db5aa06bf..11af78db5d3 100644 --- a/src/soscxml/ScXMLCoinEvaluator.cpp +++ b/src/soscxml/ScXMLCoinEvaluator.cpp @@ -692,83 +692,3 @@ ScXMLCoinLengthFuncExprDataObj::evaluateNow(ScXMLStateMachine * sm, ScXMLDataObj return FALSE; } - -#ifdef COIN_TEST_SUITE - -// FIXME: this is no longer possible in the MinimumEvaluator - move testcase to -// the CoinEvaluator. - -#include -#include - -#include - -template -struct DataObjDemangler { -}; - -template<> -struct DataObjDemangler { - typedef double RET_VAL; - static RET_VAL getValue(ScXMLRealDataObj * obj) { - return obj->getReal(); - } -}; - -template<> -struct DataObjDemangler { - typedef bool RET_VAL; - static RET_VAL getValue(ScXMLBoolDataObj * obj) { - return obj->getBool(); - } -}; - -#define COIN_REQUIRE_MESSAGE( P , M) \ - BOOST_REQUIRE_MESSAGE(P , M); \ - if (!(P)) \ - return false; - - -template -bool -TestReturnValue(const std::string & evaluationString, typename DataObjDemangler< EXPECTED_TYPE >::RET_VAL retVal, ScXMLEvaluator * evaluator) -{ - ScXMLDataObj * res = NULL; - - res = evaluator->evaluate(evaluationString.c_str()); - COIN_REQUIRE_MESSAGE(res != NULL, std::string("Evaluation returned nothing for expression: ") + evaluationString); - //FIXME: Should really remember to delete res before returning from this point on, - //but don't bother about a memory leak when there are bigger fish to - //fry. 20090613 BFG - COIN_REQUIRE_MESSAGE(res->getTypeId() == EXPECTED_TYPE::getClassTypeId(), std::string("The type returned was incorrect for expression: ") + evaluationString); - EXPECTED_TYPE * obj = static_cast(res); - COIN_REQUIRE_MESSAGE(DataObjDemangler::getValue(obj) == retVal, std::string("Return value mismatch for expression: ") + evaluationString); - - delete res; - return true; -} - - -BOOST_AUTO_TEST_CASE(BasicExpressions) -{ - std::unique_ptr sm(new ScXMLStateMachine); - std::unique_ptr evaluator(new ScXMLCoinEvaluator); - evaluator->setStateMachine(sm.get()); - - TestReturnValue("M_PI",M_PI,evaluator.get()); - TestReturnValue("5.0",5.0,evaluator.get()); - TestReturnValue("5 + 5",10.0,evaluator.get()); - TestReturnValue("5 - 4",1.0,evaluator.get()); - TestReturnValue("5 * 4",20.0,evaluator.get()); - TestReturnValue("5 / 4",1.25,evaluator.get()); - TestReturnValue("-5",-5.0,evaluator.get()); - - TestReturnValue("True",TRUE,evaluator.get()); - TestReturnValue("false",FALSE,evaluator.get()); - TestReturnValue("!false",TRUE,evaluator.get()); - TestReturnValue("M_PI != M_LN2",TRUE,evaluator.get()); - TestReturnValue("M_PI == M_LN2",FALSE,evaluator.get()); - TestReturnValue("false && !false",FALSE,evaluator.get()); -} - -#endif // !COIN_TEST_SUITE diff --git a/src/xml/document.cpp b/src/xml/document.cpp index 56f79f87b5e..5877c25a44a 100644 --- a/src/xml/document.cpp +++ b/src/xml/document.cpp @@ -875,38 +875,3 @@ cc_xml_doc_handle_parse_warning(const cc_xml_doc * doc, const char * message) } // ************************************************************************* - -#ifdef COIN_TEST_SUITE - -#include -#include -#include - -BOOST_AUTO_TEST_CASE(bufread) -{ - const char * buffer = -"\n\n" -"\n" -" hei\n" -"\n"; - cc_xml_doc * doc1 = cc_xml_read_buffer(buffer); - BOOST_CHECK_MESSAGE(doc1 != NULL, "cc_xml_doc_read_buffer() failed"); - - std::unique_ptr buffer2; - size_t bytecount = 0; - { - char * bufptr = NULL; - cc_xml_doc_write_to_buffer(doc1, bufptr, bytecount); - buffer2.reset(bufptr); - } - - cc_xml_doc * doc2 = cc_xml_read_buffer(buffer2.get()); - - cc_xml_path * diffpath = cc_xml_doc_diff(doc1, doc2); - BOOST_CHECK_MESSAGE(diffpath == NULL, "document read->write->read DOM differences"); - - cc_xml_doc_delete_x(doc1); - cc_xml_doc_delete_x(doc2); -} - -#endif // !COIN_TEST_SUITE diff --git a/testsuite/CMakeLists.txt b/testsuite/CMakeLists.txt index e7861f4359e..7fa4c411528 100644 --- a/testsuite/CMakeLists.txt +++ b/testsuite/CMakeLists.txt @@ -1,27 +1,3 @@ -macro(create_testsuite input) - get_filename_component(FLNAME "${input}" NAME_WE) - get_filename_component(FLPATH "${input}" PATH) - string(REGEX REPLACE ".*[/\\]" "" FLSUBFLD "${FLPATH}") - set(COIN_STR_TEST_CLASS "${FLNAME}") - file(READ ${PROJECT_SOURCE_DIR}/${input} f0) - if(f0 MATCHES "#ifdef[ \t]+COIN_TEST_SUITE") - # message(STATUS "Parse: ${PROJECT_SOURCE_DIR}/${input} - ${FLPATHSUB}${FLNAME}Test.cpp") - # get first include from file, which we assume is include to tested class - string(REGEX MATCH "[\n\r]+#include[ \t]<[^\n]+" iclass "${f0}") - # get block between '#ifdef COIN_TEST_SUITE' and '#endif' - string(REGEX REPLACE ".*#ifdef[ \t]+COIN_TEST_SUITE" "" f1 "${f0}") - string(REGEX REPLACE "#endif[ \t/!]+COIN_TEST_SUITE.*" "" f2 "${f1}") - # get all #include statements within COIN_TEST_SUITE code block - string(REGEX MATCHALL "#include[ \t]<[^\n]+" i0 "${f2}") - string(REPLACE ";" "\n" COIN_STR_TEST_INCL "${i0}") - set(COIN_STR_TEST_INCL "${iclass}\n${COIN_STR_TEST_INCL}") - # remove #include statements from test code string (moved to ${COIN_STR_TEST_INCL}) - string(REGEX REPLACE "[\n\r ]*#include[ \t]<[^\n]+" "" COIN_STR_TEST_CODE "${f2}") - # generate new test code file with extracted snippets - configure_file(TestSuiteTemplate.cmake.in "${FLSUBFLD}${FLNAME}Test.cpp") - endif() -endmacro() - macro(create_file_test input testfunc filter) file(GLOB_RECURSE COIN_IV_FILES RELATIVE ${PROJECT_SOURCE_DIR} ../${input}/*.iv @@ -55,13 +31,6 @@ macro(create_file_test input testfunc filter) configure_file(TestSuiteTemplate.cmake.in "${TESTSUITENAME}Test.cpp") endmacro() -# Parse all source files for embedded '#ifdef COIN_TEST_SUITE' and extract those blocks -# to separate test source files. -file(GLOB_RECURSE COIN_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/src/*.cpp) -foreach(INPUTFILE ${COIN_SRC_FILES}) - create_testsuite(${INPUTFILE}) -endforeach() - # Create test cases for all scenes under models folder (this replaces StandardTests.cpp). # The original StandardTests.cpp also tested additional folders: # - "killers" with testInCorrectFile @@ -71,8 +40,15 @@ create_file_test("models" "testCorrectFile" false "incorrect") # bug039.iv and bug055-5.iv contain errors but load anyway: ignore for now create_file_test("models/io/incorrect" "testIncorrectFile" true "(bug039|bug055-5)") -# Include all extracted '*Tests.cpp' files in the target. -FILE(GLOB COIN_TEST_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/*Test.cpp") +# Include generated model tests and standalone component tests in the target. +set(COIN_TEST_SOURCES + "${CMAKE_CURRENT_BINARY_DIR}/modelsTest.cpp" + "${CMAKE_CURRENT_BINARY_DIR}/modelsioincorrectTest.cpp" +) +FILE(GLOB_RECURSE COIN_STANDALONE_TEST_SOURCES + "${CMAKE_CURRENT_SOURCE_DIR}/*Test.cpp" +) +LIST(APPEND COIN_TEST_SOURCES ${COIN_STANDALONE_TEST_SOURCES}) add_executable(CoinTests TestSuiteMain.cpp TestSuiteUtils.cpp TestSuiteMisc.cpp ${COIN_TEST_SOURCES}) set_target_properties(CoinTests PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}") @@ -81,7 +57,9 @@ target_include_directories(CoinTests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/include/Inventor/annex + ${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/include + ${PROJECT_BINARY_DIR}/src ${COIN_TARGET_INCLUDE_DIRECTORIES} ) if (USE_PTHREAD) diff --git a/testsuite/actions/SoCallbackActionTest.cpp b/testsuite/actions/SoCallbackActionTest.cpp new file mode 100644 index 00000000000..055f392d074 --- /dev/null +++ b/testsuite/actions/SoCallbackActionTest.cpp @@ -0,0 +1,95 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + + +#include +#include +#include +BOOST_AUTO_TEST_SUITE(SoCallbackAction_TestSuite); + + +static SoCallbackAction::Response +preCB(void * userdata, SoCallbackAction *, const SoNode * node) +{ + SbString *str = (SbString *)userdata; + (*str) += node->getName(); + return SoCallbackAction::CONTINUE; +} + +BOOST_AUTO_TEST_CASE(callbackall) +{ + SbString str; + SoSwitch * sw = new SoSwitch; + sw->setName("switch"); + SoCube * cube = new SoCube; + cube->setName("cube"); + sw->addChild(cube); + sw->ref(); + + SoCallbackAction cba; + cba.addPreCallback(SoNode::getClassTypeId(), preCB, &str); + cba.apply(sw); + BOOST_CHECK_MESSAGE(str == "switch", "Should not traverse under switch node"); + + str = ""; + cba.setCallbackAll(true); + cba.apply(sw); + BOOST_CHECK_MESSAGE(str == "switchcube", "Should traverse under switch node"); + + sw->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/actions/SoWriteActionTest.cpp b/testsuite/actions/SoWriteActionTest.cpp new file mode 100644 index 00000000000..8784336cc2a --- /dev/null +++ b/testsuite/actions/SoWriteActionTest.cpp @@ -0,0 +1,135 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +#include +#include +#include +#include +#include +BOOST_AUTO_TEST_SUITE(SoWriteAction_TestSuite); + + +// check that the realTime GlobalField is written if it has any +// forward connections. + +BOOST_AUTO_TEST_CASE(GlobalField) +{ + SoDB::init(); + + //Store away the state before we mess with the global realTime field + SoSFTime * realtime = static_cast(SoDB::getGlobalField("realTime")); + assert(realtime); + SbTime realTimeStorage = realtime->getValue(); + + static const char inlinescenegraph[] = + "#Inventor V2.1 ascii\n" + "\n" + "\n" + "Separator {\n" + "\n" + " Text2 { \n" + " string \"\" = GlobalField { \n" + " type \"SFTime\" realTime 0 \n" + "\n" + " } . realTime \n" + " }\n" + "}\n"; + + // read scene + SoInput in; + in.setBuffer(inlinescenegraph, strlen(inlinescenegraph)); + SoSeparator * top = SoDB::readAll(&in); + BOOST_REQUIRE(top); + top->ref(); + + // write scene + SoOutput out; + const int buffer_size = 1024; + char * buffer = (char *)malloc(buffer_size); + out.setBuffer(buffer, buffer_size, NULL); + + SoWriteAction wa(&out); + wa.apply((SoNode *)top); + + top->unref(); + top = NULL; + + // read scene again to check if realTime field was written + in.setBuffer(buffer, strlen(buffer)); + top = SoDB::readAll(&in); + BOOST_REQUIRE(top); + top->ref(); + + SoText2 * text = (SoText2 *)top->getChild(0); + BOOST_REQUIRE(text); + + SoField * string = text->getField("string"); + BOOST_REQUIRE(string); + BOOST_CHECK_MESSAGE(string->isConnected(), "String field not connected to realTime field in written scene graph"); + + free(buffer); + + top->unref(); + + //Restore state + realtime->setValue(realTimeStorage); + +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbBSPTreeTest.cpp b/testsuite/base/SbBSPTreeTest.cpp new file mode 100644 index 00000000000..6b94240b6fb --- /dev/null +++ b/testsuite/base/SbBSPTreeTest.cpp @@ -0,0 +1,103 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SbBSPTree_TestSuite); + + +BOOST_AUTO_TEST_CASE(SbBSPTree_initialized) +{ + SbBSPTree bsp; + SbVec3f p0(0.0f, 0.0f, 0.0f); + SbVec3f p1(1.0f, 0.0f, 0.0f); + SbVec3f p2(2.0f, 0.0f, 0.0f); + void * userdata0 = reinterpret_cast (&p0); + void * userdata1 = reinterpret_cast (&p1); + void * userdata2 = reinterpret_cast (&p2); + + BOOST_CHECK_MESSAGE(bsp.addPoint(p0, userdata0) == 0, "unexpected index"); + BOOST_CHECK_MESSAGE(bsp.addPoint(p1, userdata1) == 1, "unexpected index"); + BOOST_CHECK_MESSAGE(bsp.addPoint(p2, userdata2) == 2, "unexpected index"); + BOOST_CHECK_MESSAGE(bsp.addPoint(p2, userdata2) == 2, "unexpected index"); + BOOST_CHECK_MESSAGE(bsp.numPoints() == 3, "wrong number of points in the tree"); + + BOOST_CHECK_MESSAGE(bsp.findPoint(p0) == 0, "wrong index"); + BOOST_CHECK_MESSAGE(bsp.getUserData(0) == userdata0, "wrong userdata"); + BOOST_CHECK_MESSAGE(bsp.findPoint(p1) == 1, "wrong index"); + BOOST_CHECK_MESSAGE(bsp.getUserData(1) == userdata1, "wrong userdata"); + BOOST_CHECK_MESSAGE(bsp.findPoint(p2) == 2, "wrong index"); + BOOST_CHECK_MESSAGE(bsp.getUserData(2) == userdata2, "wrong userdata"); + + BOOST_CHECK_MESSAGE(bsp.numPoints() == 3, "wrong number of points in the tree"); + BOOST_CHECK_MESSAGE(bsp.getPointsArrayPtr()[0] == p0, "wrong point at index 0"); + BOOST_CHECK_MESSAGE(bsp.getPointsArrayPtr()[1] == p1, "wrong point at index 1"); + BOOST_CHECK_MESSAGE(bsp.getPointsArrayPtr()[2] == p2, "wrong point at index 2"); + + BOOST_CHECK_MESSAGE(bsp.removePoint(p1) == 1, "unable to remove point"); + BOOST_CHECK_MESSAGE(bsp.numPoints() == 2, "wrong number of points after removePoint()."); + BOOST_CHECK_MESSAGE(bsp.getPointsArrayPtr()[0] == p0, "wrong point at index 0"); + BOOST_CHECK_MESSAGE(bsp.getUserData(0) == userdata0, "wrong userdata"); + BOOST_CHECK_MESSAGE(bsp.getPointsArrayPtr()[1] == p2, "wrong point at index 1"); + BOOST_CHECK_MESSAGE(bsp.getUserData(1) == userdata2, "wrong userdata"); + + BOOST_CHECK_MESSAGE(bsp.removePoint(p0) >= 0, "unable to remove point"); + BOOST_CHECK_MESSAGE(bsp.removePoint(p2) >= 0, "unable to remove point"); + BOOST_CHECK_MESSAGE(bsp.numPoints() == 0, "wrong number of points after removing all points."); + +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbBox2dTest.cpp b/testsuite/base/SbBox2dTest.cpp new file mode 100644 index 00000000000..a6c09b0adec --- /dev/null +++ b/testsuite/base/SbBox2dTest.cpp @@ -0,0 +1,89 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SbBox2d_TestSuite); + +BOOST_AUTO_TEST_CASE(checkSize) { + SbVec2d min(1,2); + SbVec2d max(3,4); + + SbVec2d diff = max - min; + + SbBox2d box(min, max); + + BOOST_CHECK_MESSAGE(box.getSize() == diff, + "Box has incorrect size"); +} +BOOST_AUTO_TEST_CASE(checkGetClosestPoint) { + SbVec2d point(1524, 13794); + SbVec2d min(1557, 3308); + SbVec2d max(3113, 30157); + + SbBox2d box(min, max); + SbVec2d expected(1557, 13794); + + BOOST_CHECK_MESSAGE(box.getClosestPoint(point) == expected, + "Closest point does not fit"); + + SbVec2d sizes = box.getSize(); + SbVec2d expectedCenterQuery(max[0], sizes[1] / 2.0); + + BOOST_CHECK_MESSAGE(box.getClosestPoint(box.getCenter()) == expectedCenterQuery, + "Closest point for center query does not fit"); +} + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbBox2fTest.cpp b/testsuite/base/SbBox2fTest.cpp new file mode 100644 index 00000000000..e6c70ec9e49 --- /dev/null +++ b/testsuite/base/SbBox2fTest.cpp @@ -0,0 +1,89 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SbBox2f_TestSuite); + +BOOST_AUTO_TEST_CASE(checkSize) { + SbVec2f min(1,2); + SbVec2f max(3,4); + + SbVec2f diff = max - min; + + SbBox2f box(min, max); + + BOOST_CHECK_MESSAGE(box.getSize() == diff, + "Box has incorrect size"); +} +BOOST_AUTO_TEST_CASE(checkGetClosestPoint) { + SbVec2f point(1524, 13794); + SbVec2f min(1557, 3308); + SbVec2f max(3113, 30157); + + SbBox2f box(min, max); + SbVec2f expected(1557, 13794); + + BOOST_CHECK_MESSAGE(box.getClosestPoint(point) == expected, + "Closest point does not fit"); + + SbVec2f sizes = box.getSize(); + SbVec2f expectedCenterQuery(max[0], sizes[1] / 2.0f); + + BOOST_CHECK_MESSAGE(box.getClosestPoint(box.getCenter()) == expectedCenterQuery, + "Closest point for center query does not fit"); +} + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbBox2i32Test.cpp b/testsuite/base/SbBox2i32Test.cpp new file mode 100644 index 00000000000..6b182061368 --- /dev/null +++ b/testsuite/base/SbBox2i32Test.cpp @@ -0,0 +1,74 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SbBox2i32_TestSuite); + +BOOST_AUTO_TEST_CASE(checkSize) { + SbVec2i32 min(1,2); + SbVec2i32 max(3,4); + + SbVec2i32 diff = max - min; + + + SbBox2i32 box(min, max); + + BOOST_CHECK_MESSAGE(box.getSize() == diff, + "Box has incorrect size"); + +} + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbBox2sTest.cpp b/testsuite/base/SbBox2sTest.cpp new file mode 100644 index 00000000000..779fc152bb4 --- /dev/null +++ b/testsuite/base/SbBox2sTest.cpp @@ -0,0 +1,74 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SbBox2s_TestSuite); + +BOOST_AUTO_TEST_CASE(checkSize) { + SbVec2s min(1,2); + SbVec2s max(3,4); + + SbVec2s diff = max - min; + + + SbBox2s box(min, max); + + BOOST_CHECK_MESSAGE(box.getSize() == diff, + "Box has incorrect size"); + +} + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbBox3dTest.cpp b/testsuite/base/SbBox3dTest.cpp new file mode 100644 index 00000000000..2b7a7817ba3 --- /dev/null +++ b/testsuite/base/SbBox3dTest.cpp @@ -0,0 +1,78 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SbBox3d_TestSuite); + +BOOST_AUTO_TEST_CASE(checkGetClosestPoint) { + SbVec3d point(1524, 13794, 851); + SbVec3d min(1557, 3308, 850); + SbVec3d max(3113, 30157, 1886); + + SbBox3d box(min, max); + SbVec3d expected(1557, 13794, 851); + + BOOST_CHECK_MESSAGE(box.getClosestPoint(point) == expected, + "Closest point does not fit"); + + SbVec3d sizes = box.getSize(); + SbVec3d expectedCenterQuery(sizes[0] / 2.0, sizes[1] / 2.0, max[2]); + + BOOST_CHECK_MESSAGE(box.getClosestPoint(box.getCenter()) == expectedCenterQuery, + "Closest point for center query does not fit"); +} + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbBox3fTest.cpp b/testsuite/base/SbBox3fTest.cpp new file mode 100644 index 00000000000..39201101b10 --- /dev/null +++ b/testsuite/base/SbBox3fTest.cpp @@ -0,0 +1,78 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SbBox3f_TestSuite); + +BOOST_AUTO_TEST_CASE(checkGetClosestPoint) { + SbVec3f point(1524 , 13794 , 851); + SbVec3f min(1557, 3308, 850); + SbVec3f max(3113, 30157, 1886); + + SbBox3f box(min, max); + SbVec3f expected(1557, 13794, 851); + + BOOST_CHECK_MESSAGE(box.getClosestPoint(point) == expected, + "Closest point does not fit"); + + SbVec3f sizes = box.getSize(); + SbVec3f expectedCenterQuery(sizes[0]/2.0f, sizes[1]/2.0f, max[2]); + + BOOST_CHECK_MESSAGE(box.getClosestPoint(box.getCenter()) == expectedCenterQuery, + "Closest point for center query does not fit"); +} + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbBox3i32Test.cpp b/testsuite/base/SbBox3i32Test.cpp new file mode 100644 index 00000000000..950bd44286a --- /dev/null +++ b/testsuite/base/SbBox3i32Test.cpp @@ -0,0 +1,89 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SbBox3i32_TestSuite); + +BOOST_AUTO_TEST_CASE(checkSize) { + SbVec3i32 min(1,2,3); + SbVec3i32 max(3,4,5); + + SbVec3i32 diff = max - min; + + SbBox3i32 box(min, max); + + BOOST_CHECK_MESSAGE(box.getSize() == diff, + "Box has incorrect size"); +} +BOOST_AUTO_TEST_CASE(checkGetClosestPoint) { + SbVec3f point(1524 , 13794 , 851); + SbVec3i32 min(1557, 3308, 850); + SbVec3i32 max(3113, 30157, 1886); + + SbBox3i32 box(min, max); + SbVec3f expected(1557, 13794, 851); + + BOOST_CHECK_MESSAGE(box.getClosestPoint(point) == expected, + "Closest point does not fit"); + + SbVec3i32 sizes = box.getSize(); + SbVec3f expectedCenterQuery(sizes[0]/2.0f, sizes[1]/2.0f, (float)max[2]); + + BOOST_CHECK_MESSAGE(box.getClosestPoint(box.getCenter()) == expectedCenterQuery, + "Closest point for center query does not fit"); +} + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbBox3sTest.cpp b/testsuite/base/SbBox3sTest.cpp new file mode 100644 index 00000000000..e1823791c26 --- /dev/null +++ b/testsuite/base/SbBox3sTest.cpp @@ -0,0 +1,90 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + + +#include + +BOOST_AUTO_TEST_SUITE(SbBox3s_TestSuite); + +BOOST_AUTO_TEST_CASE(checkSize) { + SbVec3s min(1,2,3); + SbVec3s max(3,4,5); + + SbVec3s diff = max - min; + + SbBox3s box(min, max); + + BOOST_CHECK_MESSAGE(box.getSize() == diff, + "Box has incorrect size"); +} +BOOST_AUTO_TEST_CASE(checkGetClosestPoint) { + SbVec3f point(1524 , 13794 , 851); + SbVec3s min(1557, 3308, 850); + SbVec3s max(3113, 30157, 1886); + + SbBox3s box(min, max); + SbVec3f expected(1557, 13794, 851); + + BOOST_CHECK_MESSAGE(box.getClosestPoint(point) == expected, + "Closest point does not fit"); + + SbVec3s sizes = box.getSize(); + SbVec3f expectedCenterQuery(sizes[0]/2.0f, sizes[1]/2.0f, max[2]); + + BOOST_CHECK_MESSAGE(box.getClosestPoint(box.getCenter()) == expectedCenterQuery, + "Closest point for center query does not fit"); +} + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbByteBufferTest.cpp b/testsuite/base/SbByteBufferTest.cpp new file mode 100644 index 00000000000..f1c0f9c303f --- /dev/null +++ b/testsuite/base/SbByteBufferTest.cpp @@ -0,0 +1,121 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + +#include + +BOOST_AUTO_TEST_SUITE(SbByteBuffer_TestSuite); + +BOOST_AUTO_TEST_CASE(pushUnique) +{ + + static const char A [] = "ABC"; + static const char B [] = "XYZ"; + static char C [sizeof(A)+sizeof(B)-1]; + strcpy(C,A); + strcat(C,B); + + SbByteBuffer a(sizeof(A)-1,A); + SbByteBuffer b(sizeof(B)-1,B); + SbByteBuffer c=a; + + c.push(b); + + bool allOk=true; + for (size_t i=0;i +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + + +#include +#include +BOOST_AUTO_TEST_SUITE(SbDPMatrix_TestSuite); + + +BOOST_AUTO_TEST_CASE(constructFromSbMatrix) { + SbMatrix a(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); + SbMatrixd b; + double c[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + b.setValue(c); + SbDPMatrix d = SbMatrixd(a); + BOOST_CHECK_MESSAGE(b == d, + "Equality comparison failed!"); +} + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbDPPlaneTest.cpp b/testsuite/base/SbDPPlaneTest.cpp new file mode 100644 index 00000000000..657b05f87cf --- /dev/null +++ b/testsuite/base/SbDPPlaneTest.cpp @@ -0,0 +1,208 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +BOOST_AUTO_TEST_SUITE(SbDPPlane_TestSuite); + + +using namespace SIM::Coin::TestSuite; + +float slew(float Start, float End, int steps, int step) { + const float S = log(Start<0?-Start:Start); + const float E = log(End<0?-End:End); + + --steps; + + float res=0; + + assert(Start0 && End>0) { + res=exp(S+step*(E-S)/steps); + } + else { + float ZeroPoint = S*steps/(E+S); + if(step +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +BOOST_AUTO_TEST_SUITE(SbDPRotation_TestSuite); + + +BOOST_AUTO_TEST_CASE(tgsCompliance) { + SbDPRotation v = SbRotationd(SbVec3d(0,1,2),3); +} + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbImageTest.cpp b/testsuite/base/SbImageTest.cpp new file mode 100644 index 00000000000..c6931ce0af8 --- /dev/null +++ b/testsuite/base/SbImageTest.cpp @@ -0,0 +1,91 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SbImage_TestSuite); + + +BOOST_AUTO_TEST_CASE(copyConstruct) +{ + unsigned char buf [4]; + + for (int i=0;i +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + + +#include +#include +BOOST_AUTO_TEST_SUITE(SbMatrix_TestSuite); + + +BOOST_AUTO_TEST_CASE(constructFromSbDPMatrix) { + SbMatrixd a(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); + SbMatrix b; + float c[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + b.setValue(c); + SbMatrix d = SbMatrix(a); + BOOST_CHECK_MESSAGE(b == d, + "Equality comparison failed!"); +} + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbPlaneTest.cpp b/testsuite/base/SbPlaneTest.cpp new file mode 100644 index 00000000000..506bd792be4 --- /dev/null +++ b/testsuite/base/SbPlaneTest.cpp @@ -0,0 +1,79 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +BOOST_AUTO_TEST_SUITE(SbPlane_TestSuite); + + +using namespace SIM::Coin::TestSuite; + +BOOST_AUTO_TEST_CASE(signCorrect) +{ + SbPlane plane1(SbVec3f(0.0, 0.0, 1.0), 3.0); + SbPlane plane2(SbVec3f(1.0, 0.0, 0.0), 21.0); + SbLine line; + plane1.intersect(plane2, line); + + SbVec3f intersect = line.getPosition(); + SbVec3f vec(21, 0, 3); + + check_compare(intersect,vec, "SbPlane SignCorrect", .1f); + +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbRotationTest.cpp b/testsuite/base/SbRotationTest.cpp new file mode 100644 index 00000000000..b4c0206f750 --- /dev/null +++ b/testsuite/base/SbRotationTest.cpp @@ -0,0 +1,117 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + + +#include +#include +#include +#include +#include +#include +BOOST_AUTO_TEST_SUITE(SbRotation_TestSuite); + + +typedef SbRotation ToTest; +BOOST_AUTO_TEST_CASE(operatorBrackets) +{ + const int FLOAT_SENSITIVITY = 1; + const float SQRT2 = sqrt(2.f)/2.f; + SbRotation rot(0,-SQRT2,0,SQRT2); + + for (int i=0;i<4;++i) { + int premultiply = ((i&0x1)*((i&0x2)-1)); + float testVal = premultiply*SQRT2; + BOOST_CHECK_MESSAGE( + floatEquals(testVal,rot[i],FLOAT_SENSITIVITY), + std::string("Wrong value when trying to access value #") + + ::CoinTest::stringify(i) + + ": " + + ::CoinTest::stringify(rot[i]) + + " == " + + ::CoinTest::stringify(testVal) + ); + } +} + +BOOST_AUTO_TEST_CASE(toString) { + ToTest val(SbVec3f(0, -1, 0), 1); + SbString str("0 -1 0 1"); + SbVec4f expected(0.f, -1.f, 0.f, 1.f), actual; + sscanf(val.toString().getString(), "%f %f %f %f", &actual[0], &actual[1], &actual[2], &actual[3]); + BOOST_CHECK_MESSAGE(actual.equals(expected, 0.000001f), + std::string("Mismatch between ") + val.toString().getString() + " and control string " + str.getString()); + +} + +BOOST_AUTO_TEST_CASE(fromString) { + ToTest foo; + SbString test = "0 -1 0 1"; + ToTest trueVal(SbVec3f(0, -1, 0), 1); + SbBool conversionOk = foo.fromString(test); + BOOST_CHECK_MESSAGE(conversionOk && trueVal == foo, + std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); +} + +BOOST_AUTO_TEST_CASE(fromInvalidString) { + ToTest foo; + SbString test = "2.- 2 3 4"; + ToTest trueVal(1,2,3,4); + SbBool conversionOk = foo.fromString(test); + BOOST_CHECK_MESSAGE(conversionOk == FALSE, + std::string("Able to convert from ") + test.getString() + " which is not a valid " + SbTypeInfo::getTypeName() + " representation"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbStringTest.cpp b/testsuite/base/SbStringTest.cpp new file mode 100644 index 00000000000..d4dec543802 --- /dev/null +++ b/testsuite/base/SbStringTest.cpp @@ -0,0 +1,86 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +BOOST_AUTO_TEST_SUITE(SbString_TestSuite); + + +static void * createInstance(void) +{ + return (void *)0x1234; +} + +BOOST_AUTO_TEST_CASE(testAddition) +{ + SbString str1("First"); + SbString str2("Second"); + const char *cstr1 = "Erste"; + const char *cstr2 = "Zweite"; + + SbString a = str1 + str2; + SbString b = cstr1 + str2; + SbString c = str1 + cstr2; + + BOOST_CHECK_MESSAGE(a == SbString("FirstSecond"), + "operator+ error"); + BOOST_CHECK_MESSAGE(b == SbString("ErsteSecond"), + "operator+ error"); + BOOST_CHECK_MESSAGE(c == SbString("FirstZweite"), + "operator+ error"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbVec3dTest.cpp b/testsuite/base/SbVec3dTest.cpp new file mode 100644 index 00000000000..65642a99e6d --- /dev/null +++ b/testsuite/base/SbVec3dTest.cpp @@ -0,0 +1,79 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SbVec3d_TestSuite); + +typedef SbVec3d ToTest; +BOOST_AUTO_TEST_CASE(toString) { + ToTest val(1.0/3,2,3); + SbString str("0.3333333333333333 2 3"); + BOOST_CHECK_MESSAGE(str == val.toString(), + std::string("Mismatch between ") + val.toString().getString() + " and control string " + str.getString()); + +} + +BOOST_AUTO_TEST_CASE(fromString) { + ToTest foo; + SbString test = "0.3333333333333333 -2 -3.0"; + ToTest trueVal(0.3333333333333333,-2,-3); + SbBool conversionOk = foo.fromString(test); + BOOST_CHECK_MESSAGE(conversionOk && trueVal == foo, + std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbVec3fTest.cpp b/testsuite/base/SbVec3fTest.cpp new file mode 100644 index 00000000000..51a5dc7682e --- /dev/null +++ b/testsuite/base/SbVec3fTest.cpp @@ -0,0 +1,96 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +BOOST_AUTO_TEST_SUITE(SbVec3f_TestSuite); + + +typedef SbVec3f ToTest; +BOOST_AUTO_TEST_CASE(toString) { + ToTest val(1.0f/3,2,3); + SbString str("0.33333334 2 3"); + BOOST_CHECK_MESSAGE(str == val.toString(), + std::string("Mismatch between ") + val.toString().getString() + " and control string " + str.getString()); + +} + +BOOST_AUTO_TEST_CASE(fromString) { + ToTest foo; + SbString test = "0.333333343 -2 -3.0"; + ToTest trueVal(0.333333343f,-2,-3); + SbBool conversionOk = foo.fromString(test); + BOOST_CHECK_MESSAGE(conversionOk && trueVal == foo, + std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); +} + +BOOST_AUTO_TEST_CASE(fromInvalidString1) { + ToTest foo; + SbString test = "a 2 3"; + SbBool conversionOk = foo.fromString(test); + BOOST_CHECK_MESSAGE(conversionOk == FALSE, + std::string("Able to convert from ") + test.getString() + " which is not a valid " + SbTypeInfo::getTypeName() + " representation"); +} + +BOOST_AUTO_TEST_CASE(fromInvalidString2) { + ToTest foo; + SbString test = "1,2,3"; + SbBool conversionOk = foo.fromString(test); + BOOST_CHECK_MESSAGE(conversionOk == FALSE, + std::string("Able to convert from ") + test.getString() + " which is not a valid " + SbTypeInfo::getTypeName() + " representation"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbVec3sTest.cpp b/testsuite/base/SbVec3sTest.cpp new file mode 100644 index 00000000000..2f4be72e8e0 --- /dev/null +++ b/testsuite/base/SbVec3sTest.cpp @@ -0,0 +1,87 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +BOOST_AUTO_TEST_SUITE(SbVec3s_TestSuite); + + +typedef SbVec3s ToTest; +BOOST_AUTO_TEST_CASE(toString) { + ToTest val(1,2,3); + SbString str("1 2 3"); + BOOST_CHECK_MESSAGE(str == val.toString(), + std::string("Mismatch between ") + val.toString().getString() + " and control string " + str.getString()); +} + +BOOST_AUTO_TEST_CASE(fromString) { + ToTest foo; + SbString test = "1 -2 3"; + ToTest trueVal(1,-2,3); + foo.fromString(test); + BOOST_CHECK_MESSAGE(trueVal == foo, + std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); +} + +BOOST_AUTO_TEST_CASE(fromInvalidString) { + ToTest foo; + SbString test = "a,2,3"; + SbBool conversionOk = foo.fromString(test); + BOOST_CHECK_MESSAGE(conversionOk == FALSE, + std::string("Able to convert from ") + test.getString() + " which is not a valid " + SbTypeInfo::getTypeName() + " representation"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbVec3usTest.cpp b/testsuite/base/SbVec3usTest.cpp new file mode 100644 index 00000000000..45606fd3a13 --- /dev/null +++ b/testsuite/base/SbVec3usTest.cpp @@ -0,0 +1,62 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SbVec3us_TestSuite); + + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbVec4fTest.cpp b/testsuite/base/SbVec4fTest.cpp new file mode 100644 index 00000000000..a92b99ac30f --- /dev/null +++ b/testsuite/base/SbVec4fTest.cpp @@ -0,0 +1,107 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SbVec4f_TestSuite); + + +BOOST_AUTO_TEST_CASE(noNormalizingNormalized) +{ + const float SQRT2 = sqrt(2.f)/2.f; + SbVec4f vec(0,-SQRT2,0,SQRT2); + + vec.normalize(); + for (int i=0;i<4;++i) { + int premultiply = ((i&0x1)*((i&0x2)-1)); + float testVal = premultiply*SQRT2; + BOOST_CHECK_MESSAGE( + testVal==vec[i], + std::string("Wrong value when trying to access value #") + + ::CoinTest::stringify(i) + + ": " + + ::CoinTest::stringify(vec[i]) + + " == " + + ::CoinTest::stringify(testVal) + ); + } + +} + +BOOST_AUTO_TEST_CASE(normalizingDeNormalized) +{ + const int FLOAT_SENSITIVITY = 1; + const float SQRT2 = sqrt(2.f)/2.f; + SbVec4f vec(0,-1,0,1); + + vec.normalize(); + for (int i=0;i<4;++i) { + int premultiply = ((i&0x1)*((i&0x2)-1)); + float testVal = premultiply*SQRT2; + BOOST_CHECK_MESSAGE( + floatEquals(testVal,vec[i],FLOAT_SENSITIVITY), + std::string("Wrong value when trying to access value #") + + ::CoinTest::stringify(i) + + ": " + + ::CoinTest::stringify(vec[i]) + + " == " + + ::CoinTest::stringify(testVal) + ); + } + +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/SbViewVolumeTest.cpp b/testsuite/base/SbViewVolumeTest.cpp new file mode 100644 index 00000000000..fd0cb1dc0db --- /dev/null +++ b/testsuite/base/SbViewVolumeTest.cpp @@ -0,0 +1,126 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +BOOST_AUTO_TEST_SUITE(SbViewVolume_TestSuite); + + +BOOST_AUTO_TEST_CASE(intersect_ortho) +{ + SbViewVolume vv; + vv.ortho(-0.5, 0.5, -0.5, 0.5, -1, 10); + SbBox3f box(0, 0, 0, 1, 1, 1); + + SbBox3f isect = vv.intersectionBox(box); + COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[0], 0.0f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[1], 0.0f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[2], 0.0f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[0], 0.5f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[1], 0.5f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[2], 1.0f); +} + +BOOST_AUTO_TEST_CASE(intersect_bbox_inside_vv) +{ + SbViewVolume vv; + vv.ortho(-0.5, 0.5, -0.5, 0.5, -1, 10); + SbBox3f box(-0.25, -0.25, -0.25, 0.25, 0.25, 0.25); + + SbBox3f isect = vv.intersectionBox(box); + COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[0], -0.25); + COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[1], -0.25f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[2], -0.25f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[0], 0.25f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[1], 0.25f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[2], 0.25f); +} + +BOOST_AUTO_TEST_CASE(intersect_vv_inside_bbox) +{ + SbViewVolume vv; + vv.ortho(-0.5, 0.5, -0.5, 0.5, 0, 5); + SbBox3f box(-10, -10, -10, 10, 10, 10); + + SbBox3f isect = vv.intersectionBox(box); + COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[0], -0.5f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[1], -0.5f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[2], -5.0f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[0], 0.5f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[1], 0.5f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[2], 0.0f); +} + +BOOST_AUTO_TEST_CASE(intersect_perspective) +{ + // FIXME: set up a better perspective vv which also tests left/right/top/bottom + SbViewVolume vv; + vv.perspective(0.78f, 1.0f, 4.25, 4.75); + vv.translateCamera(SbVec3f(0.0f, 0.0f, 5.0f)); + + SbBox3f box(0, 0, 0, 1, 1, 1); + SbBox3f isect = vv.intersectionBox(box); + + COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[0], 0.0); + COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[1], 0.0f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMin()[2], 0.25f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[0], 1.0f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[1], 1.0f); + COIN_TESTCASE_CHECK_FLOAT(isect.getMax()[2], 0.75f); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/heapTest.cpp b/testsuite/base/heapTest.cpp new file mode 100644 index 00000000000..69fdcd1eb39 --- /dev/null +++ b/testsuite/base/heapTest.cpp @@ -0,0 +1,166 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +BOOST_AUTO_TEST_SUITE(heap_TestSuite); + +class mock_up { +public: + typedef struct wrapped_value { + double x; + } wrapped_value; + + static void heap_print_cb(void * v, SbString& str) { + wrapped_value* value = reinterpret_cast(v); + std::ostringstream oss; + oss << value->x; + str += oss.str().c_str(); + } + + static double heap_evaluate_cb(void * v) + { + wrapped_value* value = reinterpret_cast(v); + return value->x; + } + + // strict weak ordering is needed for compare callbacks + static int min_heap_compare_cb(void * lhs, void * rhs) + { + return heap_evaluate_cb(lhs) < heap_evaluate_cb(rhs) ? 1 : 0; + } + + static int max_heap_compare_cb(void * lhs, void * rhs) + { + return heap_evaluate_cb(lhs) > heap_evaluate_cb(rhs) ? 1 : 0; + } +}; + +BOOST_AUTO_TEST_CASE(min_heap) { + mock_up::wrapped_value val[] = {3, 2, 1, 15, 5, 4, 45}; + cc_heap* heap = cc_heap_construct(256, reinterpret_cast(mock_up::min_heap_compare_cb), TRUE); + for (int i = 0, n = sizeof(val) / sizeof(val[0]); i < n; ++i) + cc_heap_add(heap, &val[i]); + SbString result; + cc_heap_print(heap, reinterpret_cast(mock_up::heap_print_cb), result, FALSE); + cc_heap_destruct(heap); + heap = NULL; + SbString str("1 3 2 15 5 4 45 "); + BOOST_CHECK_MESSAGE(str == result, + std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); +} + +BOOST_AUTO_TEST_CASE(max_heap) { + mock_up::wrapped_value val[] = {3, 2, 1, 15, 5, 4, 45}; + cc_heap* heap = cc_heap_construct(256, reinterpret_cast(mock_up::max_heap_compare_cb), TRUE); + for (int i = 0, n = sizeof(val) / sizeof(val[0]); i < n; ++i) + cc_heap_add(heap, &val[i]); + SbString result; + cc_heap_print(heap, reinterpret_cast(mock_up::heap_print_cb), result, FALSE); + cc_heap_destruct(heap); + heap = NULL; + SbString str("45 5 15 2 3 1 4 "); + BOOST_CHECK_MESSAGE(str == result, + std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); +} + +BOOST_AUTO_TEST_CASE(heap_add) { + mock_up::wrapped_value val[] = {3, 2, 1, 15, 5, 4, 45}; + cc_heap* heap = cc_heap_construct(256, reinterpret_cast(mock_up::min_heap_compare_cb), TRUE); + for (int i = 0, n = sizeof(val) / sizeof(val[0]); i < n; ++i) + cc_heap_add(heap, &val[i]); + double added_value = 12; + cc_heap_add(heap, &added_value); + SbString result; + cc_heap_print(heap, reinterpret_cast(mock_up::heap_print_cb), result, FALSE); + cc_heap_destruct(heap); + heap = NULL; + SbString str("1 3 2 12 5 4 45 15 "); + BOOST_CHECK_MESSAGE(str == result, + std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); +} + +BOOST_AUTO_TEST_CASE(heap_remove) { + mock_up::wrapped_value val[] = {3, 2, 1, 15, 5, 4, 45}; + cc_heap* heap = cc_heap_construct(256, reinterpret_cast(mock_up::min_heap_compare_cb), TRUE); + for (int i = 0, n = sizeof(val) / sizeof(val[0]); i < n; ++i) + cc_heap_add(heap, &val[i]); + cc_heap_remove(heap, &val[3]); + SbString result; + cc_heap_print(heap, reinterpret_cast(mock_up::heap_print_cb), result, FALSE); + cc_heap_destruct(heap); + heap = NULL; + SbString str("1 3 2 45 5 4 "); + BOOST_CHECK_MESSAGE(str == result, + std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); +} + +BOOST_AUTO_TEST_CASE(heap_update) { + mock_up::wrapped_value val[] = {3, 2, 1, 15, 5, 4, 45}; + cc_heap* heap = cc_heap_construct(256, reinterpret_cast(mock_up::min_heap_compare_cb), TRUE); + for (int i = 0, n = sizeof(val) / sizeof(val[0]); i < n; ++i) + cc_heap_add(heap, &val[i]); + val[3].x = 1; + cc_heap_update(heap, &val[3]); + SbString result; + cc_heap_print(heap, reinterpret_cast(mock_up::heap_print_cb), result, FALSE); + cc_heap_destruct(heap); + heap = NULL; + SbString str("1 1 2 3 5 4 45 "); + BOOST_CHECK_MESSAGE(str == result, + std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); +} + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/base/rbptreeTest.cpp b/testsuite/base/rbptreeTest.cpp new file mode 100644 index 00000000000..371eb77577c --- /dev/null +++ b/testsuite/base/rbptreeTest.cpp @@ -0,0 +1,112 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +BOOST_AUTO_TEST_SUITE(rbptree_TestSuite); + + +#define FILL_TIMES (50) +#define FILL_COUNT (10000) + +BOOST_AUTO_TEST_CASE(rbptree_stress) +{ + srand(123); + cc_rbptree tree; + cc_rbptree_init(&tree); + + int i; + for (int c = 0; c < FILL_TIMES; ++c) { + SbList values; + for (i = 0; i < FILL_COUNT; ++i) { + void * entry = reinterpret_cast(static_cast(rand())); + cc_rbptree_insert(&tree, entry, NULL); + values.append(entry); + } + BOOST_ASSERT(cc_rbptree_size(&tree) == FILL_COUNT); + + if ((c & 1) == 0) { + for (i = (FILL_COUNT - 1); i >= 0; --i) cc_rbptree_remove(&tree, values[i]); + } else { + for (i = 0; i < FILL_COUNT; ++i) cc_rbptree_remove(&tree, values[i]); + } + BOOST_ASSERT(cc_rbptree_size(&tree) == 0); + } + + for (int c = 0; c < FILL_TIMES; ++c) { + SbList values; + for (i = 0; i < FILL_COUNT; ++i) { + void * entry = reinterpret_cast(static_cast(((c & 2) == 0) ? i : (FILL_COUNT - i))); + cc_rbptree_insert(&tree, entry, NULL); + values.append(entry); + } + BOOST_ASSERT(cc_rbptree_size(&tree) == FILL_COUNT); + + if ((c & 1) == 0) { + for (i = (FILL_COUNT - 1); i >= 0; --i) cc_rbptree_remove(&tree, values[i]); + } else { + for (i = 0; i < FILL_COUNT; ++i) cc_rbptree_remove(&tree, values[i]); + } + BOOST_ASSERT(cc_rbptree_size(&tree) == 0); + + } + + + cc_rbptree_clean(&tree); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/draggers/SoTransformerDraggerTest.cpp b/testsuite/draggers/SoTransformerDraggerTest.cpp new file mode 100644 index 00000000000..91b12cda235 --- /dev/null +++ b/testsuite/draggers/SoTransformerDraggerTest.cpp @@ -0,0 +1,132 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +#include +BOOST_AUTO_TEST_SUITE(SoTransformerDragger_TestSuite); + + +static +SoCallbackAction::Response +register_cb(void * data, SoCallbackAction * action, const SoNode * node) +{ + assert(data); + SbDict * dict = static_cast(data); + dict->enter(reinterpret_cast(node), NULL); + return SoCallbackAction::CONTINUE; +} + +static +void +ensure_unique_cb(uintptr_t entry, void * value, void * data) +{ + SbDict * copydict = static_cast(data); + void * val = NULL; + BOOST_ASSERT(!copydict->find(entry, val)); +} + +BOOST_AUTO_TEST_CASE(dragger_deep_copy) +{ + SbDict origdict, copydict; + + SoSeparator * root = new SoSeparator; + root->setName("dragger_deep_copy_root"); + root->ref(); + root->addChild(new SoTransformerDragger); + + SoSeparator * copy = static_cast(root->copy()); + assert(copy); + copy->setName("dragger_deep_copy_copy"); + copy->ref(); + + { + SoCallbackAction cba; + cba.setCallbackAll(TRUE); + + cba.addPreCallback(SoNode::getClassTypeId(), register_cb, &origdict); + cba.apply(root); + } + + { + SoCallbackAction cba; + cba.setCallbackAll(TRUE); + + cba.addPreCallback(SoNode::getClassTypeId(), register_cb, ©dict); + cba.apply(copy); + } + + SbPList keys, values; + + origdict.makePList(keys, values); + const int origdictsize = keys.getLength(); + + keys.truncate(0); + values.truncate(0); + copydict.makePList(keys, values); + const int copydictsize = keys.getLength(); + + BOOST_ASSERT(origdictsize == copydictsize); + + // make sure pointer sets have an empty union + origdict.applyToAll(ensure_unique_cb, ©dict); + + root->unref(); + copy->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFBitMaskTest.cpp b/testsuite/fields/SoMFBitMaskTest.cpp new file mode 100644 index 00000000000..9a7215ba972 --- /dev/null +++ b/testsuite/fields/SoMFBitMaskTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFBitMask_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFBitMask_initialized) +{ + SoMFBitMask field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFBoolTest.cpp b/testsuite/fields/SoMFBoolTest.cpp new file mode 100644 index 00000000000..28637bc82f2 --- /dev/null +++ b/testsuite/fields/SoMFBoolTest.cpp @@ -0,0 +1,83 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFBool_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFBool_initialized) +{ + SoMFBool field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + +BOOST_AUTO_TEST_CASE(array_ops) +{ + SoMFBool field; + field.set1Value(0, TRUE); + field.set1Value(1, FALSE); + field.set1Value(2, TRUE); + BOOST_CHECK_EQUAL(field.getNum(), 3); + field.deleteValues(1,1); + BOOST_CHECK_EQUAL(field.getNum(), 2); + BOOST_CHECK_EQUAL(field[0], TRUE); + BOOST_CHECK_EQUAL(field[1], TRUE); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFColorRGBATest.cpp b/testsuite/fields/SoMFColorRGBATest.cpp new file mode 100644 index 00000000000..1bd7af97722 --- /dev/null +++ b/testsuite/fields/SoMFColorRGBATest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFColorRGBA_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFColorRGBA_initialized) +{ + SoMFColorRGBA field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFColorTest.cpp b/testsuite/fields/SoMFColorTest.cpp new file mode 100644 index 00000000000..ed0ebc51e79 --- /dev/null +++ b/testsuite/fields/SoMFColorTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFColor_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFColor_initialized) +{ + SoMFColor field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFDoubleTest.cpp b/testsuite/fields/SoMFDoubleTest.cpp new file mode 100644 index 00000000000..2873da32ec7 --- /dev/null +++ b/testsuite/fields/SoMFDoubleTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFDouble_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFDouble_initialized) +{ + SoMFDouble field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFEngineTest.cpp b/testsuite/fields/SoMFEngineTest.cpp new file mode 100644 index 00000000000..a9a02ad17b7 --- /dev/null +++ b/testsuite/fields/SoMFEngineTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFEngine_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFEngine_initialized) +{ + SoMFEngine field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFEnumTest.cpp b/testsuite/fields/SoMFEnumTest.cpp new file mode 100644 index 00000000000..f5967ce2f59 --- /dev/null +++ b/testsuite/fields/SoMFEnumTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFEnum_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFEnum_initialized) +{ + SoMFEnum field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFFloatTest.cpp b/testsuite/fields/SoMFFloatTest.cpp new file mode 100644 index 00000000000..57979dbaa84 --- /dev/null +++ b/testsuite/fields/SoMFFloatTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFFloat_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFFloat_initialized) +{ + SoMFFloat field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFInt32Test.cpp b/testsuite/fields/SoMFInt32Test.cpp new file mode 100644 index 00000000000..1e48e94d035 --- /dev/null +++ b/testsuite/fields/SoMFInt32Test.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFInt32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFInt32_initialized) +{ + SoMFInt32 field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFMatrixTest.cpp b/testsuite/fields/SoMFMatrixTest.cpp new file mode 100644 index 00000000000..f77f6ac9de1 --- /dev/null +++ b/testsuite/fields/SoMFMatrixTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFMatrix_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFMatrix_initialized) +{ + SoMFMatrix field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFNameTest.cpp b/testsuite/fields/SoMFNameTest.cpp new file mode 100644 index 00000000000..e3935ff45ac --- /dev/null +++ b/testsuite/fields/SoMFNameTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFName_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFName_initialized) +{ + SoMFName field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFNodeTest.cpp b/testsuite/fields/SoMFNodeTest.cpp new file mode 100644 index 00000000000..2e500b231dc --- /dev/null +++ b/testsuite/fields/SoMFNodeTest.cpp @@ -0,0 +1,94 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +BOOST_AUTO_TEST_SUITE(SoMFNode_TestSuite); + + +// Do-nothing error handler for ignoring read errors while testing. +static void +readErrorHandler(const SoError * error, void * data) +{ +} + +BOOST_AUTO_TEST_CASE(SoMFNode_initialized) +{ + SoMFNode field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + +BOOST_AUTO_TEST_CASE(NULLreading) +{ + // FIXME: We are forced to restore the global state before terminating, + // or independent tests could fail. (sveinung 20071108) + SoErrorCB * prevErrorCB = SoReadError::getHandlerCallback(); + SoReadError::setHandlerCallback(readErrorHandler, NULL); + + const char file[] = + "[ DEF mycube Cube {} USE mycube ]"; + SoInput in; + in.setBuffer(reinterpret_cast(file), sizeof(file)); + SoMFNode field; + BOOST_CHECK_MESSAGE(field.read(&in, SbName("test")), + "DEF/USE reading in SoMFNode is broken"); + + SoReadError::setHandlerCallback(prevErrorCB, NULL); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFPathTest.cpp b/testsuite/fields/SoMFPathTest.cpp new file mode 100644 index 00000000000..238682c38ca --- /dev/null +++ b/testsuite/fields/SoMFPathTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFPath_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFPath_initialized) +{ + SoMFPath field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFPlaneTest.cpp b/testsuite/fields/SoMFPlaneTest.cpp new file mode 100644 index 00000000000..c4bde446549 --- /dev/null +++ b/testsuite/fields/SoMFPlaneTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFPlane_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFPlane_initialized) +{ + SoMFPlane field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFRotationTest.cpp b/testsuite/fields/SoMFRotationTest.cpp new file mode 100644 index 00000000000..48763de0e98 --- /dev/null +++ b/testsuite/fields/SoMFRotationTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFRotation_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFRotation_initialized) +{ + SoMFRotation field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFShortTest.cpp b/testsuite/fields/SoMFShortTest.cpp new file mode 100644 index 00000000000..66741596407 --- /dev/null +++ b/testsuite/fields/SoMFShortTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFShort_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFShort_initialized) +{ + SoMFShort field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFStringTest.cpp b/testsuite/fields/SoMFStringTest.cpp new file mode 100644 index 00000000000..04b05240e6c --- /dev/null +++ b/testsuite/fields/SoMFStringTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFString_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFString_initialized) +{ + SoMFString field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFTimeTest.cpp b/testsuite/fields/SoMFTimeTest.cpp new file mode 100644 index 00000000000..fa3db5655cd --- /dev/null +++ b/testsuite/fields/SoMFTimeTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFTime_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFTime_initialized) +{ + SoMFTime field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFUInt32Test.cpp b/testsuite/fields/SoMFUInt32Test.cpp new file mode 100644 index 00000000000..4847e0311ab --- /dev/null +++ b/testsuite/fields/SoMFUInt32Test.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFUInt32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFUInt32_initialized) +{ + SoMFUInt32 field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFUShortTest.cpp b/testsuite/fields/SoMFUShortTest.cpp new file mode 100644 index 00000000000..4c0b6be46a9 --- /dev/null +++ b/testsuite/fields/SoMFUShortTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFUShort_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFUShort_initialized) +{ + SoMFUShort field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec2bTest.cpp b/testsuite/fields/SoMFVec2bTest.cpp new file mode 100644 index 00000000000..25254365f5a --- /dev/null +++ b/testsuite/fields/SoMFVec2bTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec2b_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec2b_initialized) +{ + SoMFVec2b field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec2dTest.cpp b/testsuite/fields/SoMFVec2dTest.cpp new file mode 100644 index 00000000000..991add1e313 --- /dev/null +++ b/testsuite/fields/SoMFVec2dTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec2d_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec2d_initialized) +{ + SoMFVec2d field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec2fTest.cpp b/testsuite/fields/SoMFVec2fTest.cpp new file mode 100644 index 00000000000..f13fa579db3 --- /dev/null +++ b/testsuite/fields/SoMFVec2fTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec2f_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec2f_initialized) +{ + SoMFVec2f field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec2i32Test.cpp b/testsuite/fields/SoMFVec2i32Test.cpp new file mode 100644 index 00000000000..c563999a0fa --- /dev/null +++ b/testsuite/fields/SoMFVec2i32Test.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec2i32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec2i32_initialized) +{ + SoMFVec2i32 field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec2sTest.cpp b/testsuite/fields/SoMFVec2sTest.cpp new file mode 100644 index 00000000000..82e083b377e --- /dev/null +++ b/testsuite/fields/SoMFVec2sTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec2s_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec2s_initialized) +{ + SoMFVec2s field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec3bTest.cpp b/testsuite/fields/SoMFVec3bTest.cpp new file mode 100644 index 00000000000..e08ba6d937d --- /dev/null +++ b/testsuite/fields/SoMFVec3bTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec3b_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec3b_initialized) +{ + SoMFVec3b field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec3dTest.cpp b/testsuite/fields/SoMFVec3dTest.cpp new file mode 100644 index 00000000000..b64f834848a --- /dev/null +++ b/testsuite/fields/SoMFVec3dTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec3d_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec3d_initialized) +{ + SoMFVec3d field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec3fTest.cpp b/testsuite/fields/SoMFVec3fTest.cpp new file mode 100644 index 00000000000..6b89b858f5f --- /dev/null +++ b/testsuite/fields/SoMFVec3fTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec3f_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec3f_initialized) +{ + SoMFVec3f field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec3i32Test.cpp b/testsuite/fields/SoMFVec3i32Test.cpp new file mode 100644 index 00000000000..30ba167ace3 --- /dev/null +++ b/testsuite/fields/SoMFVec3i32Test.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec3i32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec3i32_initialized) +{ + SoMFVec3i32 field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec3sTest.cpp b/testsuite/fields/SoMFVec3sTest.cpp new file mode 100644 index 00000000000..5f097872092 --- /dev/null +++ b/testsuite/fields/SoMFVec3sTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec3s_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec3s_initialized) +{ + SoMFVec3s field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec4bTest.cpp b/testsuite/fields/SoMFVec4bTest.cpp new file mode 100644 index 00000000000..22dbd39e522 --- /dev/null +++ b/testsuite/fields/SoMFVec4bTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec4b_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec4b_initialized) +{ + SoMFVec4b field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec4dTest.cpp b/testsuite/fields/SoMFVec4dTest.cpp new file mode 100644 index 00000000000..dc5c767884e --- /dev/null +++ b/testsuite/fields/SoMFVec4dTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec4d_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec4d_initialized) +{ + SoMFVec4d field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec4fTest.cpp b/testsuite/fields/SoMFVec4fTest.cpp new file mode 100644 index 00000000000..06e70220ec3 --- /dev/null +++ b/testsuite/fields/SoMFVec4fTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec4f_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec4f_initialized) +{ + SoMFVec4f field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec4i32Test.cpp b/testsuite/fields/SoMFVec4i32Test.cpp new file mode 100644 index 00000000000..84ba8bacec3 --- /dev/null +++ b/testsuite/fields/SoMFVec4i32Test.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec4i32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec4i32_initialized) +{ + SoMFVec4i32 field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec4sTest.cpp b/testsuite/fields/SoMFVec4sTest.cpp new file mode 100644 index 00000000000..2881ee2730c --- /dev/null +++ b/testsuite/fields/SoMFVec4sTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec4s_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec4s_initialized) +{ + SoMFVec4s field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec4ubTest.cpp b/testsuite/fields/SoMFVec4ubTest.cpp new file mode 100644 index 00000000000..9133dd1ea85 --- /dev/null +++ b/testsuite/fields/SoMFVec4ubTest.cpp @@ -0,0 +1,93 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec4ub_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec4ub_initialized) +{ + SoMFVec4ub field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + +BOOST_AUTO_TEST_CASE(textinput) +{ + SbBool ok; + SoMFVec4ub field; + ok = field.set("[]"); + BOOST_CHECK_EQUAL(ok, TRUE); + BOOST_CHECK_EQUAL(field.getNum(), 0); + ok = field.set("1 2 3 4"); + BOOST_CHECK_EQUAL(ok, TRUE); + BOOST_CHECK_EQUAL(field.getNum(), 1); + ok = field.set("[1 2 3 4]"); + BOOST_CHECK_EQUAL(ok, TRUE); + BOOST_CHECK_EQUAL(field.getNum(), 1); + ok = field.set("[1 2 3 4 1 2 3 4]"); + BOOST_CHECK_EQUAL(ok, TRUE); + BOOST_CHECK_EQUAL(field.getNum(), 2); + BOOST_CHECK_EQUAL(field[0], field[1]); + ok = field.set("[1 2 3 4, 1 2 3 4,]"); + BOOST_CHECK_EQUAL(ok, TRUE); + BOOST_CHECK_EQUAL(field.getNum(), 2); + BOOST_CHECK_EQUAL(field[0], field[1]); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec4ui32Test.cpp b/testsuite/fields/SoMFVec4ui32Test.cpp new file mode 100644 index 00000000000..3c47d0dd460 --- /dev/null +++ b/testsuite/fields/SoMFVec4ui32Test.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec4ui32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec4ui32_initialized) +{ + SoMFVec4ui32 field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoMFVec4usTest.cpp b/testsuite/fields/SoMFVec4usTest.cpp new file mode 100644 index 00000000000..bab3a649316 --- /dev/null +++ b/testsuite/fields/SoMFVec4usTest.cpp @@ -0,0 +1,70 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoMFVec4us_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoMFVec4us_initialized) +{ + SoMFVec4us field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(field.getNum(), 0); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFBitMaskTest.cpp b/testsuite/fields/SoSFBitMaskTest.cpp new file mode 100644 index 00000000000..f8a408e2038 --- /dev/null +++ b/testsuite/fields/SoSFBitMaskTest.cpp @@ -0,0 +1,139 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +BOOST_AUTO_TEST_SUITE(SoSFBitMask_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFBitMask_initialized) +{ + SoSFBitMask field; + BOOST_CHECK_MESSAGE(SoSFBitMask::getClassTypeId() != SoType::badType(), + "SoSFBitMask class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "SoSFBitMask class not initialized"); +} + +// BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(textinput, 1) + +BOOST_AUTO_TEST_CASE(textinput) +{ + enum Values { VALUE1 = 0x01, VALUE2 = 0x02, VALUE3 = 0x04 }; + enum Other { OTHER1 = 0x01, OTHER2 = 0x02, OTHER3 = 0x04 }; + + SbBool ok; + + SbName names1[3] = { SbName("VALUE1"), SbName("VALUE2"), SbName("VALUE3") }; + int values1[3] = { 0x01, 0x02, 0x04 }; + + SbName names2[3] = { SbName("OTHER1"), SbName("OTHER2"), SbName("OTHER3") }; + int values2[3] = { 0x01, 0x02, 0x04 }; + + SoSFBitMask field1, field2, field3; + + field1.setEnums(3, values1, names1); + field2.setEnums(3, values1, names1); + field3.setEnums(3, values2, names2); + + TestSuite::ResetReadErrorCount(); + static const char * filters[] = { "Unknown SoSFBitMask bit mask value", NULL }; + TestSuite::PushMessageSuppressFilters(filters); + ok = field1.set("OTHER1"); // should output error + BOOST_CHECK_MESSAGE(ok == FALSE, "accepted 'OTHER1' erroneously"); + TestSuite::PopMessageSuppressFilters(); + BOOST_CHECK_EQUAL(TestSuite::GetReadErrorCount(), 1); + TestSuite::ResetReadErrorCount(); + + ok = field1.set("VALUE2"); + BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'VALUE2'"); + ok = field2.set("VALUE2"); + BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'VALUE2'"); + BOOST_CHECK_EQUAL(field1.getValue(), field2.getValue()); + BOOST_CHECK_MESSAGE(field1.isSame(field2), "SoSFBitmask.isSame() problem"); + + ok = field1.set("VALUE2"); + BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'VALUE2'"); + ok = field2.set("(VALUE1|VALUE3)"); + BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept '(VALUE1|VALUE3)'"); + BOOST_CHECK_EQUAL(field2.getValue(), VALUE1|VALUE3); + BOOST_CHECK_MESSAGE(!field2.isSame(field1), "SoSFBitmask.isSame() problem"); + + // failing test, but unclear if it is required to work + ok = field2.set("VALUE1|VALUE3"); // this ought to work too, right? + BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'VALUE1|VALUE2'"); + //BOOST_CHECK_EQUAL(field2.getValue(), VALUE1|VALUE3); + + // FIXME: try to read the same from a file? + // Solving this would go into the math-parsing problem? + + ok = field1.set("VALUE2"); + BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'VALUE2'"); + ok = field3.set("OTHER2"); + BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'OTHER2'"); + BOOST_CHECK_EQUAL(field1.getValue(), field3.getValue()); + BOOST_CHECK_MESSAGE(!field1.isSame(field3), "SoSFBitmask.isSame() false positive"); + + // Numeric values don't work. + //ok = field1.set("0"); + //BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept '0'"); + //BOOST_CHECK_MESSAGE(field1.getValue() == 0, "did not set value to 0"); + //ok = field1.set("1"); + //BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept '1'"); + //BOOST_CHECK_MESSAGE(field1.getValue() == 1, "did not set value to 1"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFBoolTest.cpp b/testsuite/fields/SoSFBoolTest.cpp new file mode 100644 index 00000000000..0836d2b1a65 --- /dev/null +++ b/testsuite/fields/SoSFBoolTest.cpp @@ -0,0 +1,106 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFBool_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFBool_initialized) +{ + SoSFBool field; + BOOST_CHECK_MESSAGE(SoSFBool::getClassTypeId() != SoType::badType(), + "SoSFBool class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + +BOOST_AUTO_TEST_CASE(textinput) +{ + SbBool ok; + SoSFBool field; + ok = field.set("TRUE"); + BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'TRUE'"); + BOOST_CHECK_EQUAL(field.getValue(), TRUE); + ok = field.set("FALSE"); + BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept 'FALSE'"); + BOOST_CHECK_EQUAL(field.getValue(), FALSE); + + TestSuite::ResetReadErrorCount(); + static const char * filters[] = { "Invalid value", NULL }; + TestSuite::PushMessageSuppressFilters(filters); + ok = field.set("MAYBE"); // emits two error messages + BOOST_CHECK_MESSAGE(ok == FALSE, "did accept 'MAYBE'"); + BOOST_CHECK_MESSAGE(TestSuite::GetReadErrorCount() == 1, "did not emit error"); + TestSuite::PopMessageSuppressFilters(); + TestSuite::ResetReadErrorCount(); + + ok = field.set("0"); + BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept '0'"); + BOOST_CHECK_EQUAL(field.getValue(), FALSE); + ok = field.set("1"); + BOOST_CHECK_MESSAGE(ok == TRUE, "did not accept '1'"); + BOOST_CHECK_EQUAL(field.getValue(), TRUE); + + static const char * filters2[] = { "Illegal value", NULL }; + TestSuite::PushMessageSuppressFilters(filters2); + ok = field.set("2"); + BOOST_CHECK_MESSAGE(ok == FALSE, "did accept '2'"); + TestSuite::PopMessageSuppressFilters(); + TestSuite::ResetReadErrorCount(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFBox2dTest.cpp b/testsuite/fields/SoSFBox2dTest.cpp new file mode 100644 index 00000000000..3ec46b9028a --- /dev/null +++ b/testsuite/fields/SoSFBox2dTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFBox2d_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFBox2d_initialized) +{ + SoSFBox2d field; + BOOST_CHECK_MESSAGE(SoSFBox2d::getClassTypeId() != SoType::badType(), + "SoSFBox2d class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFBox2fTest.cpp b/testsuite/fields/SoSFBox2fTest.cpp new file mode 100644 index 00000000000..44a84686cbb --- /dev/null +++ b/testsuite/fields/SoSFBox2fTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFBox2f_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFBox2f_initialized) +{ + SoSFBox2f field; + BOOST_CHECK_MESSAGE(SoSFBox2f::getClassTypeId() != SoType::badType(), + "SoSFBox2f class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFBox2i32Test.cpp b/testsuite/fields/SoSFBox2i32Test.cpp new file mode 100644 index 00000000000..c671f66c522 --- /dev/null +++ b/testsuite/fields/SoSFBox2i32Test.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFBox2i32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFBox2i32_initialized) +{ + SoSFBox2i32 field; + BOOST_CHECK_MESSAGE(SoSFBox2i32::getClassTypeId() != SoType::badType(), + "SoSFBox2i32 class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFBox2sTest.cpp b/testsuite/fields/SoSFBox2sTest.cpp new file mode 100644 index 00000000000..24e96233f16 --- /dev/null +++ b/testsuite/fields/SoSFBox2sTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFBox2s_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFBox2s_initialized) +{ + SoSFBox2s field; + BOOST_CHECK_MESSAGE(SoSFBox2s::getClassTypeId() != SoType::badType(), + "SoSFBox2s class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFBox3dTest.cpp b/testsuite/fields/SoSFBox3dTest.cpp new file mode 100644 index 00000000000..c2c7dfd276d --- /dev/null +++ b/testsuite/fields/SoSFBox3dTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFBox3d_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFBox3d_initialized) +{ + SoSFBox3d field; + BOOST_CHECK_MESSAGE(SoSFBox3d::getClassTypeId() != SoType::badType(), + "SoSFBox3d class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFBox3fTest.cpp b/testsuite/fields/SoSFBox3fTest.cpp new file mode 100644 index 00000000000..28aac9dc7d1 --- /dev/null +++ b/testsuite/fields/SoSFBox3fTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFBox3f_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFBox3f_initialized) +{ + SoSFBox3f field; + BOOST_CHECK_MESSAGE(SoSFBox3f::getClassTypeId() != SoType::badType(), + "SoSFBox3f class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFBox3i32Test.cpp b/testsuite/fields/SoSFBox3i32Test.cpp new file mode 100644 index 00000000000..872a0d16919 --- /dev/null +++ b/testsuite/fields/SoSFBox3i32Test.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFBox3i32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFBox3i32_initialized) +{ + SoSFBox3i32 field; + BOOST_CHECK_MESSAGE(SoSFBox3i32::getClassTypeId() != SoType::badType(), + "SoSFBox3i32 class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFBox3sTest.cpp b/testsuite/fields/SoSFBox3sTest.cpp new file mode 100644 index 00000000000..25737f368a0 --- /dev/null +++ b/testsuite/fields/SoSFBox3sTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFBox3s_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFBox3s_initialized) +{ + SoSFBox3s field; + BOOST_CHECK_MESSAGE(SoSFBox3s::getClassTypeId() != SoType::badType(), + "SoSFBox3s class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFColorRGBATest.cpp b/testsuite/fields/SoSFColorRGBATest.cpp new file mode 100644 index 00000000000..85d6b464c02 --- /dev/null +++ b/testsuite/fields/SoSFColorRGBATest.cpp @@ -0,0 +1,84 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFColorRGBA_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFColorRGBA_initialized) +{ + SoSFColorRGBA field; + BOOST_CHECK_MESSAGE(SoSFColorRGBA::getClassTypeId() != SoType::badType(), + "SoSFColorRGBA class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + +BOOST_AUTO_TEST_CASE(textinput) +{ + SbBool ok; + SoSFColorRGBA field; + ok = field.set("0.0 .5 0 1"); + BOOST_CHECK_MESSAGE(ok == TRUE, "could not set value"); + BOOST_CHECK_EQUAL(field.getValue(), SbColorRGBA(0, .5, 0, 1)); + ok = field.set("0 0.5 1"); + BOOST_CHECK_MESSAGE(ok == FALSE, "accepted invalid (missing component) value"); + ok = field.set("1 2 3 4"); + //BOOST_CHECK_MESSAGE(ok == FALSE, "accepted out-of-range value"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFColorTest.cpp b/testsuite/fields/SoSFColorTest.cpp new file mode 100644 index 00000000000..d3bbf0d4c97 --- /dev/null +++ b/testsuite/fields/SoSFColorTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFColor_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFColor_initialized) +{ + SoSFColor field; + BOOST_CHECK_MESSAGE(SoSFColor::getClassTypeId() != SoType::badType(), + "SoSFColor class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFDoubleTest.cpp b/testsuite/fields/SoSFDoubleTest.cpp new file mode 100644 index 00000000000..35f8f3d5ab2 --- /dev/null +++ b/testsuite/fields/SoSFDoubleTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFDouble_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFDouble_initialized) +{ + SoSFDouble field; + BOOST_CHECK_MESSAGE(SoSFDouble::getClassTypeId() != SoType::badType(), + "SoSFDouble class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFEngineTest.cpp b/testsuite/fields/SoSFEngineTest.cpp new file mode 100644 index 00000000000..0560758ac89 --- /dev/null +++ b/testsuite/fields/SoSFEngineTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFEngine_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFEngine_initialized) +{ + SoSFEngine field; + BOOST_CHECK_MESSAGE(SoSFEngine::getClassTypeId() != SoType::badType(), + "SoSFEngine class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFEnumTest.cpp b/testsuite/fields/SoSFEnumTest.cpp new file mode 100644 index 00000000000..e6334f994db --- /dev/null +++ b/testsuite/fields/SoSFEnumTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFEnum_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFEnum_initialized) +{ + SoSFEnum field; + BOOST_CHECK_MESSAGE(SoSFEnum::getClassTypeId() != SoType::badType(), + "SoSFEnum class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFFloatTest.cpp b/testsuite/fields/SoSFFloatTest.cpp new file mode 100644 index 00000000000..38bb6cf2d94 --- /dev/null +++ b/testsuite/fields/SoSFFloatTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFFloat_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFFloat_initialized) +{ + SoSFFloat field; + BOOST_CHECK_MESSAGE(SoSFFloat::getClassTypeId() != SoType::badType(), + "SoSFFloat class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFImage3Test.cpp b/testsuite/fields/SoSFImage3Test.cpp new file mode 100644 index 00000000000..891e5f67482 --- /dev/null +++ b/testsuite/fields/SoSFImage3Test.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFImage3_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFImage3_initialized) +{ + SoSFImage3 field; + BOOST_CHECK_MESSAGE(SoSFImage3::getClassTypeId() != SoType::badType(), + "SoSFImage3 class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFImageTest.cpp b/testsuite/fields/SoSFImageTest.cpp new file mode 100644 index 00000000000..1933ef582bb --- /dev/null +++ b/testsuite/fields/SoSFImageTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFImage_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFImage_initialized) +{ + SoSFImage field; + BOOST_CHECK_MESSAGE(SoSFImage::getClassTypeId() != SoType::badType(), + "SoSFImage class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFInt32Test.cpp b/testsuite/fields/SoSFInt32Test.cpp new file mode 100644 index 00000000000..16cc942f13b --- /dev/null +++ b/testsuite/fields/SoSFInt32Test.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFInt32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFInt32_initialized) +{ + SoSFInt32 field; + BOOST_CHECK_MESSAGE(SoSFInt32::getClassTypeId() != SoType::badType(), + "SoSFInt32 class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFMatrixTest.cpp b/testsuite/fields/SoSFMatrixTest.cpp new file mode 100644 index 00000000000..8a16877b64f --- /dev/null +++ b/testsuite/fields/SoSFMatrixTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFMatrix_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFMatrix_initialized) +{ + SoSFMatrix field; + BOOST_CHECK_MESSAGE(SoSFMatrix::getClassTypeId() != SoType::badType(), + "SoSFMatrix class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFNameTest.cpp b/testsuite/fields/SoSFNameTest.cpp new file mode 100644 index 00000000000..82c9c5f2157 --- /dev/null +++ b/testsuite/fields/SoSFNameTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFName_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFName_initialized) +{ + SoSFName field; + BOOST_CHECK_MESSAGE(SoSFName::getClassTypeId() != SoType::badType(), + "SoSFName class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFNodeTest.cpp b/testsuite/fields/SoSFNodeTest.cpp new file mode 100644 index 00000000000..fc006e73126 --- /dev/null +++ b/testsuite/fields/SoSFNodeTest.cpp @@ -0,0 +1,94 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +BOOST_AUTO_TEST_SUITE(SoSFNode_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFNode_initialized) +{ + SoSFNode field; + BOOST_CHECK_MESSAGE(SoSFNode::getClassTypeId() != SoType::badType(), + "SoSFNode class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + +#ifdef HAVE_VRML97 +BOOST_AUTO_TEST_CASE(vrml97nullchild) +{ + // NULL values for children must be allowed, or we break VRML97 + // support. -mortene. + char scene[] = "#VRML V2.0 utf8\n\nAppearance { material NULL }"; + + SoInput * in = new SoInput; + in->setBuffer(reinterpret_cast(scene), strlen(scene)); + SoNode * g = NULL; + const SbBool readok = SoDB::read(in, g); + delete in; + + BOOST_CHECK_MESSAGE(readok, + "failed to read VRML97 with NULL child in graph"); + if (g) { + g->ref(); + g->unref(); + } +} +#endif + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFPathTest.cpp b/testsuite/fields/SoSFPathTest.cpp new file mode 100644 index 00000000000..4f714bbfe80 --- /dev/null +++ b/testsuite/fields/SoSFPathTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFPath_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFPath_initialized) +{ + SoSFPath field; + BOOST_CHECK_MESSAGE(SoSFPath::getClassTypeId() != SoType::badType(), + "SoSFPath class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFPlaneTest.cpp b/testsuite/fields/SoSFPlaneTest.cpp new file mode 100644 index 00000000000..a13946152cd --- /dev/null +++ b/testsuite/fields/SoSFPlaneTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFPlane_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFPlane_initialized) +{ + SoSFPlane field; + BOOST_CHECK_MESSAGE(SoSFPlane::getClassTypeId() != SoType::badType(), + "SoSFPlane class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFRotationTest.cpp b/testsuite/fields/SoSFRotationTest.cpp new file mode 100644 index 00000000000..c80bb75cbc0 --- /dev/null +++ b/testsuite/fields/SoSFRotationTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFRotation_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFRotation_initialized) +{ + SoSFRotation field; + BOOST_CHECK_MESSAGE(SoSFRotation::getClassTypeId() != SoType::badType(), + "SoSFRotation class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFShortTest.cpp b/testsuite/fields/SoSFShortTest.cpp new file mode 100644 index 00000000000..e613e3ea858 --- /dev/null +++ b/testsuite/fields/SoSFShortTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFShort_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFShort_initialized) +{ + SoSFShort field; + BOOST_CHECK_MESSAGE(SoSFShort::getClassTypeId() != SoType::badType(), + "SoSFShort class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFStringTest.cpp b/testsuite/fields/SoSFStringTest.cpp new file mode 100644 index 00000000000..fb8a8b6faf9 --- /dev/null +++ b/testsuite/fields/SoSFStringTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFString_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFString_initialized) +{ + SoSFString field; + BOOST_CHECK_MESSAGE(SoSFString::getClassTypeId() != SoType::badType(), + "SoSFString class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFTimeTest.cpp b/testsuite/fields/SoSFTimeTest.cpp new file mode 100644 index 00000000000..b7e7c58b333 --- /dev/null +++ b/testsuite/fields/SoSFTimeTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFTime_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFTime_initialized) +{ + SoSFTime field; + BOOST_CHECK_MESSAGE(SoSFTime::getClassTypeId() != SoType::badType(), + "SoSFTime class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFTriggerTest.cpp b/testsuite/fields/SoSFTriggerTest.cpp new file mode 100644 index 00000000000..d546e67ace6 --- /dev/null +++ b/testsuite/fields/SoSFTriggerTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFTrigger_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFTrigger_initialized) +{ + SoSFTrigger field; + BOOST_CHECK_MESSAGE(SoSFTrigger::getClassTypeId() != SoType::badType(), + "SoSFTrigger class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFUInt32Test.cpp b/testsuite/fields/SoSFUInt32Test.cpp new file mode 100644 index 00000000000..94acda38a16 --- /dev/null +++ b/testsuite/fields/SoSFUInt32Test.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFUInt32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFUInt32_initialized) +{ + SoSFUInt32 field; + BOOST_CHECK_MESSAGE(SoSFUInt32::getClassTypeId() != SoType::badType(), + "SoSFUInt32 class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFUShortTest.cpp b/testsuite/fields/SoSFUShortTest.cpp new file mode 100644 index 00000000000..65621b10e67 --- /dev/null +++ b/testsuite/fields/SoSFUShortTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFUShort_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFUShort_initialized) +{ + SoSFUShort field; + BOOST_CHECK_MESSAGE(SoSFUShort::getClassTypeId() != SoType::badType(), + "SoSFUShort class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec2bTest.cpp b/testsuite/fields/SoSFVec2bTest.cpp new file mode 100644 index 00000000000..63e24b265fe --- /dev/null +++ b/testsuite/fields/SoSFVec2bTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec2b_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec2b_initialized) +{ + SoSFVec2b field; + BOOST_CHECK_MESSAGE(SoSFVec2b::getClassTypeId() != SoType::badType(), + "SoSFVec2b class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec2dTest.cpp b/testsuite/fields/SoSFVec2dTest.cpp new file mode 100644 index 00000000000..5b23c4b951b --- /dev/null +++ b/testsuite/fields/SoSFVec2dTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec2d_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec2d_initialized) +{ + SoSFVec2d field; + BOOST_CHECK_MESSAGE(SoSFVec2d::getClassTypeId() != SoType::badType(), + "SoSFVec2d class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec2fTest.cpp b/testsuite/fields/SoSFVec2fTest.cpp new file mode 100644 index 00000000000..349aa7ad4e3 --- /dev/null +++ b/testsuite/fields/SoSFVec2fTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec2f_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec2f_initialized) +{ + SoSFVec2f field; + BOOST_CHECK_MESSAGE(SoSFVec2f::getClassTypeId() != SoType::badType(), + "SoSFVec2f class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec2i32Test.cpp b/testsuite/fields/SoSFVec2i32Test.cpp new file mode 100644 index 00000000000..b7bf98ca43b --- /dev/null +++ b/testsuite/fields/SoSFVec2i32Test.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec2i32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec2i32_initialized) +{ + SoSFVec2i32 field; + BOOST_CHECK_MESSAGE(SoSFVec2i32::getClassTypeId() != SoType::badType(), + "SoSFVec2i32 class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec2sTest.cpp b/testsuite/fields/SoSFVec2sTest.cpp new file mode 100644 index 00000000000..af22d894cc5 --- /dev/null +++ b/testsuite/fields/SoSFVec2sTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec2s_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec2s_initialized) +{ + SoSFVec2s field; + BOOST_CHECK_MESSAGE(SoSFVec2s::getClassTypeId() != SoType::badType(), + "SoSFVec2s class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec3bTest.cpp b/testsuite/fields/SoSFVec3bTest.cpp new file mode 100644 index 00000000000..f1b03890c09 --- /dev/null +++ b/testsuite/fields/SoSFVec3bTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec3b_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec3b_initialized) +{ + SoSFVec3b field; + BOOST_CHECK_MESSAGE(SoSFVec3b::getClassTypeId() != SoType::badType(), + "SoSFVec3b class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec3dTest.cpp b/testsuite/fields/SoSFVec3dTest.cpp new file mode 100644 index 00000000000..54cbcec6302 --- /dev/null +++ b/testsuite/fields/SoSFVec3dTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec3d_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec3d_initialized) +{ + SoSFVec3d field; + BOOST_CHECK_MESSAGE(SoSFVec3d::getClassTypeId() != SoType::badType(), + "SoSFVec3d class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec3fTest.cpp b/testsuite/fields/SoSFVec3fTest.cpp new file mode 100644 index 00000000000..9cabab2c425 --- /dev/null +++ b/testsuite/fields/SoSFVec3fTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec3f_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec3f_initialized) +{ + SoSFVec3f field; + BOOST_CHECK_MESSAGE(SoSFVec3f::getClassTypeId() != SoType::badType(), + "SoSFVec3f class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec3i32Test.cpp b/testsuite/fields/SoSFVec3i32Test.cpp new file mode 100644 index 00000000000..c09552e5b81 --- /dev/null +++ b/testsuite/fields/SoSFVec3i32Test.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec3i32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec3i32_initialized) +{ + SoSFVec3i32 field; + BOOST_CHECK_MESSAGE(SoSFVec3i32::getClassTypeId() != SoType::badType(), + "SoSFVec3i32 class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec3sTest.cpp b/testsuite/fields/SoSFVec3sTest.cpp new file mode 100644 index 00000000000..00f72b087a2 --- /dev/null +++ b/testsuite/fields/SoSFVec3sTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec3s_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec3s_initialized) +{ + SoSFVec3s field; + BOOST_CHECK_MESSAGE(SoSFVec3s::getClassTypeId() != SoType::badType(), + "SoSFVec3s class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec4bTest.cpp b/testsuite/fields/SoSFVec4bTest.cpp new file mode 100644 index 00000000000..73882c51a3a --- /dev/null +++ b/testsuite/fields/SoSFVec4bTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec4b_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec4b_initialized) +{ + SoSFVec4b field; + BOOST_CHECK_MESSAGE(SoSFVec4b::getClassTypeId() != SoType::badType(), + "SoSFVec4b class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec4dTest.cpp b/testsuite/fields/SoSFVec4dTest.cpp new file mode 100644 index 00000000000..c52b589e088 --- /dev/null +++ b/testsuite/fields/SoSFVec4dTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec4d_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec4d_initialized) +{ + SoSFVec4d field; + BOOST_CHECK_MESSAGE(SoSFVec4d::getClassTypeId() != SoType::badType(), + "SoSFVec4d class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec4fTest.cpp b/testsuite/fields/SoSFVec4fTest.cpp new file mode 100644 index 00000000000..a51d5bd8f30 --- /dev/null +++ b/testsuite/fields/SoSFVec4fTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec4f_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec4f_initialized) +{ + SoSFVec4f field; + BOOST_CHECK_MESSAGE(SoSFVec4f::getClassTypeId() != SoType::badType(), + "SoSFVec4f class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec4i32Test.cpp b/testsuite/fields/SoSFVec4i32Test.cpp new file mode 100644 index 00000000000..a0183be56da --- /dev/null +++ b/testsuite/fields/SoSFVec4i32Test.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec4i32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec4i32_initialized) +{ + SoSFVec4i32 field; + BOOST_CHECK_MESSAGE(SoSFVec4i32::getClassTypeId() != SoType::badType(), + "SoSFVec4i32 class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec4sTest.cpp b/testsuite/fields/SoSFVec4sTest.cpp new file mode 100644 index 00000000000..996a82a54e0 --- /dev/null +++ b/testsuite/fields/SoSFVec4sTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec4s_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec4s_initialized) +{ + SoSFVec4s field; + BOOST_CHECK_MESSAGE(SoSFVec4s::getClassTypeId() != SoType::badType(), + "SoSFVec4s class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec4ubTest.cpp b/testsuite/fields/SoSFVec4ubTest.cpp new file mode 100644 index 00000000000..c9ddc49d1ab --- /dev/null +++ b/testsuite/fields/SoSFVec4ubTest.cpp @@ -0,0 +1,86 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec4ub_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec4ub_initialized) +{ + BOOST_CHECK_MESSAGE(SoSFVec4ub::getClassTypeId() != SoType::badType(), + "SoSFVec4ub class not initialized"); + SoSFVec4ub field; + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "SoSFVec4ub object wrongly initialized"); + // no default value initialization to test + field.setValue(1, 2, 3, 4); + BOOST_CHECK_EQUAL(field.getValue(), SbVec4ub(1, 2, 3, 4)); +} + +BOOST_AUTO_TEST_CASE(textinput) +{ + TestSuite::ResetReadErrorCount(); + SbBool ok; + SoSFVec4ub field; + ok = field.set("1 2 3 4"); + BOOST_CHECK_MESSAGE(ok == TRUE, "SoSFVec4ub read error"); + BOOST_CHECK_EQUAL(field.getValue(), SbVec4ub(1, 2, 3, 4)); + BOOST_CHECK_EQUAL(TestSuite::GetReadErrorCount(), 0); + TestSuite::ResetReadErrorCount(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec4ui32Test.cpp b/testsuite/fields/SoSFVec4ui32Test.cpp new file mode 100644 index 00000000000..8f5212f4777 --- /dev/null +++ b/testsuite/fields/SoSFVec4ui32Test.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec4ui32_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec4ui32_initialized) +{ + SoSFVec4ui32 field; + BOOST_CHECK_MESSAGE(SoSFVec4ui32::getClassTypeId() != SoType::badType(), + "SoSFVec4ui32 class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/fields/SoSFVec4usTest.cpp b/testsuite/fields/SoSFVec4usTest.cpp new file mode 100644 index 00000000000..1d808438672 --- /dev/null +++ b/testsuite/fields/SoSFVec4usTest.cpp @@ -0,0 +1,93 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoSFVec4us_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoSFVec4us_initialized) +{ + SoSFVec4us field; + BOOST_CHECK_MESSAGE(SoSFVec4us::getClassTypeId() != SoType::badType(), + "SoSFVec4us class not initialized"); + BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), + "missing class initialization"); +} + +BOOST_AUTO_TEST_CASE(textinput) +{ + SoSFVec4us field; + field.set("1 2 3 4"); + BOOST_CHECK_EQUAL(field.getValue(), SbVec4us(1, 2, 3, 4)); + const char * filters[] = { "read error", NULL }; // all read error messages + TestSuite::ResetReadErrorCount(); + // TestSuite::PushMessageSuppressFilters(filters); + SbBool ok; + ok = field.set("-3 4 32 3"); // should emit error message on '-3' + BOOST_CHECK_EQUAL(ok, FALSE); + //BOOST_CHECK_EQUAL(TestSuite::GetReadErrorCount(), 1); + ok = field.set("3 525 32 3"); // should emit error message on '525' + //BOOST_CHECK_EQUAL(ok, FALSE); + //BOOST_CHECK_EQUAL(TestSuite::GetReadErrorCount(), 2); + ok = field.set("3 32 3"); // error on account of too few numbers + BOOST_CHECK_EQUAL(ok, FALSE); + //BOOST_CHECK_EQUAL(TestSuite::GetReadErrorCount(), 3); + // TestSuite::PopMessageSuppressFilters(); + TestSuite::ResetReadErrorCount(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/geo/SoGeoCoordinateTest.cpp b/testsuite/geo/SoGeoCoordinateTest.cpp new file mode 100644 index 00000000000..99311fccdf1 --- /dev/null +++ b/testsuite/geo/SoGeoCoordinateTest.cpp @@ -0,0 +1,72 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoGeoCoordinate_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoGeoCoordinate_initialized) +{ + BOOST_CHECK_MESSAGE(SoGeoCoordinate::getClassTypeId() != SoType::badType(), + "SoGeoCoordinate class not initialized"); + SoRefPtr node(new SoGeoCoordinate); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "missing class initialization"); + BOOST_CHECK_EQUAL(node->point.getNum(), 1); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/geo/SoGeoElementTest.cpp b/testsuite/geo/SoGeoElementTest.cpp new file mode 100644 index 00000000000..5fa3c41e3b1 --- /dev/null +++ b/testsuite/geo/SoGeoElementTest.cpp @@ -0,0 +1,68 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoGeoElement_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoGeoElement_initialized) +{ + BOOST_CHECK_MESSAGE(SoGeoElement::getClassStackIndex() != -1, + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/geo/SoGeoLocationTest.cpp b/testsuite/geo/SoGeoLocationTest.cpp new file mode 100644 index 00000000000..8cf03ff518c --- /dev/null +++ b/testsuite/geo/SoGeoLocationTest.cpp @@ -0,0 +1,72 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoGeoLocation_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoGeoLocation_initialized) +{ + SoGeoLocation * node = new SoGeoLocation; + assert(node); + node->ref(); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "missing class initialization"); + node->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/geo/SoGeoOriginTest.cpp b/testsuite/geo/SoGeoOriginTest.cpp new file mode 100644 index 00000000000..dfc18135863 --- /dev/null +++ b/testsuite/geo/SoGeoOriginTest.cpp @@ -0,0 +1,72 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoGeoOrigin_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoGeoOrigin_initialized) +{ + SoGeoOrigin * node = new SoGeoOrigin; + assert(node); + node->ref(); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "missing class initialization"); + node->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/geo/SoGeoSeparatorTest.cpp b/testsuite/geo/SoGeoSeparatorTest.cpp new file mode 100644 index 00000000000..1d91e470fa3 --- /dev/null +++ b/testsuite/geo/SoGeoSeparatorTest.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoGeoSeparator_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoGeoSeparator_initialized) +{ + BOOST_CHECK_MESSAGE(SoGeoSeparator::getClassTypeId() != SoType::badType(), + "SoGeoSeparator class not initialized"); + SoRefPtr node(new SoGeoSeparator); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "SoGeoSeparator object wrongly initialized"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/misc/SoBasePTest.cpp b/testsuite/misc/SoBasePTest.cpp new file mode 100644 index 00000000000..9a234d10b6c --- /dev/null +++ b/testsuite/misc/SoBasePTest.cpp @@ -0,0 +1,116 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +#include +#include +#include +BOOST_AUTO_TEST_SUITE(SoBaseP_TestSuite); + + +// Tests whether or not our mechanisms with the realTime field works +// correctly upon references to it in imported iv-files. +// +// (Added this test when it was suspected that a new realTime +// globalfield was made upon import due to bug(s) in +// SoBase::PImpl::readBaseInstance()). +// +// -mortene + +BOOST_AUTO_TEST_CASE(realTime_globalfield_import) +{ + // SoDB::init() already called by test-suite init, and the realTime + // global field will be set up there + + //Store away the state before we mess with the global realTime field + SoSFTime * realtime = (SoSFTime *)SoDB::getGlobalField("realTime"); + assert(realtime); + SbTime realTimeStorage = realtime->getValue(); + + char scene[] = + "#Inventor V2.1 ascii\n\n" + "RotationXYZ {" + " angle = GlobalField {" + " type \"SFTime\"" + " realTime 0" + " }" + " . realTime " + "}"; + + SoInput * in = new SoInput; + in->setBuffer(scene, strlen(scene)); + SoNode * g = NULL; + const SbBool readok = SoDB::read(in, g); + assert(readok); // that import is ok is tested by a case in SoDB.cpp + delete in; + + // check that the global field is still the same instance + SoSFTime * realtimeafter = (SoSFTime *)SoDB::getGlobalField("realTime"); + BOOST_CHECK_MESSAGE(realtime == realtimeafter, + "internal realTime SoGlobalField value changed upon iv import"); + + // clean up + g->ref(); + g->unref(); + + //Restore state + realtime->setValue(realTimeStorage); + +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/misc/SoBaseTest.cpp b/testsuite/misc/SoBaseTest.cpp new file mode 100644 index 00000000000..ee582181939 --- /dev/null +++ b/testsuite/misc/SoBaseTest.cpp @@ -0,0 +1,327 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +#include +#include +#include +#include +BOOST_AUTO_TEST_SUITE(SoBase_TestSuite); + + +/*This test targets the implementation of SoWriterefCounter::getWriteName + in the source file SoWriterefCounter.cpp. Test is put here because the + SoWriterefCounter class is not part of the public API. It is being called + from here + */ + + static char * buffer; + static size_t buffer_size = 0; + +// +// If function is copied from SoWriterefCounter.cpp as pricate classes cannot be called from the test suite +// + static SbBool +dont_mangle_output_names(const SoBase *base) +{ + static int COIN_DONT_MANGLE_OUTPUT_NAMES = -1; + + // Always unmangle node names in VRML1 and VRML2 + if (base->isOfType(SoNode::getClassTypeId()) && + (((SoNode *)base)->getNodeType()==SoNode::VRML1 || + ((SoNode *)base)->getNodeType()==SoNode::VRML2)) return TRUE; + + if (COIN_DONT_MANGLE_OUTPUT_NAMES < 0) { + COIN_DONT_MANGLE_OUTPUT_NAMES = 0; + const char * env = coin_getenv("COIN_DONT_MANGLE_OUTPUT_NAMES"); + if (env) COIN_DONT_MANGLE_OUTPUT_NAMES = atoi(env); + } + return COIN_DONT_MANGLE_OUTPUT_NAMES ? TRUE : FALSE; +} + + static void * + buffer_realloc(void * bufptr, size_t size) + { + buffer = (char *)realloc(bufptr, size); + buffer_size = size; + return buffer; + } + + +BOOST_AUTO_TEST_CASE(checkWriteWithMultiref) +{ + SoDB::init(); + SoNode* scenegraph; + SoSeparator *root = new SoSeparator; + root->ref(); + root->setName("root"); + scenegraph = root; + SoSeparator *n0 = new SoSeparator; + SoSeparator *a0 = new SoSeparator; + SoSeparator *a1 = new SoSeparator; + SoSeparator *a2 = new SoSeparator; + SoSeparator *a3 = new SoSeparator; + SoSeparator *b0 = new SoSeparator; + SoSeparator *b1 = new SoSeparator; + SoSeparator *b2 = new SoSeparator; + SoSeparator *b3 = new SoSeparator; + SoSeparator *b4 = new SoSeparator; + SoSeparator *c0 = new SoSeparator; + + a2->setName(SbName("MyName")); + b0->setName(SbName("MyName")); + b1->setName(SbName("MyName")); + b2->setName(SbName("MyName")); + b4->setName(SbName("MyName")); + c0->setName(SbName("MyName")); + + root->addChild(n0); + root->addChild(n0); + root->addChild(a0); + a0->addChild(b0); + a0->addChild(b1); + root->addChild(b0); + root->addChild(a1); + a1->addChild(b2); + a1->addChild(b1); + root->addChild(b1); + root->addChild(a2); + root->addChild(a2); + root->addChild(a3); + a3->addChild(b3); + b3->addChild(c0); + b3->addChild(c0); + a3->addChild(b4); + a3->addChild(a2); + + + +/* + Correct output file if dont_mangle_names: + +#VRML V1.0 ascii + +VRMLGroup { + children + DEF root VRMLGroup { + children [ + DEF _+0 VRMLGroup { + }, + USE _+0, + DEF _+1 VRMLGroup { + children [ + DEF MyName VRMLGroup { + }, + DEF MyName+2 VRMLGroup { + } ] + }, + USE MyName, + DEF _+3 VRMLGroup { + children [ + DEF MyName+4 VRMLGroup { + }, + USE MyName+2 ] + }, + USE MyName+2, + DEF MyName+5 VRMLGroup { + }, + USE MyName+5, + DEF _+6 VRMLGroup { + children [ + DEF _+7 VRMLGroup { + children [ + DEF MyName+8 VRMLGroup { + }, + USE MyName+8 ] + }, + DEF MyName+9 VRMLGroup { + }, + USE MyName+5 ] + } ] + } +} + */ + + /* correct outputfile for default OIV behavior: +#VRML V1.0 ascii + +DEF root Separator { + DEF _+0 Separator { + } + USE _+0 + Separator { + DEF MyName Separator { + } + DEF MyName+1 Separator { + } + } + USE MyName + Separator { + DEF MyName+2 Separator { + } + USE MyName+1 + } + USE MyName+1 + DEF MyName+3 Separator { + } + USE MyName+3 + Separator { + Separator { + DEF MyName+4 Separator { + } + USE MyName+4 + } + DEF MyName+5 Separator { + } + USE MyName+3 + } +} +*/ + +#ifdef HAVE_VRML97 + SoVRMLGroup *newroot; + for(int j=0;j<2;j++) { + if(j==1) { + SoToVRML2Action tovrml2; + tovrml2.apply(root); + newroot = tovrml2.getVRML2SceneGraph(); + newroot->ref(); + scenegraph = newroot; + } + + + buffer = (char*)malloc(1024); + SoOutput out; + // out.openFile("out.wrl"); + out.setBuffer(buffer, 1024,buffer_realloc); + out.setHeaderString(SbString("#VRML V1.0 ascii")); + SoWriteAction wra(&out); + wra.apply(scenegraph); + SbString s(buffer); + free(buffer); + + int pos; + SbString ss; + + SbList node_names(15); + if(j==1) + BOOST_CHECK_MESSAGE(dont_mangle_output_names(scenegraph)==TRUE,"don't mangle should be TRUE"); + else + BOOST_CHECK_MESSAGE(dont_mangle_output_names(scenegraph)==FALSE,"don't mangle should be FALSE"); + + if(dont_mangle_output_names(scenegraph)) { + node_names.append("_+0"); + node_names.append("_+0"); + node_names.append("_+1"); + node_names.append("MyName"); + node_names.append("MyName+2"); + node_names.append("MyName"); + node_names.append("_+3"); + node_names.append("MyName+4"); + node_names.append("MyName+2"); + node_names.append("MyName+2"); + node_names.append("MyName+5"); + node_names.append("MyName+5"); + node_names.append("_+6"); + node_names.append("_+7"); + node_names.append("MyName+8"); + node_names.append("MyName+8"); + node_names.append("MyName+9"); + node_names.append("MyName+5"); + } + else { + node_names.append("_+0"); + node_names.append("_+0"); + node_names.append("MyName"); + node_names.append("MyName+1"); + node_names.append("MyName"); + node_names.append("MyName+2"); + node_names.append("MyName+1"); + node_names.append("MyName+1"); + node_names.append("MyName+3"); + node_names.append("MyName+3"); + node_names.append("MyName+4"); + node_names.append("MyName+4"); + node_names.append("MyName+5"); + node_names.append("MyName+3"); + } + + int list_index = 0; + SbBool fail = false; + ss = s; + for(int i=0;iunref(); + newroot->unref(); +#endif + } + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/misc/SoDBTest.cpp b/testsuite/misc/SoDBTest.cpp new file mode 100644 index 00000000000..6fdf797a333 --- /dev/null +++ b/testsuite/misc/SoDBTest.cpp @@ -0,0 +1,270 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +BOOST_AUTO_TEST_SUITE(SoDB_TestSuite); + + +BOOST_AUTO_TEST_CASE(globalRealTimeField) +{ + //Need to do this here, since we do not have any manager that calls it for us. + SoDB::getSensorManager()->processTimerQueue(); + SoSFTime * realtime = (SoSFTime *)SoDB::getGlobalField("realTime"); + + BOOST_REQUIRE(realtime != NULL); + BOOST_REQUIRE(realtime->getContainer() != NULL); + + // check that realtime field actually is initialized with something + // close to actual time + const double clockdiff = + fabs(SbTime::getTimeOfDay().getValue() - realtime->getValue().getValue()); + BOOST_CHECK_MESSAGE(clockdiff < 5.0, + "realTime global field not close to actual time"); +} + +// Do-nothing error handler for ignoring read errors while testing. +static void +readErrorHandler(const SoError * error, void * data) +{ +} + +#ifdef HAVE_VRML97 +BOOST_AUTO_TEST_CASE(readChildList) +{ + static const char scene[] = "#VRML V2.0 utf8\n" + "DEF TestGroup Group { children [Group{}, Group{}, Group{}] }"; + SoInput in; + in.setBuffer(scene, strlen(scene)); + SoSeparator * root = SoDB::readAll(&in); + BOOST_REQUIRE(root); + root->ref(); + SoGroup * group = (SoGroup *) SoNode::getByName("TestGroup"); + BOOST_REQUIRE_MESSAGE(group->getNumChildren() == 3, "Unexpected number of children"); + for (int i = 0; i < group->getNumChildren(); i++) { + BOOST_REQUIRE_MESSAGE(group->getChild(i)->isOfType(SoGroup::getClassTypeId()), "Unexpected type"); + } + root->unref(); +} +#endif + +BOOST_AUTO_TEST_CASE(readEmptyChildList) +{ + // FIXME: We are forced to restore the global state before terminating, + // or independent tests could fail. (sveinung 20071108) + SoErrorCB * prevErrorCB = SoReadError::getHandlerCallback(); + SoReadError::setHandlerCallback(readErrorHandler, NULL); + + static const char scene[] = "#VRML V2.0 utf8\n" + "DEF TestGroup Group { children }"; + SoInput in; + in.setBuffer(scene, strlen(scene)); + SoSeparator * root = SoDB::readAll(&in); + if (root) { + SoGroup * group = (SoGroup *) SoNode::getByName("TestGroup"); + BOOST_CHECK_MESSAGE(group->getNumChildren() == 0, "Should have no children"); + } + BOOST_CHECK_MESSAGE(root == NULL, "Expected the import to fail"); + + SoReadError::setHandlerCallback(prevErrorCB, NULL); +} + +BOOST_AUTO_TEST_CASE(readNullChildList) +{ + // FIXME: We are forced to restore the global state before terminating, + // or independent tests could fail. (sveinung 20071108) + SoErrorCB * prevErrorCB = SoReadError::getHandlerCallback(); + SoReadError::setHandlerCallback(readErrorHandler, NULL); + + static const char scene[] = "#VRML V2.0 utf8\n" + "PROTO Object [ field MFNode testChildren NULL ] { }\n" + "DEF TestObject Object { }"; + SoInput in; + in.setBuffer(scene, strlen(scene)); + SoSeparator * root = SoDB::readAll(&in); + if (root) { + SoNode * object = (SoNode *) SoNode::getByName("TestObject"); + SoMFNode * field = (SoMFNode *) object->getField("testChildren"); + BOOST_CHECK_MESSAGE(field->getNumNodes() == 0, "Should have no children"); + } + BOOST_CHECK_MESSAGE(root == NULL, "Expected the import to fail"); + + SoReadError::setHandlerCallback(prevErrorCB, NULL); +} + +BOOST_AUTO_TEST_CASE(readInvalidChildList) +{ + // FIXME: We are forced to restore the global state before terminating, + // or independent tests could fail. (sveinung 20071108) + SoErrorCB * prevErrorCB = SoReadError::getHandlerCallback(); + SoReadError::setHandlerCallback(readErrorHandler, NULL); + + static const char scene[] = "#VRML V2.0 utf8\n" + "Group { children[0] }"; + SoInput in; + in.setBuffer(scene, strlen(scene)); + SoSeparator * root = SoDB::readAll(&in); + BOOST_CHECK_MESSAGE(root == NULL, "Expected the import to fail"); + + SoReadError::setHandlerCallback(prevErrorCB, NULL); +} + +BOOST_AUTO_TEST_CASE(testAlternateRepNull) +{ + // FIXME: We are forced to restore the global state before terminating, + // or independent tests could fail. (sveinung 20071108) + SoErrorCB * prevErrorCB = SoReadError::getHandlerCallback(); + SoReadError::setHandlerCallback(readErrorHandler, NULL); + + static const char scene[] = "#Inventor V2.1 ascii\n" + "ExtensionNode { fields [ SFNode alternateRep ] }"; + SoInput in; + in.setBuffer(scene, strlen(scene)); + SoSeparator * root = SoDB::readAll(&in); + BOOST_CHECK_MESSAGE(root, "Import should succeed"); + root->ref(); + root->unref(); + + SoReadError::setHandlerCallback(prevErrorCB, NULL); +} + +BOOST_AUTO_TEST_CASE(testInitCleanup) +{ + // init already called + SoDB::finish(); + + SoDB::init(); + SoDB::finish(); + + + //FIXME: This is not a true unittest, as it touches state for other functions. + // init for the conntinuing test running + SoDB::init(); + SoNodeKit::init(); + SoInteraction::init(); + SIM::Coin3D::Coin::TestSuite::Init(); + +} + +// ************************************************************************* + +// Tests whether or not our mechanisms with the realTime global field +// works correctly upon references to it in imported iv-files. +// +// (This test might be better suited in the SoGlobalField.cpp file, +// but that code doesn't implement a public API part, which causes +// hickups for the automated test-suite code-grabbing & setup.) +// +// -mortene + +BOOST_AUTO_TEST_CASE(globalfield_import) +{ + char scene[] = + "#Inventor V2.1 ascii\n\n" + "DEF rotnode RotationXYZ {" + " angle = GlobalField {" + " type \"SFTime\"" + " realTime 0" + " }" + " . realTime " + "}"; + + SoInput * in = new SoInput; + in->setBuffer(scene, strlen(scene)); + SoNode * g = NULL; + const SbBool readok = SoDB::read(in, g); + + delete in; + + // just to see that we're correct with the syntax + BOOST_CHECK_MESSAGE(readok, + "failed to read scene graph with realTime global field"); + if (!readok) { return; } + + g->ref(); + + SoSFTime * realtime = (SoSFTime *)SoDB::getGlobalField("realTime"); + + // supposed to get new value from file + BOOST_CHECK_MESSAGE(realtime->getValue().getValue() == 0.0, + "realTime global field value not updated from imported value"); + + SoRotationXYZ * r = (SoRotationXYZ *) + SoBase::getNamedBase("rotnode", SoRotationXYZ::getClassTypeId()); + assert(r); + + // check connection + SoField * master; + BOOST_CHECK_MESSAGE((r->angle.getNumConnections() == 1) && + r->angle.getConnectedField(master) && + (master == realtime), + "connection to realTime global field not set up properly"); + + g->unref(); +} + +// ************************************************************************* + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/misc/SoTypeTest.cpp b/testsuite/misc/SoTypeTest.cpp new file mode 100644 index 00000000000..26ddd0301e0 --- /dev/null +++ b/testsuite/misc/SoTypeTest.cpp @@ -0,0 +1,83 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +#include +BOOST_AUTO_TEST_SUITE(SoType_TestSuite); + + +static void * createInstance(void) +{ + return (void *)0x1234; +} + +BOOST_AUTO_TEST_CASE(testRemoveType) +{ + BOOST_CHECK_MESSAGE(SoType::fromName(SbName("MyClass")) == SoType::badType(), + "Type didn't init to badType"); + SoType newtype = SoType::createType(SoNode::getClassTypeId(), SbName("MyClass"), createInstance, 0); + BOOST_CHECK_MESSAGE(SoType::fromName(SbName("MyClass")) != SoType::badType(), + "Type didn't init correctly"); + bool success = SoType::removeType(SbName("MyClass")); + BOOST_CHECK_MESSAGE(success, + "removeType() failed"); + BOOST_CHECK_MESSAGE(SoType::fromName(SbName("MyClass")) == SoType::badType(), + "Type didn't deregister correctly"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/nodes/SoAnnotationTest.cpp b/testsuite/nodes/SoAnnotationTest.cpp new file mode 100644 index 00000000000..31fc146b6d6 --- /dev/null +++ b/testsuite/nodes/SoAnnotationTest.cpp @@ -0,0 +1,72 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoAnnotation_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoAnnotation_initialized) +{ + SoAnnotation * node = new SoAnnotation; + assert(node); + node->ref(); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "missing class initialization"); + node->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/scxml/SbStringConvertTest.cpp b/testsuite/scxml/SbStringConvertTest.cpp new file mode 100644 index 00000000000..51c5fb82b73 --- /dev/null +++ b/testsuite/scxml/SbStringConvertTest.cpp @@ -0,0 +1,169 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +#include +#include +BOOST_AUTO_TEST_SUITE(SbStringConvert_TestSuite); + + +BOOST_AUTO_TEST_CASE(SbVec3sfromString) { + typedef SbVec3s ToTest; + ToTest foo; + SbString test = "SbVec3s(1,-2,3)"; + ToTest trueVal(1,-2,3); + foo = SbStringConvert::fromString(test); + BOOST_CHECK_MESSAGE(trueVal == foo, + std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); +} + +BOOST_AUTO_TEST_CASE(SbVec3sToString) { + typedef SbVec3s ToTest; + SbString foo; + ToTest test(1,-2,3); + SbString trueVal = "SbVec3s(1, -2, 3)"; + foo = SbStringConvert::toString(test); + BOOST_CHECK_MESSAGE(trueVal == foo, + std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); +} + +BOOST_AUTO_TEST_CASE(SbVec3sfromSbVec3f) { + typedef SbVec3s ToTest; + ToTest foo; + SbString test = "SbVec3f(1,-2,3)"; + ToTest trueVal(1,-2,3); + SbBool conversionOk = TRUE; + foo = SbStringConvert::fromString(test, &conversionOk); + BOOST_CHECK_MESSAGE(conversionOk == FALSE, + std::string("Able to create SbVec3s from ") + test.getString()); +} + +BOOST_AUTO_TEST_CASE(SbVec3fToString) { + typedef SbVec3f ToTest; + SbString foo; + ToTest test(0.5,-0.25,0.125); + SbString trueVal = "SbVec3f(0.5, -0.25, 0.125)"; + foo = SbStringConvert::toString(test); + BOOST_CHECK_MESSAGE(trueVal == foo, + std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); +} + +BOOST_AUTO_TEST_CASE(SbVec3fToIntString) { + typedef SbVec3f ToTest; + SbString foo; + ToTest test(1,-2,3); + SbString trueVal = "SbVec3f(1, -2, 3)"; + foo = SbStringConvert::toString(test); + BOOST_CHECK_MESSAGE(trueVal == foo, + std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); +} + +BOOST_AUTO_TEST_CASE(SbVec3fFromIntString) { + typedef SbVec3f ToTest; + ToTest foo; + SbString test = "SbVec3f(1,-2,3)"; + ToTest trueVal(1,-2,3); + SbBool conversionOk = TRUE; + foo = SbStringConvert::fromString(test, &conversionOk); + BOOST_CHECK_MESSAGE(conversionOk && trueVal == foo, + std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); +} + +BOOST_AUTO_TEST_CASE(SbVec3fFromFloatString) { + typedef SbVec3f ToTest; + ToTest foo; + SbString test = "SbVec3f( 1.3 , -2.0 , 3.3 )"; + ToTest trueVal(1.3,-2.0,3.3); + SbBool conversionOk = TRUE; + foo = SbStringConvert::fromString(test, &conversionOk); + BOOST_CHECK_MESSAGE(conversionOk && trueVal == foo, + std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); +} + +BOOST_AUTO_TEST_CASE(SbRotationFromString) { + typedef SbRotation ToTest; + ToTest foo; + SbString test = "SbRotation(0.5,0.5 , 0.5, 0.5 )"; + ToTest trueVal(0.5,0.5,0.5,0.5); + SbBool conversionOk = FALSE; + foo = SbStringConvert::fromString(test, &conversionOk); + BOOST_CHECK_MESSAGE(conversionOk && trueVal == foo, + std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); +} + +BOOST_AUTO_TEST_CASE(SbRotationToString) { + typedef SbRotation ToTest; + SbString foo; + ToTest test(0.5,-0.5,-0.5,0.5); + SbString trueVal = "SbRotation(0.5, -0.5, -0.5, 0.5)"; + foo = SbStringConvert::toString(test); + BOOST_CHECK_MESSAGE(trueVal == foo, + std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); +} + +BOOST_AUTO_TEST_CASE(SbRotationToIntString) { + typedef SbRotation ToTest; + SbString foo; + ToTest test(0,0,0,1); + SbString trueVal = "SbRotation(0, 0, 0, 1)"; + foo = SbStringConvert::toString(test); + BOOST_CHECK_MESSAGE(trueVal == foo, + std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/scxml/ScXMLMinimumEvaluatorTest.cpp b/testsuite/scxml/ScXMLMinimumEvaluatorTest.cpp new file mode 100644 index 00000000000..3375bb02049 --- /dev/null +++ b/testsuite/scxml/ScXMLMinimumEvaluatorTest.cpp @@ -0,0 +1,99 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +BOOST_AUTO_TEST_SUITE(ScXMLMinimumEvaluator_TestSuite); + + +BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(MimimumExpressions,1); + +BOOST_AUTO_TEST_CASE(MimimumExpressions) +{ + std::unique_ptr sm(new ScXMLStateMachine); + std::unique_ptr evaluator(new ScXMLMinimumEvaluator); + + ScXMLDataObj * res = NULL; + ScXMLBoolDataObj * boolobj = NULL; + + //FIXME, this test is not finished. BFG 20090831 + + static const char foo [] = + ""; + /* + ScXMLDocument * doc = ScXMLDocument::readBuffer(SbByteBuffer(sizeof(foo),foo)); + assert(doc->getRoot()); + sm->setDescription(doc); + sm->setName(""); + sm->initialize(); + assert(sm->isActive() && !sm->isFinished()); + printf("%d\n", sm->getNumActiveStates()); + const ScXMLElt * elt = sm->getActiveState(0); + printf("%s\n",elt->getXMLAttribute("id")); + evaluator->setStateMachine(sm.get()); + res = evaluator->evaluate("In('active')"); + */ + +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/shaders/SoFragmentShaderTest.cpp b/testsuite/shaders/SoFragmentShaderTest.cpp new file mode 100644 index 00000000000..d4e6716b585 --- /dev/null +++ b/testsuite/shaders/SoFragmentShaderTest.cpp @@ -0,0 +1,72 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoFragmentShader_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoFragmentShader_initialized) +{ + SoFragmentShader * node = new SoFragmentShader; + assert(node); + node->ref(); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "missing class initialization"); + node->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/shaders/SoGeometryShaderTest.cpp b/testsuite/shaders/SoGeometryShaderTest.cpp new file mode 100644 index 00000000000..9f2b2e33e87 --- /dev/null +++ b/testsuite/shaders/SoGeometryShaderTest.cpp @@ -0,0 +1,72 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoGeometryShader_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoGeometryShader_initialized) +{ + SoGeometryShader * node = new SoGeometryShader; + assert(node); + node->ref(); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "missing class initialization"); + node->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/shaders/SoShaderParameterTest.cpp b/testsuite/shaders/SoShaderParameterTest.cpp new file mode 100644 index 00000000000..e5e61491071 --- /dev/null +++ b/testsuite/shaders/SoShaderParameterTest.cpp @@ -0,0 +1,222 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + + +#include + +BOOST_AUTO_TEST_SUITE(SoShaderParameter_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoShaderParameter_initialized) +{ + { + SoShaderParameter1f * parameter1f = new SoShaderParameter1f; + assert(parameter1f); + parameter1f->ref(); + BOOST_CHECK_MESSAGE(parameter1f->getTypeId() != SoType::badType(), + "missing class initialization"); + parameter1f->unref(); + } + { + SoShaderParameter1i * parameter1i = new SoShaderParameter1i; + assert(parameter1i); + parameter1i->ref(); + BOOST_CHECK_MESSAGE(parameter1i->getTypeId() != SoType::badType(), + "missing class initialization"); + parameter1i->unref(); + } + { + SoShaderParameter2f * parameter2f = new SoShaderParameter2f; + assert(parameter2f); + parameter2f->ref(); + BOOST_CHECK_MESSAGE(parameter2f->getTypeId() != SoType::badType(), + "missing class initialization"); + parameter2f->unref(); + } + { + SoShaderParameter2i * parameter2i = new SoShaderParameter2i; + assert(parameter2i); + parameter2i->ref(); + BOOST_CHECK_MESSAGE(parameter2i->getTypeId() != SoType::badType(), + "missing class initialization"); + parameter2i->unref(); + } + { + SoShaderParameter3f * parameter3f = new SoShaderParameter3f; + assert(parameter3f); + parameter3f->ref(); + BOOST_CHECK_MESSAGE(parameter3f->getTypeId() != SoType::badType(), + "missing class initialization"); + parameter3f->unref(); + } + { + SoShaderParameter3i * parameter3i = new SoShaderParameter3i; + assert(parameter3i); + parameter3i->ref(); + BOOST_CHECK_MESSAGE(parameter3i->getTypeId() != SoType::badType(), + "missing class initialization"); + parameter3i->unref(); + } + { + SoShaderParameter4f * parameter4f = new SoShaderParameter4f; + assert(parameter4f); + parameter4f->ref(); + BOOST_CHECK_MESSAGE(parameter4f->getTypeId() != SoType::badType(), + "missing class initialization"); + parameter4f->unref(); + } + { + SoShaderParameter4i * parameter4i = new SoShaderParameter4i; + assert(parameter4i); + parameter4i->ref(); + BOOST_CHECK_MESSAGE(parameter4i->getTypeId() != SoType::badType(), + "missing class initialization"); + parameter4i->unref(); + } + + { + SoShaderParameterArray1f * parametera1f = new SoShaderParameterArray1f; + assert(parametera1f); + parametera1f->ref(); + BOOST_CHECK_MESSAGE(parametera1f->getTypeId() != SoType::badType(), + "missing class initialization"); + parametera1f->unref(); + } + { + SoShaderParameterArray1i * parametera1i = new SoShaderParameterArray1i; + assert(parametera1i); + parametera1i->ref(); + BOOST_CHECK_MESSAGE(parametera1i->getTypeId() != SoType::badType(), + "missing class initialization"); + parametera1i->unref(); + } + { + SoShaderParameterArray2f * parametera2f = new SoShaderParameterArray2f; + assert(parametera2f); + parametera2f->ref(); + BOOST_CHECK_MESSAGE(parametera2f->getTypeId() != SoType::badType(), + "missing class initialization"); + parametera2f->unref(); + } + { + SoShaderParameterArray2i * parametera2i = new SoShaderParameterArray2i; + assert(parametera2i); + parametera2i->ref(); + BOOST_CHECK_MESSAGE(parametera2i->getTypeId() != SoType::badType(), + "missing class initialization"); + parametera2i->unref(); + } + { + SoShaderParameterArray3f * parametera3f = new SoShaderParameterArray3f; + assert(parametera3f); + parametera3f->ref(); + BOOST_CHECK_MESSAGE(parametera3f->getTypeId() != SoType::badType(), + "missing class initialization"); + parametera3f->unref(); + } + { + SoShaderParameterArray3i * parametera3i = new SoShaderParameterArray3i; + assert(parametera3i); + parametera3i->ref(); + BOOST_CHECK_MESSAGE(parametera3i->getTypeId() != SoType::badType(), + "missing class initialization"); + parametera3i->unref(); + } + { + SoShaderParameterArray4f * parametera4f = new SoShaderParameterArray4f; + assert(parametera4f); + parametera4f->ref(); + BOOST_CHECK_MESSAGE(parametera4f->getTypeId() != SoType::badType(), + "missing class initialization"); + parametera4f->unref(); + } + { + SoShaderParameterArray4i * parametera4i = new SoShaderParameterArray4i; + assert(parametera4i); + parametera4i->ref(); + BOOST_CHECK_MESSAGE(parametera4i->getTypeId() != SoType::badType(), + "missing class initialization"); + parametera4i->unref(); + } + + { + SoShaderParameterMatrix * matrix = new SoShaderParameterMatrix; + assert(matrix); + matrix->ref(); + BOOST_CHECK_MESSAGE(matrix->getTypeId() != SoType::badType(), + "missing class initialization"); + matrix->unref(); + } + { + SoShaderParameterMatrixArray * matrixarray = new SoShaderParameterMatrixArray; + assert(matrixarray); + matrixarray->ref(); + BOOST_CHECK_MESSAGE(matrixarray->getTypeId() != SoType::badType(), + "missing class initialization"); + matrixarray->unref(); + } + + { + SoShaderStateMatrixParameter * statematrix = new SoShaderStateMatrixParameter; + assert(statematrix); + statematrix->ref(); + BOOST_CHECK_MESSAGE(statematrix->getTypeId() != SoType::badType(), + "missing class initialization"); + statematrix->unref(); + } +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/shaders/SoShaderProgramTest.cpp b/testsuite/shaders/SoShaderProgramTest.cpp new file mode 100644 index 00000000000..c866bc017c6 --- /dev/null +++ b/testsuite/shaders/SoShaderProgramTest.cpp @@ -0,0 +1,72 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoShaderProgram_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoShaderProgram_initialized) +{ + SoShaderProgram * node = new SoShaderProgram; + assert(node); + node->ref(); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "missing class initialization"); + node->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/shaders/SoVertexShaderTest.cpp b/testsuite/shaders/SoVertexShaderTest.cpp new file mode 100644 index 00000000000..fc3592f3df2 --- /dev/null +++ b/testsuite/shaders/SoVertexShaderTest.cpp @@ -0,0 +1,72 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoVertexShader_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoVertexShader_initialized) +{ + SoVertexShader * node = new SoVertexShader; + assert(node); + node->ref(); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "missing class initialization"); + node->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/shadows/SoGLShadowCullingElementTest.cpp b/testsuite/shadows/SoGLShadowCullingElementTest.cpp new file mode 100644 index 00000000000..6be7ed197ab --- /dev/null +++ b/testsuite/shadows/SoGLShadowCullingElementTest.cpp @@ -0,0 +1,68 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoGLShadowCullingElement_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoGLShadowCullingElement_initialized) +{ + BOOST_CHECK_MESSAGE(SoGLShadowCullingElement::getClassStackIndex() != -1, + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/shadows/SoShadowCullingTest.cpp b/testsuite/shadows/SoShadowCullingTest.cpp new file mode 100644 index 00000000000..9b56e760591 --- /dev/null +++ b/testsuite/shadows/SoShadowCullingTest.cpp @@ -0,0 +1,72 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoShadowCulling_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoShadowCulling_initialized) +{ + SoShadowCulling * node = new SoShadowCulling; + assert(node); + node->ref(); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "missing class initialization"); + node->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/shadows/SoShadowDirectionalLightTest.cpp b/testsuite/shadows/SoShadowDirectionalLightTest.cpp new file mode 100644 index 00000000000..f8b6b592c44 --- /dev/null +++ b/testsuite/shadows/SoShadowDirectionalLightTest.cpp @@ -0,0 +1,72 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoShadowDirectionalLight_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoShadowDirectionalLight_initialized) +{ + SoShadowDirectionalLight * node = new SoShadowDirectionalLight; + assert(node); + node->ref(); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "missing class initialization"); + node->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/shadows/SoShadowGroupTest.cpp b/testsuite/shadows/SoShadowGroupTest.cpp new file mode 100644 index 00000000000..624d7005f77 --- /dev/null +++ b/testsuite/shadows/SoShadowGroupTest.cpp @@ -0,0 +1,72 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoShadowGroup_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoShadowGroup_initialized) +{ + SoShadowGroup * node = new SoShadowGroup; + assert(node); + node->ref(); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "missing class initialization"); + node->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/shadows/SoShadowSpotLightTest.cpp b/testsuite/shadows/SoShadowSpotLightTest.cpp new file mode 100644 index 00000000000..c50b6ba79dd --- /dev/null +++ b/testsuite/shadows/SoShadowSpotLightTest.cpp @@ -0,0 +1,72 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoShadowSpotLight_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoShadowSpotLight_initialized) +{ + SoShadowSpotLight * node = new SoShadowSpotLight; + assert(node); + node->ref(); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "missing class initialization"); + node->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/shadows/SoShadowStyleElementTest.cpp b/testsuite/shadows/SoShadowStyleElementTest.cpp new file mode 100644 index 00000000000..6c74a9fcbeb --- /dev/null +++ b/testsuite/shadows/SoShadowStyleElementTest.cpp @@ -0,0 +1,68 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoShadowStyleElement_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoShadowStyleElement_initialized) +{ + BOOST_CHECK_MESSAGE(SoShadowStyleElement::getClassStackIndex() != -1, + "missing class initialization"); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/shadows/SoShadowStyleTest.cpp b/testsuite/shadows/SoShadowStyleTest.cpp new file mode 100644 index 00000000000..b1e9c7b7200 --- /dev/null +++ b/testsuite/shadows/SoShadowStyleTest.cpp @@ -0,0 +1,72 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include + +BOOST_AUTO_TEST_SUITE(SoShadowStyle_TestSuite); + + +BOOST_AUTO_TEST_CASE(SoShadowStyle_initialized) +{ + SoShadowStyle * node = new SoShadowStyle; + assert(node); + node->ref(); + BOOST_CHECK_MESSAGE(node->getTypeId() != SoType::badType(), + "missing class initialization"); + node->unref(); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/soscxml/ScXMLCoinEvaluatorTest.cpp b/testsuite/soscxml/ScXMLCoinEvaluatorTest.cpp new file mode 100644 index 00000000000..9ec26c43c9b --- /dev/null +++ b/testsuite/soscxml/ScXMLCoinEvaluatorTest.cpp @@ -0,0 +1,135 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +#include +BOOST_AUTO_TEST_SUITE(ScXMLCoinEvaluator_TestSuite); + + +// FIXME: this is no longer possible in the MinimumEvaluator - move testcase to +// the CoinEvaluator. + +template +struct DataObjDemangler { +}; + +template<> +struct DataObjDemangler { + typedef double RET_VAL; + static RET_VAL getValue(ScXMLRealDataObj * obj) { + return obj->getReal(); + } +}; + +template<> +struct DataObjDemangler { + typedef bool RET_VAL; + static RET_VAL getValue(ScXMLBoolDataObj * obj) { + return obj->getBool(); + } +}; + +#define COIN_REQUIRE_MESSAGE( P , M) \ + BOOST_REQUIRE_MESSAGE(P , M); \ + if (!(P)) \ + return false; + + +template +bool +TestReturnValue(const std::string & evaluationString, typename DataObjDemangler< EXPECTED_TYPE >::RET_VAL retVal, ScXMLEvaluator * evaluator) +{ + ScXMLDataObj * res = NULL; + + res = evaluator->evaluate(evaluationString.c_str()); + COIN_REQUIRE_MESSAGE(res != NULL, std::string("Evaluation returned nothing for expression: ") + evaluationString); + //FIXME: Should really remember to delete res before returning from this point on, + //but don't bother about a memory leak when there are bigger fish to + //fry. 20090613 BFG + COIN_REQUIRE_MESSAGE(res->getTypeId() == EXPECTED_TYPE::getClassTypeId(), std::string("The type returned was incorrect for expression: ") + evaluationString); + EXPECTED_TYPE * obj = static_cast(res); + COIN_REQUIRE_MESSAGE(DataObjDemangler::getValue(obj) == retVal, std::string("Return value mismatch for expression: ") + evaluationString); + + delete res; + return true; +} + + +BOOST_AUTO_TEST_CASE(BasicExpressions) +{ + std::unique_ptr sm(new ScXMLStateMachine); + std::unique_ptr evaluator(new ScXMLCoinEvaluator); + evaluator->setStateMachine(sm.get()); + + TestReturnValue("M_PI",M_PI,evaluator.get()); + TestReturnValue("5.0",5.0,evaluator.get()); + TestReturnValue("5 + 5",10.0,evaluator.get()); + TestReturnValue("5 - 4",1.0,evaluator.get()); + TestReturnValue("5 * 4",20.0,evaluator.get()); + TestReturnValue("5 / 4",1.25,evaluator.get()); + TestReturnValue("-5",-5.0,evaluator.get()); + + TestReturnValue("True",TRUE,evaluator.get()); + TestReturnValue("false",FALSE,evaluator.get()); + TestReturnValue("!false",TRUE,evaluator.get()); + TestReturnValue("M_PI != M_LN2",TRUE,evaluator.get()); + TestReturnValue("M_PI == M_LN2",FALSE,evaluator.get()); + TestReturnValue("false && !false",FALSE,evaluator.get()); +} + + +BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/xml/documentTest.cpp b/testsuite/xml/documentTest.cpp new file mode 100644 index 00000000000..415a0fd2520 --- /dev/null +++ b/testsuite/xml/documentTest.cpp @@ -0,0 +1,91 @@ +/**************************************************************************\ +* Copyright (c) Kongsberg Oil & Gas Technologies AS +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\**************************************************************************/ + +// Keep generated tests on the same feature configuration as the Coin target. +// setup.h is private, so temporarily provide its internal-build guard. +#ifndef COIN_INTERNAL +#define COIN_INTERNAL +#define COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "setup.h" +#ifdef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#undef COIN_INTERNAL +#undef COIN_TESTSUITE_UNDEF_COIN_INTERNAL +#endif +#include "CoinTest.h" +#include +#include +#include +#include +#include "TestSuiteUtils.h" +#include "TestSuiteMisc.h" +#include +using namespace SIM::Coin3D::Coin; +using namespace SIM::Coin3D::Coin::TestSuite; + + +#include +#include +#include +#include +BOOST_AUTO_TEST_SUITE(document_TestSuite); + + +BOOST_AUTO_TEST_CASE(bufread) +{ + const char * buffer = +"\n\n" +"\n" +" hei\n" +"\n"; + cc_xml_doc * doc1 = cc_xml_read_buffer(buffer); + BOOST_CHECK_MESSAGE(doc1 != NULL, "cc_xml_doc_read_buffer() failed"); + + std::unique_ptr buffer2; + size_t bytecount = 0; + { + char * bufptr = NULL; + cc_xml_doc_write_to_buffer(doc1, bufptr, bytecount); + buffer2.reset(bufptr); + } + + cc_xml_doc * doc2 = cc_xml_read_buffer(buffer2.get()); + + cc_xml_path * diffpath = cc_xml_doc_diff(doc1, doc2); + BOOST_CHECK_MESSAGE(diffpath == NULL, "document read->write->read DOM differences"); + + cc_xml_doc_delete_x(doc1); + cc_xml_doc_delete_x(doc2); +} + + +BOOST_AUTO_TEST_SUITE_END(); From 86bfec2f0fefb633fc2f619d41e0fc4f46b87c5a Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Sat, 15 Aug 2026 17:30:52 +0100 Subject: [PATCH 3/4] tests: vendor Catch2 v2.13.10 --- testsuite/thirdparty/catch2/Catch.cmake | 206 + .../thirdparty/catch2/CatchAddTests.cmake | 135 + testsuite/thirdparty/catch2/LICENSE.txt | 23 + testsuite/thirdparty/catch2/catch.hpp | 17975 ++++++++++++++++ 4 files changed, 18339 insertions(+) create mode 100644 testsuite/thirdparty/catch2/Catch.cmake create mode 100644 testsuite/thirdparty/catch2/CatchAddTests.cmake create mode 100644 testsuite/thirdparty/catch2/LICENSE.txt create mode 100644 testsuite/thirdparty/catch2/catch.hpp diff --git a/testsuite/thirdparty/catch2/Catch.cmake b/testsuite/thirdparty/catch2/Catch.cmake new file mode 100644 index 00000000000..6f21a89c985 --- /dev/null +++ b/testsuite/thirdparty/catch2/Catch.cmake @@ -0,0 +1,206 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +Catch +----- + +This module defines a function to help use the Catch test framework. + +The :command:`catch_discover_tests` discovers tests by asking the compiled test +executable to enumerate its tests. This does not require CMake to be re-run +when tests change. However, it may not work in a cross-compiling environment, +and setting test properties is less convenient. + +This command is intended to replace use of :command:`add_test` to register +tests, and will create a separate CTest test for each Catch test case. Note +that this is in some cases less efficient, as common set-up and tear-down logic +cannot be shared by multiple test cases executing in the same instance. +However, it provides more fine-grained pass/fail information to CTest, which is +usually considered as more beneficial. By default, the CTest test name is the +same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``. + +.. command:: catch_discover_tests + + Automatically add tests with CTest by querying the compiled test executable + for available tests:: + + catch_discover_tests(target + [TEST_SPEC arg1...] + [EXTRA_ARGS arg1...] + [WORKING_DIRECTORY dir] + [TEST_PREFIX prefix] + [TEST_SUFFIX suffix] + [PROPERTIES name1 value1...] + [TEST_LIST var] + [REPORTER reporter] + [OUTPUT_DIR dir] + [OUTPUT_PREFIX prefix} + [OUTPUT_SUFFIX suffix] + ) + + ``catch_discover_tests`` sets up a post-build command on the test executable + that generates the list of tests by parsing the output from running the test + with the ``--list-test-names-only`` argument. This ensures that the full + list of tests is obtained. Since test discovery occurs at build time, it is + not necessary to re-run CMake when the list of tests changes. + However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set + in order to function in a cross-compiling environment. + + Additionally, setting properties on tests is somewhat less convenient, since + the tests are not available at CMake time. Additional test properties may be + assigned to the set of tests as a whole using the ``PROPERTIES`` option. If + more fine-grained test control is needed, custom content may be provided + through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES` + directory property. The set of discovered tests is made accessible to such a + script via the ``_TESTS`` variable. + + The options are: + + ``target`` + Specifies the Catch executable, which must be a known CMake executable + target. CMake will substitute the location of the built executable when + running the test. + + ``TEST_SPEC arg1...`` + Specifies test cases, wildcarded test cases, tags and tag expressions to + pass to the Catch executable with the ``--list-test-names-only`` argument. + + ``EXTRA_ARGS arg1...`` + Any extra arguments to pass on the command line to each test case. + + ``WORKING_DIRECTORY dir`` + Specifies the directory in which to run the discovered test cases. If this + option is not provided, the current binary directory is used. + + ``TEST_PREFIX prefix`` + Specifies a ``prefix`` to be prepended to the name of each discovered test + case. This can be useful when the same test executable is being used in + multiple calls to ``catch_discover_tests()`` but with different + ``TEST_SPEC`` or ``EXTRA_ARGS``. + + ``TEST_SUFFIX suffix`` + Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of + every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may + be specified. + + ``PROPERTIES name1 value1...`` + Specifies additional properties to be set on all tests discovered by this + invocation of ``catch_discover_tests``. + + ``TEST_LIST var`` + Make the list of tests available in the variable ``var``, rather than the + default ``_TESTS``. This can be useful when the same test + executable is being used in multiple calls to ``catch_discover_tests()``. + Note that this variable is only available in CTest. + + ``REPORTER reporter`` + Use the specified reporter when running the test case. The reporter will + be passed to the Catch executable as ``--reporter reporter``. + + ``OUTPUT_DIR dir`` + If specified, the parameter is passed along as + ``--out dir/`` to Catch executable. The actual file name is the + same as the test name. This should be used instead of + ``EXTRA_ARGS --out foo`` to avoid race conditions writing the result output + when using parallel test execution. + + ``OUTPUT_PREFIX prefix`` + May be used in conjunction with ``OUTPUT_DIR``. + If specified, ``prefix`` is added to each output file name, like so + ``--out dir/prefix``. + + ``OUTPUT_SUFFIX suffix`` + May be used in conjunction with ``OUTPUT_DIR``. + If specified, ``suffix`` is added to each output file name, like so + ``--out dir/suffix``. This can be used to add a file extension to + the output e.g. ".xml". + +#]=======================================================================] + +#------------------------------------------------------------------------------ +function(catch_discover_tests TARGET) + cmake_parse_arguments( + "" + "" + "TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;REPORTER;OUTPUT_DIR;OUTPUT_PREFIX;OUTPUT_SUFFIX" + "TEST_SPEC;EXTRA_ARGS;PROPERTIES" + ${ARGN} + ) + + if(NOT _WORKING_DIRECTORY) + set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + endif() + if(NOT _TEST_LIST) + set(_TEST_LIST ${TARGET}_TESTS) + endif() + + ## Generate a unique name based on the extra arguments + string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS} ${_REPORTER} ${_OUTPUT_DIR} ${_OUTPUT_PREFIX} ${_OUTPUT_SUFFIX}") + string(SUBSTRING ${args_hash} 0 7 args_hash) + + # Define rule to generate test list for aforementioned test executable + set(ctest_include_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_include-${args_hash}.cmake") + set(ctest_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_tests-${args_hash}.cmake") + get_property(crosscompiling_emulator + TARGET ${TARGET} + PROPERTY CROSSCOMPILING_EMULATOR + ) + add_custom_command( + TARGET ${TARGET} POST_BUILD + BYPRODUCTS "${ctest_tests_file}" + COMMAND "${CMAKE_COMMAND}" + -D "TEST_TARGET=${TARGET}" + -D "TEST_EXECUTABLE=$" + -D "TEST_EXECUTOR=${crosscompiling_emulator}" + -D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}" + -D "TEST_SPEC=${_TEST_SPEC}" + -D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}" + -D "TEST_PROPERTIES=${_PROPERTIES}" + -D "TEST_PREFIX=${_TEST_PREFIX}" + -D "TEST_SUFFIX=${_TEST_SUFFIX}" + -D "TEST_LIST=${_TEST_LIST}" + -D "TEST_REPORTER=${_REPORTER}" + -D "TEST_OUTPUT_DIR=${_OUTPUT_DIR}" + -D "TEST_OUTPUT_PREFIX=${_OUTPUT_PREFIX}" + -D "TEST_OUTPUT_SUFFIX=${_OUTPUT_SUFFIX}" + -D "CTEST_FILE=${ctest_tests_file}" + -P "${_CATCH_DISCOVER_TESTS_SCRIPT}" + VERBATIM + ) + + file(WRITE "${ctest_include_file}" + "if(EXISTS \"${ctest_tests_file}\")\n" + " include(\"${ctest_tests_file}\")\n" + "else()\n" + " add_test(${TARGET}_NOT_BUILT-${args_hash} ${TARGET}_NOT_BUILT-${args_hash})\n" + "endif()\n" + ) + + if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0") + # Add discovered tests to directory TEST_INCLUDE_FILES + set_property(DIRECTORY + APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}" + ) + else() + # Add discovered tests as directory TEST_INCLUDE_FILE if possible + get_property(test_include_file_set DIRECTORY PROPERTY TEST_INCLUDE_FILE SET) + if (NOT ${test_include_file_set}) + set_property(DIRECTORY + PROPERTY TEST_INCLUDE_FILE "${ctest_include_file}" + ) + else() + message(FATAL_ERROR + "Cannot set more than one TEST_INCLUDE_FILE" + ) + endif() + endif() + +endfunction() + +############################################################################### + +set(_CATCH_DISCOVER_TESTS_SCRIPT + ${CMAKE_CURRENT_LIST_DIR}/CatchAddTests.cmake + CACHE INTERNAL "Catch2 full path to CatchAddTests.cmake helper file" +) diff --git a/testsuite/thirdparty/catch2/CatchAddTests.cmake b/testsuite/thirdparty/catch2/CatchAddTests.cmake new file mode 100644 index 00000000000..7faeedbd27d --- /dev/null +++ b/testsuite/thirdparty/catch2/CatchAddTests.cmake @@ -0,0 +1,135 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +set(prefix "${TEST_PREFIX}") +set(suffix "${TEST_SUFFIX}") +set(spec ${TEST_SPEC}) +set(extra_args ${TEST_EXTRA_ARGS}) +set(properties ${TEST_PROPERTIES}) +set(reporter ${TEST_REPORTER}) +set(output_dir ${TEST_OUTPUT_DIR}) +set(output_prefix ${TEST_OUTPUT_PREFIX}) +set(output_suffix ${TEST_OUTPUT_SUFFIX}) +set(script) +set(suite) +set(tests) + +function(add_command NAME) + set(_args "") + # use ARGV* instead of ARGN, because ARGN splits arrays into multiple arguments + math(EXPR _last_arg ${ARGC}-1) + foreach(_n RANGE 1 ${_last_arg}) + set(_arg "${ARGV${_n}}") + if(_arg MATCHES "[^-./:a-zA-Z0-9_]") + set(_args "${_args} [==[${_arg}]==]") # form a bracket_argument + else() + set(_args "${_args} ${_arg}") + endif() + endforeach() + set(script "${script}${NAME}(${_args})\n" PARENT_SCOPE) +endfunction() + +# Run test executable to get list of available tests +if(NOT EXISTS "${TEST_EXECUTABLE}") + message(FATAL_ERROR + "Specified test executable '${TEST_EXECUTABLE}' does not exist" + ) +endif() +execute_process( + COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only + OUTPUT_VARIABLE output + RESULT_VARIABLE result + WORKING_DIRECTORY "${TEST_WORKING_DIR}" +) +# Catch --list-test-names-only reports the number of tests, so 0 is... surprising +if(${result} EQUAL 0) + message(WARNING + "Test executable '${TEST_EXECUTABLE}' contains no tests!\n" + ) +elseif(${result} LESS 0) + message(FATAL_ERROR + "Error running test executable '${TEST_EXECUTABLE}':\n" + " Result: ${result}\n" + " Output: ${output}\n" + ) +endif() + +string(REPLACE "\n" ";" output "${output}") + +# Run test executable to get list of available reporters +execute_process( + COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-reporters + OUTPUT_VARIABLE reporters_output + RESULT_VARIABLE reporters_result + WORKING_DIRECTORY "${TEST_WORKING_DIR}" +) +if(${reporters_result} EQUAL 0) + message(WARNING + "Test executable '${TEST_EXECUTABLE}' contains no reporters!\n" + ) +elseif(${reporters_result} LESS 0) + message(FATAL_ERROR + "Error running test executable '${TEST_EXECUTABLE}':\n" + " Result: ${reporters_result}\n" + " Output: ${reporters_output}\n" + ) +endif() +string(FIND "${reporters_output}" "${reporter}" reporter_is_valid) +if(reporter AND ${reporter_is_valid} EQUAL -1) + message(FATAL_ERROR + "\"${reporter}\" is not a valid reporter!\n" + ) +endif() + +# Prepare reporter +if(reporter) + set(reporter_arg "--reporter ${reporter}") +endif() + +# Prepare output dir +if(output_dir AND NOT IS_ABSOLUTE ${output_dir}) + set(output_dir "${TEST_WORKING_DIR}/${output_dir}") + if(NOT EXISTS ${output_dir}) + file(MAKE_DIRECTORY ${output_dir}) + endif() +endif() + +# Parse output +foreach(line ${output}) + set(test ${line}) + # Escape characters in test case names that would be parsed by Catch2 + set(test_name ${test}) + foreach(char , [ ]) + string(REPLACE ${char} "\\${char}" test_name ${test_name}) + endforeach(char) + # ...add output dir + if(output_dir) + string(REGEX REPLACE "[^A-Za-z0-9_]" "_" test_name_clean ${test_name}) + set(output_dir_arg "--out ${output_dir}/${output_prefix}${test_name_clean}${output_suffix}") + endif() + + # ...and add to script + add_command(add_test + "${prefix}${test}${suffix}" + ${TEST_EXECUTOR} + "${TEST_EXECUTABLE}" + "${test_name}" + ${extra_args} + "${reporter_arg}" + "${output_dir_arg}" + ) + add_command(set_tests_properties + "${prefix}${test}${suffix}" + PROPERTIES + WORKING_DIRECTORY "${TEST_WORKING_DIR}" + ${properties} + ) + list(APPEND tests "${prefix}${test}${suffix}") +endforeach() + +# Create a list of all discovered tests, which users may use to e.g. set +# properties on the tests +add_command(set ${TEST_LIST} ${tests}) + +# Write CTest script +file(WRITE "${CTEST_FILE}" "${script}") diff --git a/testsuite/thirdparty/catch2/LICENSE.txt b/testsuite/thirdparty/catch2/LICENSE.txt new file mode 100644 index 00000000000..36b7cd93cdf --- /dev/null +++ b/testsuite/thirdparty/catch2/LICENSE.txt @@ -0,0 +1,23 @@ +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/testsuite/thirdparty/catch2/catch.hpp b/testsuite/thirdparty/catch2/catch.hpp new file mode 100644 index 00000000000..47cd43a7c4f --- /dev/null +++ b/testsuite/thirdparty/catch2/catch.hpp @@ -0,0 +1,17975 @@ +/* + * Catch v2.13.10 + * Generated: 2022-10-16 11:01:23.452308 + * ---------------------------------------------------------- + * This file has been merged from multiple headers. Please don't edit it directly + * Copyright (c) 2022 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED +#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED +// start catch.hpp + + +#define CATCH_VERSION_MAJOR 2 +#define CATCH_VERSION_MINOR 13 +#define CATCH_VERSION_PATCH 10 + +#ifdef __clang__ +# pragma clang system_header +#elif defined __GNUC__ +# pragma GCC system_header +#endif + +// start catch_suppress_warnings.h + +#ifdef __clang__ +# ifdef __ICC // icpc defines the __clang__ macro +# pragma warning(push) +# pragma warning(disable: 161 1682) +# else // __ICC +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wpadded" +# pragma clang diagnostic ignored "-Wswitch-enum" +# pragma clang diagnostic ignored "-Wcovered-switch-default" +# endif +#elif defined __GNUC__ + // Because REQUIREs trigger GCC's -Wparentheses, and because still + // supported version of g++ have only buggy support for _Pragmas, + // Wparentheses have to be suppressed globally. +# pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details + +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-variable" +# pragma GCC diagnostic ignored "-Wpadded" +#endif +// end catch_suppress_warnings.h +#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER) +# define CATCH_IMPL +# define CATCH_CONFIG_ALL_PARTS +#endif + +// In the impl file, we want to have access to all parts of the headers +// Can also be used to sanely support PCHs +#if defined(CATCH_CONFIG_ALL_PARTS) +# define CATCH_CONFIG_EXTERNAL_INTERFACES +# if defined(CATCH_CONFIG_DISABLE_MATCHERS) +# undef CATCH_CONFIG_DISABLE_MATCHERS +# endif +# if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) +# define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER +# endif +#endif + +#if !defined(CATCH_CONFIG_IMPL_ONLY) +// start catch_platform.h + +// See e.g.: +// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html +#ifdef __APPLE__ +# include +# if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \ + (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1) +# define CATCH_PLATFORM_MAC +# elif (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1) +# define CATCH_PLATFORM_IPHONE +# endif + +#elif defined(linux) || defined(__linux) || defined(__linux__) +# define CATCH_PLATFORM_LINUX + +#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__) +# define CATCH_PLATFORM_WINDOWS +#endif + +// end catch_platform.h + +#ifdef CATCH_IMPL +# ifndef CLARA_CONFIG_MAIN +# define CLARA_CONFIG_MAIN_NOT_DEFINED +# define CLARA_CONFIG_MAIN +# endif +#endif + +// start catch_user_interfaces.h + +namespace Catch { + unsigned int rngSeed(); +} + +// end catch_user_interfaces.h +// start catch_tag_alias_autoregistrar.h + +// start catch_common.h + +// start catch_compiler_capabilities.h + +// Detect a number of compiler features - by compiler +// The following features are defined: +// +// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported? +// CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported? +// CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported? +// CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled? +// **************** +// Note to maintainers: if new toggles are added please document them +// in configuration.md, too +// **************** + +// In general each macro has a _NO_ form +// (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature. +// Many features, at point of detection, define an _INTERNAL_ macro, so they +// can be combined, en-mass, with the _NO_ forms later. + +#ifdef __cplusplus + +# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) +# define CATCH_CPP14_OR_GREATER +# endif + +# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) +# define CATCH_CPP17_OR_GREATER +# endif + +#endif + +// Only GCC compiler should be used in this block, so other compilers trying to +// mask themselves as GCC should be ignored. +#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__) && !defined(__LCC__) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" ) + +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) + +#endif + +#if defined(__clang__) + +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" ) + +// As of this writing, IBM XL's implementation of __builtin_constant_p has a bug +// which results in calls to destructors being emitted for each temporary, +// without a matching initialization. In practice, this can result in something +// like `std::string::~string` being called on an uninitialized value. +// +// For example, this code will likely segfault under IBM XL: +// ``` +// REQUIRE(std::string("12") + "34" == "1234") +// ``` +// +// Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented. +# if !defined(__ibmxl__) && !defined(__CUDACC__) +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */ +# endif + +# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \ + _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"") + +# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wparentheses\"" ) + +# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" ) + +# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" ) + +# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wunused-template\"" ) + +#endif // __clang__ + +//////////////////////////////////////////////////////////////////////////////// +// Assume that non-Windows platforms support posix signals by default +#if !defined(CATCH_PLATFORM_WINDOWS) + #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS +#endif + +//////////////////////////////////////////////////////////////////////////////// +// We know some environments not to support full POSIX signals +#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__) + #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +#endif + +#ifdef __OS400__ +# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +# define CATCH_CONFIG_COLOUR_NONE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Android somehow still does not support std::to_string +#if defined(__ANDROID__) +# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING +# define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Not all Windows environments support SEH properly +#if defined(__MINGW32__) +# define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH +#endif + +//////////////////////////////////////////////////////////////////////////////// +// PS4 +#if defined(__ORBIS__) +# define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Cygwin +#ifdef __CYGWIN__ + +// Required for some versions of Cygwin to declare gettimeofday +// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin +# define _BSD_SOURCE +// some versions of cygwin (most) do not support std::to_string. Use the libstd check. +// https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813 +# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \ + && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) + +# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING + +# endif +#endif // __CYGWIN__ + +//////////////////////////////////////////////////////////////////////////////// +// Visual C++ +#if defined(_MSC_VER) + +// Universal Windows platform does not support SEH +// Or console colours (or console at all...) +# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) +# define CATCH_CONFIG_COLOUR_NONE +# else +# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH +# endif + +# if !defined(__clang__) // Handle Clang masquerading for msvc + +// MSVC traditional preprocessor needs some workaround for __VA_ARGS__ +// _MSVC_TRADITIONAL == 0 means new conformant preprocessor +// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor +# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) +# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +# endif // MSVC_TRADITIONAL + +// Only do this if we're not using clang on Windows, which uses `diagnostic push` & `diagnostic pop` +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) ) +# endif // __clang__ + +#endif // _MSC_VER + +#if defined(_REENTRANT) || defined(_MSC_VER) +// Enable async processing, as -pthread is specified or no additional linking is required +# define CATCH_INTERNAL_CONFIG_USE_ASYNC +#endif // _MSC_VER + +//////////////////////////////////////////////////////////////////////////////// +// Check if we are compiled with -fno-exceptions or equivalent +#if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND) +# define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED +#endif + +//////////////////////////////////////////////////////////////////////////////// +// DJGPP +#ifdef __DJGPP__ +# define CATCH_INTERNAL_CONFIG_NO_WCHAR +#endif // __DJGPP__ + +//////////////////////////////////////////////////////////////////////////////// +// Embarcadero C++Build +#if defined(__BORLANDC__) + #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN +#endif + +//////////////////////////////////////////////////////////////////////////////// + +// Use of __COUNTER__ is suppressed during code analysis in +// CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly +// handled by it. +// Otherwise all supported compilers support COUNTER macro, +// but user still might want to turn it off +#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L ) + #define CATCH_INTERNAL_CONFIG_COUNTER +#endif + +//////////////////////////////////////////////////////////////////////////////// + +// RTX is a special version of Windows that is real time. +// This means that it is detected as Windows, but does not provide +// the same set of capabilities as real Windows does. +#if defined(UNDER_RTSS) || defined(RTX64_BUILD) + #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH + #define CATCH_INTERNAL_CONFIG_NO_ASYNC + #define CATCH_CONFIG_COLOUR_NONE +#endif + +#if !defined(_GLIBCXX_USE_C99_MATH_TR1) +#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER +#endif + +// Various stdlib support checks that require __has_include +#if defined(__has_include) + // Check if string_view is available and usable + #if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW + #endif + + // Check if optional is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) + + // Check if byte is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # include + # if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0) + # define CATCH_INTERNAL_CONFIG_CPP17_BYTE + # endif + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) + + // Check if variant is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # if defined(__clang__) && (__clang_major__ < 8) + // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852 + // fix should be in clang 8, workaround in libstdc++ 8.2 + # include + # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) + # define CATCH_CONFIG_NO_CPP17_VARIANT + # else + # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT + # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) + # else + # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT + # endif // defined(__clang__) && (__clang_major__ < 8) + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) +#endif // defined(__has_include) + +#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) +# define CATCH_CONFIG_COUNTER +#endif +#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH) +# define CATCH_CONFIG_WINDOWS_SEH +#endif +// This is set by default, because we assume that unix compilers are posix-signal-compatible by default. +#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS) +# define CATCH_CONFIG_POSIX_SIGNALS +#endif +// This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions. +#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR) +# define CATCH_CONFIG_WCHAR +#endif + +#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING) +# define CATCH_CONFIG_CPP11_TO_STRING +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL) +# define CATCH_CONFIG_CPP17_OPTIONAL +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW) +# define CATCH_CONFIG_CPP17_STRING_VIEW +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT) +# define CATCH_CONFIG_CPP17_VARIANT +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE) +# define CATCH_CONFIG_CPP17_BYTE +#endif + +#if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) +# define CATCH_INTERNAL_CONFIG_NEW_CAPTURE +#endif + +#if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE) +# define CATCH_CONFIG_NEW_CAPTURE +#endif + +#if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) +# define CATCH_CONFIG_DISABLE_EXCEPTIONS +#endif + +#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN) +# define CATCH_CONFIG_POLYFILL_ISNAN +#endif + +#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC) +# define CATCH_CONFIG_USE_ASYNC +#endif + +#if defined(CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_NO_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_ANDROID_LOGWRITE) +# define CATCH_CONFIG_ANDROID_LOGWRITE +#endif + +#if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER) +# define CATCH_CONFIG_GLOBAL_NEXTAFTER +#endif + +// Even if we do not think the compiler has that warning, we still have +// to provide a macro that can be used by the code. +#if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION +#endif +#if !defined(CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS +#endif + +// The goal of this macro is to avoid evaluation of the arguments, but +// still have the compiler warn on problems inside... +#if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN) +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) +#endif + +#if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10) +# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#elif defined(__clang__) && (__clang_major__ < 5) +# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#endif + +#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#endif + +#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) +#define CATCH_TRY if ((true)) +#define CATCH_CATCH_ALL if ((false)) +#define CATCH_CATCH_ANON(type) if ((false)) +#else +#define CATCH_TRY try +#define CATCH_CATCH_ALL catch (...) +#define CATCH_CATCH_ANON(type) catch (type) +#endif + +#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) +#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#endif + +// end catch_compiler_capabilities.h +#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line +#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) +#ifdef CATCH_CONFIG_COUNTER +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) +#else +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) +#endif + +#include +#include +#include + +// We need a dummy global operator<< so we can bring it into Catch namespace later +struct Catch_global_namespace_dummy {}; +std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); + +namespace Catch { + + struct CaseSensitive { enum Choice { + Yes, + No + }; }; + + class NonCopyable { + NonCopyable( NonCopyable const& ) = delete; + NonCopyable( NonCopyable && ) = delete; + NonCopyable& operator = ( NonCopyable const& ) = delete; + NonCopyable& operator = ( NonCopyable && ) = delete; + + protected: + NonCopyable(); + virtual ~NonCopyable(); + }; + + struct SourceLineInfo { + + SourceLineInfo() = delete; + SourceLineInfo( char const* _file, std::size_t _line ) noexcept + : file( _file ), + line( _line ) + {} + + SourceLineInfo( SourceLineInfo const& other ) = default; + SourceLineInfo& operator = ( SourceLineInfo const& ) = default; + SourceLineInfo( SourceLineInfo&& ) noexcept = default; + SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default; + + bool empty() const noexcept { return file[0] == '\0'; } + bool operator == ( SourceLineInfo const& other ) const noexcept; + bool operator < ( SourceLineInfo const& other ) const noexcept; + + char const* file; + std::size_t line; + }; + + std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ); + + // Bring in operator<< from global namespace into Catch namespace + // This is necessary because the overload of operator<< above makes + // lookup stop at namespace Catch + using ::operator<<; + + // Use this in variadic streaming macros to allow + // >> +StreamEndStop + // as well as + // >> stuff +StreamEndStop + struct StreamEndStop { + std::string operator+() const; + }; + template + T const& operator + ( T const& value, StreamEndStop ) { + return value; + } +} + +#define CATCH_INTERNAL_LINEINFO \ + ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) + +// end catch_common.h +namespace Catch { + + struct RegistrarForTagAliases { + RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ); + }; + +} // end namespace Catch + +#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION + +// end catch_tag_alias_autoregistrar.h +// start catch_test_registry.h + +// start catch_interfaces_testcase.h + +#include + +namespace Catch { + + class TestSpec; + + struct ITestInvoker { + virtual void invoke () const = 0; + virtual ~ITestInvoker(); + }; + + class TestCase; + struct IConfig; + + struct ITestCaseRegistry { + virtual ~ITestCaseRegistry(); + virtual std::vector const& getAllTests() const = 0; + virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0; + }; + + bool isThrowSafe( TestCase const& testCase, IConfig const& config ); + bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ); + std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ); + std::vector const& getAllTestCasesSorted( IConfig const& config ); + +} + +// end catch_interfaces_testcase.h +// start catch_stringref.h + +#include +#include +#include +#include + +namespace Catch { + + /// A non-owning string class (similar to the forthcoming std::string_view) + /// Note that, because a StringRef may be a substring of another string, + /// it may not be null terminated. + class StringRef { + public: + using size_type = std::size_t; + using const_iterator = const char*; + + private: + static constexpr char const* const s_empty = ""; + + char const* m_start = s_empty; + size_type m_size = 0; + + public: // construction + constexpr StringRef() noexcept = default; + + StringRef( char const* rawChars ) noexcept; + + constexpr StringRef( char const* rawChars, size_type size ) noexcept + : m_start( rawChars ), + m_size( size ) + {} + + StringRef( std::string const& stdString ) noexcept + : m_start( stdString.c_str() ), + m_size( stdString.size() ) + {} + + explicit operator std::string() const { + return std::string(m_start, m_size); + } + + public: // operators + auto operator == ( StringRef const& other ) const noexcept -> bool; + auto operator != (StringRef const& other) const noexcept -> bool { + return !(*this == other); + } + + auto operator[] ( size_type index ) const noexcept -> char { + assert(index < m_size); + return m_start[index]; + } + + public: // named queries + constexpr auto empty() const noexcept -> bool { + return m_size == 0; + } + constexpr auto size() const noexcept -> size_type { + return m_size; + } + + // Returns the current start pointer. If the StringRef is not + // null-terminated, throws std::domain_exception + auto c_str() const -> char const*; + + public: // substrings and searches + // Returns a substring of [start, start + length). + // If start + length > size(), then the substring is [start, size()). + // If start > size(), then the substring is empty. + auto substr( size_type start, size_type length ) const noexcept -> StringRef; + + // Returns the current start pointer. May not be null-terminated. + auto data() const noexcept -> char const*; + + constexpr auto isNullTerminated() const noexcept -> bool { + return m_start[m_size] == '\0'; + } + + public: // iterators + constexpr const_iterator begin() const { return m_start; } + constexpr const_iterator end() const { return m_start + m_size; } + }; + + auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&; + auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&; + + constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { + return StringRef( rawChars, size ); + } +} // namespace Catch + +constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef { + return Catch::StringRef( rawChars, size ); +} + +// end catch_stringref.h +// start catch_preprocessor.hpp + + +#define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__ +#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__))) + +#ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__ +// MSVC needs more evaluations +#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__))) +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__)) +#else +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__) +#endif + +#define CATCH_REC_END(...) +#define CATCH_REC_OUT + +#define CATCH_EMPTY() +#define CATCH_DEFER(id) id CATCH_EMPTY() + +#define CATCH_REC_GET_END2() 0, CATCH_REC_END +#define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2 +#define CATCH_REC_GET_END(...) CATCH_REC_GET_END1 +#define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT +#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0) +#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next) + +#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) + +#define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) + +// Applies the function macro `f` to each of the remaining parameters, inserts commas between the results, +// and passes userdata as the first parameter to each invocation, +// e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c) +#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) +#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ +#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ +#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__) +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) +#else +// MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__) +#define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1) +#endif + +#define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__ +#define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name) + +#define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) + +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper()) +#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)) +#else +#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper())) +#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) +#endif + +#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\ + CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__) + +#define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0) +#define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1) +#define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2) +#define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3) +#define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4) +#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5) +#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _3, _4, _5, _6) +#define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7) +#define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8) +#define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9) +#define INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10) + +#define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N + +#define INTERNAL_CATCH_TYPE_GEN\ + template struct TypeList {};\ + template\ + constexpr auto get_wrapper() noexcept -> TypeList { return {}; }\ + template class...> struct TemplateTypeList{};\ + template class...Cs>\ + constexpr auto get_wrapper() noexcept -> TemplateTypeList { return {}; }\ + template\ + struct append;\ + template\ + struct rewrap;\ + template class, typename...>\ + struct create;\ + template class, typename>\ + struct convert;\ + \ + template \ + struct append { using type = T; };\ + template< template class L1, typename...E1, template class L2, typename...E2, typename...Rest>\ + struct append, L2, Rest...> { using type = typename append, Rest...>::type; };\ + template< template class L1, typename...E1, typename...Rest>\ + struct append, TypeList, Rest...> { using type = L1; };\ + \ + template< template class Container, template class List, typename...elems>\ + struct rewrap, List> { using type = TypeList>; };\ + template< template class Container, template class List, class...Elems, typename...Elements>\ + struct rewrap, List, Elements...> { using type = typename append>, typename rewrap, Elements...>::type>::type; };\ + \ + template