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..bf83a2cfe6d 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 @@ -38,30 +14,22 @@ macro(create_file_test input testfunc filter) endif() string(REGEX REPLACE "[\\./\\-]+" "" TESTSUITENAME "${input}") set(COIN_STR_TEST_INCL "") - set(COIN_STR_TEST_CODE "const char *readError[] = { \"Coin read error:\", 0 };\n") - set(COIN_STR_TEST_CLASS "${TESTSUITENAME}") + set(COIN_STR_TEST_CODE "static const char *readError[] = { \"Coin read error:\", 0 };\n") set(extra_macro_args ${ARGN}) list(LENGTH extra_macro_args num_extra_args) foreach(INPUTFILE ${COIN_IV_FILES}) if(${num_extra_args} EQUAL 0 OR NOT ("${INPUTFILE}" MATCHES "${extra_macro_args}")) string(REGEX REPLACE "[\\./\\-]+" "_" TESTNAME "${INPUTFILE}") if (${filter}) - set(COIN_STR_TEST_CODE "${COIN_STR_TEST_CODE}\nBOOST_AUTO_TEST_CASE(${TESTNAME}) { PushMessageSuppressFilters(readError); ResetReadErrorCount(); test_file(\"${PROJECT_SOURCE_DIR}/${INPUTFILE}\", &${testfunc}); PopMessageSuppressFilters(); }") + set(COIN_STR_TEST_CODE "${COIN_STR_TEST_CODE}\nTEST_CASE(\"${TESTSUITENAME}_TestSuite.${TESTNAME}\", \"[${TESTSUITENAME}_TestSuite]\") { PushMessageSuppressFilters(readError); ResetReadErrorCount(); test_file(\"${PROJECT_SOURCE_DIR}/${INPUTFILE}\", &${testfunc}); PopMessageSuppressFilters(); }") else() - set(COIN_STR_TEST_CODE "${COIN_STR_TEST_CODE}\nBOOST_AUTO_TEST_CASE(${TESTNAME}) { ResetReadErrorCount(); test_file(\"${PROJECT_SOURCE_DIR}/${INPUTFILE}\", &${testfunc}); }") + set(COIN_STR_TEST_CODE "${COIN_STR_TEST_CODE}\nTEST_CASE(\"${TESTSUITENAME}_TestSuite.${TESTNAME}\", \"[${TESTSUITENAME}_TestSuite]\") { ResetReadErrorCount(); test_file(\"${PROJECT_SOURCE_DIR}/${INPUTFILE}\", &${testfunc}); }") endif() endif() endforeach() 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 +39,17 @@ 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. +# Keep the generated list explicit so stale files in an existing build tree do +# not get compiled after the source extractor has been removed. +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,13 +58,21 @@ 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 + ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty ${COIN_TARGET_INCLUDE_DIRECTORIES} ) if (USE_PTHREAD) target_link_libraries(CoinTests pthread) endif() -add_test(NAME CoinTests COMMAND CoinTests) + +# Use Catch2's supported CTest integration. Discovery runs the compiled test +# executable with --list-test-names-only after it is built. +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/catch2") +include(Catch) +catch_discover_tests(CoinTests TEST_PREFIX "CoinTests.") # Many warnings are generated from test macros on macOS with Xcode. include(CheckCXXCompilerFlag) diff --git a/testsuite/CoinTest.h b/testsuite/CoinTest.h index 7689a2fc484..d7f79625f83 100644 --- a/testsuite/CoinTest.h +++ b/testsuite/CoinTest.h @@ -1,200 +1,22 @@ #ifndef COIN_TESTSUITE_COINTTEST_H #define COIN_TESTSUITE_COINTTEST_H -#include -#include +#include + #include #include -#include namespace CoinTest { -struct AbortTestCase { }; - -struct TestCase { - const char * name; - void (*fn)(void); - const char * file; - int line; -}; - -struct Failure { - const char * file; - int line; - std::string message; -}; - -struct Context { - int checks = 0; - int failed = 0; - std::vector failures; -}; - -inline std::vector & registry(void) -{ - static std::vector r; - return r; -} - -inline Context *& current_context(void) -{ - static Context * ctx = NULL; - return ctx; -} - -struct Registrar { - Registrar(const char * name, void (*fn)(void), const char * file, int line) - { - registry().push_back(TestCase{name, fn, file, line}); - } -}; - -inline void add_failure(const char * file, int line, const std::string & message) -{ - Context * ctx = current_context(); - if (!ctx) return; - ctx->failed += 1; - ctx->failures.push_back(Failure{file, line, message}); -} - -inline void add_check(void) -{ - Context * ctx = current_context(); - if (!ctx) return; - ctx->checks += 1; -} - +// Keep the string conversion helper used by existing Coin test diagnostics. template -std::string stringify(const T & v) -{ - std::ostringstream oss; - oss << v; - return oss.str(); -} - -inline void check(bool cond, const std::string & message, const char * file, int line) -{ - add_check(); - if (!cond) add_failure(file, line, message); -} - -inline void require(bool cond, const std::string & message, const char * file, int line) -{ - add_check(); - if (!cond) { - add_failure(file, line, message); - throw AbortTestCase(); - } -} - -template -inline void check_equal(const A & a, const B & b, - const char * aexpr, const char * bexpr, - const char * file, int line) +inline std::string stringify(const T & value) { - add_check(); - if (!(a == b)) { - add_failure(file, line, - std::string("check failed: (") + aexpr + " == " + bexpr + ") (" + - stringify(a) + " != " + stringify(b) + ")"); - } -} - -inline int run_all(void) -{ - const std::vector & tests = registry(); - int failedtests = 0; - int totalchecks = 0; - - for (size_t i = 0; i < tests.size(); ++i) { - const TestCase & tc = tests[i]; - - Context ctx; - current_context() = &ctx; - - try { - tc.fn(); - } catch (const AbortTestCase &) { - // already recorded as failure(s) - } catch (const std::exception & e) { - add_failure(tc.file, tc.line, std::string("unhandled std::exception: ") + e.what()); - } catch (...) { - add_failure(tc.file, tc.line, "unhandled non-std exception"); - } - - current_context() = NULL; - totalchecks += ctx.checks; - - if (ctx.failed) { - failedtests += 1; - std::fprintf(stderr, "[FAIL] %s (%s:%d)\n", tc.name, tc.file, tc.line); - for (size_t f = 0; f < ctx.failures.size(); ++f) { - const Failure & fail = ctx.failures[f]; - std::fprintf(stderr, " %s:%d: %s\n", fail.file, fail.line, fail.message.c_str()); - } - } - } - - if (failedtests == 0) { - std::fprintf(stderr, "[OK] %zu tests, %d checks\n", tests.size(), totalchecks); - return 0; - } - - std::fprintf(stderr, "[FAIL] %d/%zu tests failed, %d checks\n", failedtests, tests.size(), totalchecks); - return 1; + std::ostringstream stream; + stream << value; + return stream.str(); } } // namespace CoinTest -// --------------------------------------------------------------------------- -// Minimal Boost.Test compatibility macros used by Coin's testsuite extractor -// --------------------------------------------------------------------------- - -#define BOOST_TEST_NO_LIB 1 - -#define COIN_TEST_CONCAT_INNER(a, b) a##b -#define COIN_TEST_CONCAT(a, b) COIN_TEST_CONCAT_INNER(a, b) - -#define BOOST_AUTO_TEST_SUITE(name) namespace name { enum { coin_testsuite_dummy = 0 }; -#define BOOST_AUTO_TEST_SUITE_END() } -#define BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(name, n) /* no-op */ - -#define BOOST_AUTO_TEST_CASE(name) \ - static void COIN_TEST_CONCAT(coin_test_fn_, __LINE__)(void); \ - static ::CoinTest::Registrar COIN_TEST_CONCAT(coin_test_reg_, __LINE__)( \ - #name, &COIN_TEST_CONCAT(coin_test_fn_, __LINE__), __FILE__, __LINE__); \ - static void COIN_TEST_CONCAT(coin_test_fn_, __LINE__)(void) - -#define BOOST_CHECK_MESSAGE(cond, msg) \ - ::CoinTest::check(!!(cond), (msg), __FILE__, __LINE__) - -#define BOOST_CHECK(cond) \ - ::CoinTest::check(!!(cond), std::string("check failed: ") + #cond, __FILE__, __LINE__) - -#define BOOST_CHECK_EQUAL(a, b) \ - ::CoinTest::check_equal((a), (b), #a, #b, __FILE__, __LINE__) - -#define BOOST_REQUIRE_MESSAGE(cond, msg) \ - ::CoinTest::require(!!(cond), (msg), __FILE__, __LINE__) - -#define BOOST_REQUIRE(cond) \ - ::CoinTest::require(!!(cond), std::string("require failed: ") + #cond, __FILE__, __LINE__) - -#define BOOST_REQUIRE_EQUAL(a, b) \ - ::CoinTest::require(((a) == (b)), std::string("require failed: (") + #a + " == " + #b + ")", __FILE__, __LINE__) - -#define BOOST_REQUIRE_NE(a, b) \ - ::CoinTest::require(((a) != (b)), std::string("require failed: (") + #a + " != " + #b + ")", __FILE__, __LINE__) - -#define BOOST_ASSERT(cond) BOOST_REQUIRE(cond) - -#define BOOST_REQUIRE_THROW(expr, exctype) \ - do { \ - bool coin_threw = false; \ - try { (void)(expr); } catch (const exctype &) { coin_threw = true; } \ - ::CoinTest::require(coin_threw, std::string("expected throw: ") + #expr, __FILE__, __LINE__); \ - } while (0) - -#define BOOST_STATIC_ASSERT(expr) static_assert((expr), #expr) - #endif // !COIN_TESTSUITE_COINTTEST_H diff --git a/testsuite/README b/testsuite/README index d4e0aabb233..9451e68f5d6 100644 --- a/testsuite/README +++ b/testsuite/README @@ -1,59 +1,43 @@ Coin Test-Suite Instructions -The test-suite uses an in-tree, minimal test runner (`testsuite/CoinTest.h`) -that provides a small subset of Boost.Test-style macros (e.g. -`BOOST_AUTO_TEST_CASE`, `BOOST_CHECK_MESSAGE`). +The test-suite uses Catch2 v2.13.10, vendored under +`testsuite/thirdparty/catch2`. Coin-specific initialization and test helpers +remain in `testsuite/CoinTest.h`. -Test-code is written in the implementation file of the component to -be tested. The test-code is wrapped inside a define-wrapper like this: +Component tests live in standalone `*Test.cpp` files below `testsuite/`, +grouped by subsystem. Each file includes the public header for the component +under test and registers its cases with a suite name, for example: - #ifdef COIN_TEST_SUITE + #include + #include "CoinTest.h" - BOOST_AUTO_TEST_CASE(name) + TEST_CASE("SbVec3f_TestSuite.example", "[SbVec3f_TestSuite]") { // test-code ... } - #endif // COIN_TEST_SUITE +Only public parts of the API can be tested in this test-suite because it is +built separately from Coin and linked with the library. -Note the comment behind the #endif-directive. It is necessary to -include the COIN_TEST_SUITE token for the extractor to be able to -detect the end of the testsuite block. +When adding a test file, place it below the appropriate `testsuite/` subsystem +directory and give it a name ending in `Test.cpp`. Register cases with +Catch2's `TEST_CASE` and use its assertions such as `CHECK`, `REQUIRE`, and +`INFO`. CMake discovers these sources automatically and converts the Catch2 +registry into individual CTest tests after the executable is built. -One Coin-component implementation file may have multiple test-suite -blocks, it is not limited to one. +Useful commands from the build directory include: -You can also add/implement utility functions outside the -BOOST_AUTO_TEST_CASE blocks to structure code better. + ./bin/CoinTests --list-test-names-only + ctest -N + ctest -R 'CoinTests\.base\.' --output-on-failure + ctest --output-on-failure -Every file that includes test-suite blocks need to have as the first -#include-file the header that declares the component implemented in -the cpp-file. Otherwise the test-suite part won't be able to compile. -You can add #include-directives in the COIN_TESTSUITE_BLOCK though, -and get compilation to work that way. +The CTest names are prefixed with `CoinTests.`, so a single case can be +selected with `ctest -R 'CoinTests\.\.'`. Catch2 test specs can +also be passed directly to the executable, for example: -Only public parts of the API can be tested in this test-suite because -it is built separately outside Coin and then linked with Coin. + ./bin/CoinTests "SbVec3f_TestSuite.example" -When a new cpp-file gets its first test-case, the test-suite does not -are discovered by the CMake-based testsuite extractor (`testsuite/CMakeLists.txt`) -and compiled into the `CoinTests` executable. -The thing that doesn't get updated automatically is the *list* of -files that actually contain test-case code, which you must trigger -manual updating of by running "make makefile-update" as mentioned above. - -Run the tests by running "make testsuite-run" in the top-level directory, -or by running "make" in the testsuite directory (after building Coin, of -course). - -If the test-suite crashes (as opposed to just reporting errors), -running "make verbose" might be helpful to figure out exactly which -test-case is the one that causes the problem, or "make debug" to make -the testsuite run in gdb so you end up in the debugger when the -testsuite crashes. This works only on platforms that use gcc and gdb -as the compiler/debugger suite (Linux, OS X, unixes...) and is not -supported on Windows for now. - -That's it. - -/2008-11-16 larsa +If the test-suite crashes, select a narrow CTest expression or invoke the +executable directly with a Catch2 test spec to identify the failing case +before using a debugger. diff --git a/testsuite/StandardTests.cpp b/testsuite/StandardTests.cpp index ba185427e91..18c1494ae20 100644 --- a/testsuite/StandardTests.cpp +++ b/testsuite/StandardTests.cpp @@ -50,22 +50,17 @@ namespace { static std::vector standardSuffixes(standardSuffixes_initializer,&standardSuffixes_initializer[sizeof(standardSuffixes_initializer)/sizeof(standardSuffixes_initializer[0])]); } - -BOOST_AUTO_TEST_SUITE(StandardTests); - -BOOST_AUTO_TEST_CASE(loadCorrectfiles) +TEST_CASE("StandardTests.loadCorrectfiles", "[StandardTests]") { TestSuite::test_all_files("models",standardSuffixes,&TestSuite::testCorrectFile); } -BOOST_AUTO_TEST_CASE(loadIncorrectfiles) +TEST_CASE("StandardTests.loadIncorrectfiles", "[StandardTests]") { TestSuite::test_all_files("killers",standardSuffixes,&TestSuite::testIncorrectFile); } -BOOST_AUTO_TEST_CASE(loadOutOfSpecFilesWhichWeAccept) +TEST_CASE("StandardTests.loadOutOfSpecFilesWhichWeAccept", "[StandardTests]") { TestSuite::test_all_files("slackers",standardSuffixes,&TestSuite::testOutOfSpecFile); } - -BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/TestSuiteMain.cpp b/testsuite/TestSuiteMain.cpp index aeb890d6d3e..0f198b76004 100644 --- a/testsuite/TestSuiteMain.cpp +++ b/testsuite/TestSuiteMain.cpp @@ -30,12 +30,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \**************************************************************************/ -#include +#define CATCH_CONFIG_RUNNER +#include #include #include #include "TestSuiteUtils.h" -#include "CoinTest.h" using namespace SIM::Coin3D::Coin; @@ -46,7 +46,8 @@ int main(int argc, char* argv[]) SoInteraction::init(); TestSuite::Init(); - int rc = CoinTest::run_all(); + Catch::Session session; + int rc = session.run(argc, argv); SoDB::finish(); diff --git a/testsuite/TestSuiteMisc.h b/testsuite/TestSuiteMisc.h index 9c7305dc825..aeb1f9d0a4d 100644 --- a/testsuite/TestSuiteMisc.h +++ b/testsuite/TestSuiteMisc.h @@ -103,7 +103,7 @@ floatEquals(float a, float b, float tol) return fabs(b-a)/fabs(a) { { using namespace internal; bool cmp=fuzzyCompare(v1,v2, tolerance); - BOOST_CHECK_MESSAGE(cmp, txt+": "+to::Dimensions>::String(v1) + " != "+ to::Dimensions>::String(v2) ); + do { INFO(txt+": "+to::Dimensions>::String(v1) + " != "+ to::Dimensions>::String(v2)); CHECK((cmp)); } while (false); return cmp; } }}} diff --git a/testsuite/TestSuiteTemplate.cmake.in b/testsuite/TestSuiteTemplate.cmake.in index d56297079f0..df455d17f3d 100644 --- a/testsuite/TestSuiteTemplate.cmake.in +++ b/testsuite/TestSuiteTemplate.cmake.in @@ -30,6 +30,17 @@ * 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 @@ -41,6 +52,4 @@ using namespace SIM::Coin3D::Coin; using namespace SIM::Coin3D::Coin::TestSuite; @COIN_STR_TEST_INCL@ -BOOST_AUTO_TEST_SUITE(@COIN_STR_TEST_CLASS@_TestSuite); @COIN_STR_TEST_CODE@ -BOOST_AUTO_TEST_SUITE_END(); diff --git a/testsuite/TestSuiteUtils.cpp b/testsuite/TestSuiteUtils.cpp index 1f5b56625e3..e68f61f6459 100644 --- a/testsuite/TestSuiteUtils.cpp +++ b/testsuite/TestSuiteUtils.cpp @@ -431,20 +431,20 @@ TestSuite::test_all_files(const std::string & search_directory, bool TestSuite::testCorrectFile(SoNode * root, const std::string & filename) { - BOOST_CHECK_MESSAGE((root != NULL) && (GetReadErrorCount() == 0), (std::string("failed to read file ") + filename).c_str()); + do { INFO(std::string("failed to read file ") + filename); CHECK(((root != NULL) && (GetReadErrorCount() == 0))); } while (false); ResetReadErrorCount(); return root != NULL; } bool TestSuite::testIncorrectFile(SoNode * root, const std::string & filename) { - BOOST_CHECK_MESSAGE((root == NULL) || (GetReadErrorCount() > 0), (std::string("Managed to read an incorrect file ") + filename).c_str()); + do { INFO(std::string("Managed to read an incorrect file ") + filename); CHECK(((root == NULL) || (GetReadErrorCount() > 0))); } while (false); ResetReadErrorCount(); return root != NULL; } bool TestSuite::testOutOfSpecFile(SoNode * root, const std::string & filename) { - BOOST_CHECK_MESSAGE(root != NULL, (std::string("This out of spec file could be read in an earlier version ") + filename).c_str()); + do { INFO(std::string("This out of spec file could be read in an earlier version ") + filename); CHECK((root != NULL)); } while (false); return root != NULL; } diff --git a/testsuite/actions/SoCallbackActionTest.cpp b/testsuite/actions/SoCallbackActionTest.cpp new file mode 100644 index 00000000000..66973fd7285 --- /dev/null +++ b/testsuite/actions/SoCallbackActionTest.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 +#include +#include + +static SoCallbackAction::Response +preCB(void * userdata, SoCallbackAction *, const SoNode * node) +{ + SbString *str = (SbString *)userdata; + (*str) += node->getName(); + return SoCallbackAction::CONTINUE; +} + +TEST_CASE("SoCallbackAction_TestSuite.callbackall", "[SoCallbackAction_TestSuite]") +{ + 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); + do { INFO("Should not traverse under switch node"); CHECK((str == "switch")); } while (false); + + str = ""; + cba.setCallbackAll(true); + cba.apply(sw); + do { INFO("Should traverse under switch node"); CHECK((str == "switchcube")); } while (false); + + sw->unref(); +} diff --git a/testsuite/actions/SoWriteActionTest.cpp b/testsuite/actions/SoWriteActionTest.cpp new file mode 100644 index 00000000000..86f2dcc5cd9 --- /dev/null +++ b/testsuite/actions/SoWriteActionTest.cpp @@ -0,0 +1,130 @@ +/**************************************************************************\ +* 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 + +// check that the realTime GlobalField is written if it has any +// forward connections. + +TEST_CASE("SoWriteAction_TestSuite.GlobalField", "[SoWriteAction_TestSuite]") +{ + 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); + 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); + REQUIRE((top)); + top->ref(); + + SoText2 * text = (SoText2 *)top->getChild(0); + REQUIRE((text)); + + SoField * string = text->getField("string"); + REQUIRE((string)); + do { INFO("String field not connected to realTime field in written scene graph"); CHECK((string->isConnected())); } while (false); + + free(buffer); + + top->unref(); + + //Restore state + realtime->setValue(realTimeStorage); + +} diff --git a/testsuite/base/SbBSPTreeTest.cpp b/testsuite/base/SbBSPTreeTest.cpp new file mode 100644 index 00000000000..69ad0dabccb --- /dev/null +++ b/testsuite/base/SbBSPTreeTest.cpp @@ -0,0 +1,97 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SbBSPTree_TestSuite.SbBSPTree_initialized", "[SbBSPTree_TestSuite]") +{ + 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); + + do { INFO("unexpected index"); CHECK((bsp.addPoint(p0, userdata0) == 0)); } while (false); + do { INFO("unexpected index"); CHECK((bsp.addPoint(p1, userdata1) == 1)); } while (false); + do { INFO("unexpected index"); CHECK((bsp.addPoint(p2, userdata2) == 2)); } while (false); + do { INFO("unexpected index"); CHECK((bsp.addPoint(p2, userdata2) == 2)); } while (false); + do { INFO("wrong number of points in the tree"); CHECK((bsp.numPoints() == 3)); } while (false); + + do { INFO("wrong index"); CHECK((bsp.findPoint(p0) == 0)); } while (false); + do { INFO("wrong userdata"); CHECK((bsp.getUserData(0) == userdata0)); } while (false); + do { INFO("wrong index"); CHECK((bsp.findPoint(p1) == 1)); } while (false); + do { INFO("wrong userdata"); CHECK((bsp.getUserData(1) == userdata1)); } while (false); + do { INFO("wrong index"); CHECK((bsp.findPoint(p2) == 2)); } while (false); + do { INFO("wrong userdata"); CHECK((bsp.getUserData(2) == userdata2)); } while (false); + + do { INFO("wrong number of points in the tree"); CHECK((bsp.numPoints() == 3)); } while (false); + do { INFO("wrong point at index 0"); CHECK((bsp.getPointsArrayPtr()[0] == p0)); } while (false); + do { INFO("wrong point at index 1"); CHECK((bsp.getPointsArrayPtr()[1] == p1)); } while (false); + do { INFO("wrong point at index 2"); CHECK((bsp.getPointsArrayPtr()[2] == p2)); } while (false); + + do { INFO("unable to remove point"); CHECK((bsp.removePoint(p1) == 1)); } while (false); + do { INFO("wrong number of points after removePoint()."); CHECK((bsp.numPoints() == 2)); } while (false); + do { INFO("wrong point at index 0"); CHECK((bsp.getPointsArrayPtr()[0] == p0)); } while (false); + do { INFO("wrong userdata"); CHECK((bsp.getUserData(0) == userdata0)); } while (false); + do { INFO("wrong point at index 1"); CHECK((bsp.getPointsArrayPtr()[1] == p2)); } while (false); + do { INFO("wrong userdata"); CHECK((bsp.getUserData(1) == userdata2)); } while (false); + + do { INFO("unable to remove point"); CHECK((bsp.removePoint(p0) >= 0)); } while (false); + do { INFO("unable to remove point"); CHECK((bsp.removePoint(p2) >= 0)); } while (false); + do { INFO("wrong number of points after removing all points."); CHECK((bsp.numPoints() == 0)); } while (false); + +} diff --git a/testsuite/base/SbBox2dTest.cpp b/testsuite/base/SbBox2dTest.cpp new file mode 100644 index 00000000000..88705e4932c --- /dev/null +++ b/testsuite/base/SbBox2dTest.cpp @@ -0,0 +1,82 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SbBox2d_TestSuite.checkSize", "[SbBox2d_TestSuite]") { + SbVec2d min(1,2); + SbVec2d max(3,4); + + SbVec2d diff = max - min; + + SbBox2d box(min, max); + + do { INFO("Box has incorrect size"); CHECK((box.getSize() == diff)); } while (false); +} +TEST_CASE("SbBox2d_TestSuite.checkGetClosestPoint", "[SbBox2d_TestSuite]") { + SbVec2d point(1524, 13794); + SbVec2d min(1557, 3308); + SbVec2d max(3113, 30157); + + SbBox2d box(min, max); + SbVec2d expected(1557, 13794); + + do { INFO("Closest point does not fit"); CHECK((box.getClosestPoint(point) == expected)); } while (false); + + SbVec2d sizes = box.getSize(); + SbVec2d expectedCenterQuery(max[0], sizes[1] / 2.0); + + do { INFO("Closest point for center query does not fit"); CHECK((box.getClosestPoint(box.getCenter()) == expectedCenterQuery)); } while (false); +} diff --git a/testsuite/base/SbBox2fTest.cpp b/testsuite/base/SbBox2fTest.cpp new file mode 100644 index 00000000000..9566136c177 --- /dev/null +++ b/testsuite/base/SbBox2fTest.cpp @@ -0,0 +1,82 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SbBox2f_TestSuite.checkSize", "[SbBox2f_TestSuite]") { + SbVec2f min(1,2); + SbVec2f max(3,4); + + SbVec2f diff = max - min; + + SbBox2f box(min, max); + + do { INFO("Box has incorrect size"); CHECK((box.getSize() == diff)); } while (false); +} +TEST_CASE("SbBox2f_TestSuite.checkGetClosestPoint", "[SbBox2f_TestSuite]") { + SbVec2f point(1524, 13794); + SbVec2f min(1557, 3308); + SbVec2f max(3113, 30157); + + SbBox2f box(min, max); + SbVec2f expected(1557, 13794); + + do { INFO("Closest point does not fit"); CHECK((box.getClosestPoint(point) == expected)); } while (false); + + SbVec2f sizes = box.getSize(); + SbVec2f expectedCenterQuery(max[0], sizes[1] / 2.0f); + + do { INFO("Closest point for center query does not fit"); CHECK((box.getClosestPoint(box.getCenter()) == expectedCenterQuery)); } while (false); +} diff --git a/testsuite/base/SbBox2i32Test.cpp b/testsuite/base/SbBox2i32Test.cpp new file mode 100644 index 00000000000..442f500d8ad --- /dev/null +++ b/testsuite/base/SbBox2i32Test.cpp @@ -0,0 +1,69 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SbBox2i32_TestSuite.checkSize", "[SbBox2i32_TestSuite]") { + SbVec2i32 min(1,2); + SbVec2i32 max(3,4); + + SbVec2i32 diff = max - min; + + + SbBox2i32 box(min, max); + + do { INFO("Box has incorrect size"); CHECK((box.getSize() == diff)); } while (false); + +} diff --git a/testsuite/base/SbBox2sTest.cpp b/testsuite/base/SbBox2sTest.cpp new file mode 100644 index 00000000000..f8ac850aae7 --- /dev/null +++ b/testsuite/base/SbBox2sTest.cpp @@ -0,0 +1,69 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SbBox2s_TestSuite.checkSize", "[SbBox2s_TestSuite]") { + SbVec2s min(1,2); + SbVec2s max(3,4); + + SbVec2s diff = max - min; + + + SbBox2s box(min, max); + + do { INFO("Box has incorrect size"); CHECK((box.getSize() == diff)); } while (false); + +} diff --git a/testsuite/base/SbBox3dTest.cpp b/testsuite/base/SbBox3dTest.cpp new file mode 100644 index 00000000000..7697ace40b3 --- /dev/null +++ b/testsuite/base/SbBox3dTest.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 + +TEST_CASE("SbBox3d_TestSuite.checkGetClosestPoint", "[SbBox3d_TestSuite]") { + SbVec3d point(1524, 13794, 851); + SbVec3d min(1557, 3308, 850); + SbVec3d max(3113, 30157, 1886); + + SbBox3d box(min, max); + SbVec3d expected(1557, 13794, 851); + + do { INFO("Closest point does not fit"); CHECK((box.getClosestPoint(point) == expected)); } while (false); + + SbVec3d sizes = box.getSize(); + SbVec3d expectedCenterQuery(sizes[0] / 2.0, sizes[1] / 2.0, max[2]); + + do { INFO("Closest point for center query does not fit"); CHECK((box.getClosestPoint(box.getCenter()) == expectedCenterQuery)); } while (false); +} diff --git a/testsuite/base/SbBox3fTest.cpp b/testsuite/base/SbBox3fTest.cpp new file mode 100644 index 00000000000..bd45370ef7e --- /dev/null +++ b/testsuite/base/SbBox3fTest.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 + +TEST_CASE("SbBox3f_TestSuite.checkGetClosestPoint", "[SbBox3f_TestSuite]") { + SbVec3f point(1524 , 13794 , 851); + SbVec3f min(1557, 3308, 850); + SbVec3f max(3113, 30157, 1886); + + SbBox3f box(min, max); + SbVec3f expected(1557, 13794, 851); + + do { INFO("Closest point does not fit"); CHECK((box.getClosestPoint(point) == expected)); } while (false); + + SbVec3f sizes = box.getSize(); + SbVec3f expectedCenterQuery(sizes[0]/2.0f, sizes[1]/2.0f, max[2]); + + do { INFO("Closest point for center query does not fit"); CHECK((box.getClosestPoint(box.getCenter()) == expectedCenterQuery)); } while (false); +} diff --git a/testsuite/base/SbBox3i32Test.cpp b/testsuite/base/SbBox3i32Test.cpp new file mode 100644 index 00000000000..fd69e044bf1 --- /dev/null +++ b/testsuite/base/SbBox3i32Test.cpp @@ -0,0 +1,82 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SbBox3i32_TestSuite.checkSize", "[SbBox3i32_TestSuite]") { + SbVec3i32 min(1,2,3); + SbVec3i32 max(3,4,5); + + SbVec3i32 diff = max - min; + + SbBox3i32 box(min, max); + + do { INFO("Box has incorrect size"); CHECK((box.getSize() == diff)); } while (false); +} +TEST_CASE("SbBox3i32_TestSuite.checkGetClosestPoint", "[SbBox3i32_TestSuite]") { + SbVec3f point(1524 , 13794 , 851); + SbVec3i32 min(1557, 3308, 850); + SbVec3i32 max(3113, 30157, 1886); + + SbBox3i32 box(min, max); + SbVec3f expected(1557, 13794, 851); + + do { INFO("Closest point does not fit"); CHECK((box.getClosestPoint(point) == expected)); } while (false); + + SbVec3i32 sizes = box.getSize(); + SbVec3f expectedCenterQuery(sizes[0]/2.0f, sizes[1]/2.0f, (float)max[2]); + + do { INFO("Closest point for center query does not fit"); CHECK((box.getClosestPoint(box.getCenter()) == expectedCenterQuery)); } while (false); +} diff --git a/testsuite/base/SbBox3sTest.cpp b/testsuite/base/SbBox3sTest.cpp new file mode 100644 index 00000000000..785f8ef5883 --- /dev/null +++ b/testsuite/base/SbBox3sTest.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 + +TEST_CASE("SbBox3s_TestSuite.checkSize", "[SbBox3s_TestSuite]") { + SbVec3s min(1,2,3); + SbVec3s max(3,4,5); + + SbVec3s diff = max - min; + + SbBox3s box(min, max); + + do { INFO("Box has incorrect size"); CHECK((box.getSize() == diff)); } while (false); +} +TEST_CASE("SbBox3s_TestSuite.checkGetClosestPoint", "[SbBox3s_TestSuite]") { + SbVec3f point(1524 , 13794 , 851); + SbVec3s min(1557, 3308, 850); + SbVec3s max(3113, 30157, 1886); + + SbBox3s box(min, max); + SbVec3f expected(1557, 13794, 851); + + do { INFO("Closest point does not fit"); CHECK((box.getClosestPoint(point) == expected)); } while (false); + + SbVec3s sizes = box.getSize(); + SbVec3f expectedCenterQuery(sizes[0]/2.0f, sizes[1]/2.0f, max[2]); + + do { INFO("Closest point for center query does not fit"); CHECK((box.getClosestPoint(box.getCenter()) == expectedCenterQuery)); } while (false); +} diff --git a/testsuite/base/SbByteBufferTest.cpp b/testsuite/base/SbByteBufferTest.cpp new file mode 100644 index 00000000000..3bfd46629ed --- /dev/null +++ b/testsuite/base/SbByteBufferTest.cpp @@ -0,0 +1,109 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SbByteBuffer_TestSuite.pushUnique", "[SbByteBuffer_TestSuite]") +{ + + 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 + +TEST_CASE("SbDPMatrix_TestSuite.constructFromSbMatrix", "[SbDPMatrix_TestSuite]") { + 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); + do { INFO("Equality comparison failed!"); CHECK((b == d)); } while (false); +} diff --git a/testsuite/base/SbDPPlaneTest.cpp b/testsuite/base/SbDPPlaneTest.cpp new file mode 100644 index 00000000000..1aabb82faa2 --- /dev/null +++ b/testsuite/base/SbDPPlaneTest.cpp @@ -0,0 +1,201 @@ +/**************************************************************************\ +* 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 + +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 + +TEST_CASE("SbDPRotation_TestSuite.tgsCompliance", "[SbDPRotation_TestSuite]") { + SbDPRotation v = SbRotationd(SbVec3d(0,1,2),3); +} diff --git a/testsuite/base/SbImageTest.cpp b/testsuite/base/SbImageTest.cpp new file mode 100644 index 00000000000..707b96a135d --- /dev/null +++ b/testsuite/base/SbImageTest.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 + +TEST_CASE("SbImage_TestSuite.copyConstruct", "[SbImage_TestSuite]") +{ + 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 + +TEST_CASE("SbMatrix_TestSuite.constructFromSbDPMatrix", "[SbMatrix_TestSuite]") { + 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); + do { INFO("Equality comparison failed!"); CHECK((b == d)); } while (false); +} diff --git a/testsuite/base/SbPlaneTest.cpp b/testsuite/base/SbPlaneTest.cpp new file mode 100644 index 00000000000..e06d15ab81a --- /dev/null +++ b/testsuite/base/SbPlaneTest.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 +#include +#include + +using namespace SIM::Coin::TestSuite; + +TEST_CASE("SbPlane_TestSuite.signCorrect", "[SbPlane_TestSuite]") +{ + 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); + +} diff --git a/testsuite/base/SbRotationTest.cpp b/testsuite/base/SbRotationTest.cpp new file mode 100644 index 00000000000..636883e1da6 --- /dev/null +++ b/testsuite/base/SbRotationTest.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 +#include +#include +#include +#include +#include + +typedef SbRotation ToTest; +TEST_CASE("SbRotation_TestSuite.operatorBrackets", "[SbRotation_TestSuite]") +{ + 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; + do { INFO(std::string("Wrong value when trying to access value #") + + ::CoinTest::stringify(i) + + ": " + + ::CoinTest::stringify(rot[i]) + + " == " + + ::CoinTest::stringify(testVal)); CHECK((floatEquals(testVal,rot[i],FLOAT_SENSITIVITY))); } while (false); + } +} + +TEST_CASE("SbRotation_TestSuite.toString", "[SbRotation_TestSuite]") { + 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]); + do { INFO(std::string("Mismatch between ") + val.toString().getString() + " and control string " + str.getString()); CHECK((actual.equals(expected, 0.000001f))); } while (false); + +} + +TEST_CASE("SbRotation_TestSuite.fromString", "[SbRotation_TestSuite]") { + ToTest foo; + SbString test = "0 -1 0 1"; + ToTest trueVal(SbVec3f(0, -1, 0), 1); + SbBool conversionOk = foo.fromString(test); + do { INFO(std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); CHECK((conversionOk && trueVal == foo)); } while (false); +} + +TEST_CASE("SbRotation_TestSuite.fromInvalidString", "[SbRotation_TestSuite]") { + ToTest foo; + SbString test = "2.- 2 3 4"; + ToTest trueVal(1,2,3,4); + SbBool conversionOk = foo.fromString(test); + do { INFO(std::string("Able to convert from ") + test.getString() + " which is not a valid " + SbTypeInfo::getTypeName() + " representation"); CHECK((conversionOk == FALSE)); } while (false); +} diff --git a/testsuite/base/SbStringTest.cpp b/testsuite/base/SbStringTest.cpp new file mode 100644 index 00000000000..56ebfa8d3c2 --- /dev/null +++ b/testsuite/base/SbStringTest.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 +#include + +static void * createInstance(void) +{ + return (void *)0x1234; +} + +TEST_CASE("SbString_TestSuite.testAddition", "[SbString_TestSuite]") +{ + 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; + + do { INFO("operator+ error"); CHECK((a == SbString("FirstSecond"))); } while (false); + do { INFO("operator+ error"); CHECK((b == SbString("ErsteSecond"))); } while (false); + do { INFO("operator+ error"); CHECK((c == SbString("FirstZweite"))); } while (false); +} diff --git a/testsuite/base/SbVec3dTest.cpp b/testsuite/base/SbVec3dTest.cpp new file mode 100644 index 00000000000..b59fb30a887 --- /dev/null +++ b/testsuite/base/SbVec3dTest.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 + +typedef SbVec3d ToTest; +TEST_CASE("SbVec3d_TestSuite.toString", "[SbVec3d_TestSuite]") { + ToTest val(1.0/3,2,3); + SbString str("0.3333333333333333 2 3"); + do { INFO(std::string("Mismatch between ") + val.toString().getString() + " and control string " + str.getString()); CHECK((str == val.toString())); } while (false); + +} + +TEST_CASE("SbVec3d_TestSuite.fromString", "[SbVec3d_TestSuite]") { + ToTest foo; + SbString test = "0.3333333333333333 -2 -3.0"; + ToTest trueVal(0.3333333333333333,-2,-3); + SbBool conversionOk = foo.fromString(test); + do { INFO(std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); CHECK((conversionOk && trueVal == foo)); } while (false); +} diff --git a/testsuite/base/SbVec3fTest.cpp b/testsuite/base/SbVec3fTest.cpp new file mode 100644 index 00000000000..6bc76bc2b60 --- /dev/null +++ b/testsuite/base/SbVec3fTest.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 + +typedef SbVec3f ToTest; +TEST_CASE("SbVec3f_TestSuite.toString", "[SbVec3f_TestSuite]") { + ToTest val(1.0f/3,2,3); + SbString str("0.33333334 2 3"); + do { INFO(std::string("Mismatch between ") + val.toString().getString() + " and control string " + str.getString()); CHECK((str == val.toString())); } while (false); + +} + +TEST_CASE("SbVec3f_TestSuite.fromString", "[SbVec3f_TestSuite]") { + ToTest foo; + SbString test = "0.333333343 -2 -3.0"; + ToTest trueVal(0.333333343f,-2,-3); + SbBool conversionOk = foo.fromString(test); + do { INFO(std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); CHECK((conversionOk && trueVal == foo)); } while (false); +} + +TEST_CASE("SbVec3f_TestSuite.fromInvalidString1", "[SbVec3f_TestSuite]") { + ToTest foo; + SbString test = "a 2 3"; + SbBool conversionOk = foo.fromString(test); + do { INFO(std::string("Able to convert from ") + test.getString() + " which is not a valid " + SbTypeInfo::getTypeName() + " representation"); CHECK((conversionOk == FALSE)); } while (false); +} + +TEST_CASE("SbVec3f_TestSuite.fromInvalidString2", "[SbVec3f_TestSuite]") { + ToTest foo; + SbString test = "1,2,3"; + SbBool conversionOk = foo.fromString(test); + do { INFO(std::string("Able to convert from ") + test.getString() + " which is not a valid " + SbTypeInfo::getTypeName() + " representation"); CHECK((conversionOk == FALSE)); } while (false); +} diff --git a/testsuite/base/SbVec3sTest.cpp b/testsuite/base/SbVec3sTest.cpp new file mode 100644 index 00000000000..eaa03a8106b --- /dev/null +++ b/testsuite/base/SbVec3sTest.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 + +typedef SbVec3s ToTest; +TEST_CASE("SbVec3s_TestSuite.toString", "[SbVec3s_TestSuite]") { + ToTest val(1,2,3); + SbString str("1 2 3"); + do { INFO(std::string("Mismatch between ") + val.toString().getString() + " and control string " + str.getString()); CHECK((str == val.toString())); } while (false); +} + +TEST_CASE("SbVec3s_TestSuite.fromString", "[SbVec3s_TestSuite]") { + ToTest foo; + SbString test = "1 -2 3"; + ToTest trueVal(1,-2,3); + foo.fromString(test); + do { INFO(std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); CHECK((trueVal == foo)); } while (false); +} + +TEST_CASE("SbVec3s_TestSuite.fromInvalidString", "[SbVec3s_TestSuite]") { + ToTest foo; + SbString test = "a,2,3"; + SbBool conversionOk = foo.fromString(test); + do { INFO(std::string("Able to convert from ") + test.getString() + " which is not a valid " + SbTypeInfo::getTypeName() + " representation"); CHECK((conversionOk == FALSE)); } while (false); +} diff --git a/testsuite/base/SbVec3usTest.cpp b/testsuite/base/SbVec3usTest.cpp new file mode 100644 index 00000000000..2b5821e296d --- /dev/null +++ b/testsuite/base/SbVec3usTest.cpp @@ -0,0 +1,56 @@ +/**************************************************************************\ +* 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 diff --git a/testsuite/base/SbVec4fTest.cpp b/testsuite/base/SbVec4fTest.cpp new file mode 100644 index 00000000000..1700628f215 --- /dev/null +++ b/testsuite/base/SbVec4fTest.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 + +TEST_CASE("SbVec4f_TestSuite.noNormalizingNormalized", "[SbVec4f_TestSuite]") +{ + 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; + do { INFO(std::string("Wrong value when trying to access value #") + + ::CoinTest::stringify(i) + + ": " + + ::CoinTest::stringify(vec[i]) + + " == " + + ::CoinTest::stringify(testVal)); CHECK((testVal==vec[i])); } while (false); + } + +} + +TEST_CASE("SbVec4f_TestSuite.normalizingDeNormalized", "[SbVec4f_TestSuite]") +{ + 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; + do { INFO(std::string("Wrong value when trying to access value #") + + ::CoinTest::stringify(i) + + ": " + + ::CoinTest::stringify(vec[i]) + + " == " + + ::CoinTest::stringify(testVal)); CHECK((floatEquals(testVal,vec[i],FLOAT_SENSITIVITY))); } while (false); + } + +} diff --git a/testsuite/base/SbViewVolumeTest.cpp b/testsuite/base/SbViewVolumeTest.cpp new file mode 100644 index 00000000000..24a062c54c9 --- /dev/null +++ b/testsuite/base/SbViewVolumeTest.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 +#include +#include + +TEST_CASE("SbViewVolume_TestSuite.intersect_ortho", "[SbViewVolume_TestSuite]") +{ + 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); +} + +TEST_CASE("SbViewVolume_TestSuite.intersect_bbox_inside_vv", "[SbViewVolume_TestSuite]") +{ + 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); +} + +TEST_CASE("SbViewVolume_TestSuite.intersect_vv_inside_bbox", "[SbViewVolume_TestSuite]") +{ + 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); +} + +TEST_CASE("SbViewVolume_TestSuite.intersect_perspective", "[SbViewVolume_TestSuite]") +{ + // 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); +} diff --git a/testsuite/base/heapTest.cpp b/testsuite/base/heapTest.cpp new file mode 100644 index 00000000000..a1f6dd0bbe2 --- /dev/null +++ b/testsuite/base/heapTest.cpp @@ -0,0 +1,158 @@ +/**************************************************************************\ +* 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 + +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; + } +}; + +TEST_CASE("heap_TestSuite.min_heap", "[heap_TestSuite]") { + 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 "); + do { INFO(std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); CHECK((str == result)); } while (false); +} + +TEST_CASE("heap_TestSuite.max_heap", "[heap_TestSuite]") { + 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 "); + do { INFO(std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); CHECK((str == result)); } while (false); +} + +TEST_CASE("heap_TestSuite.heap_add", "[heap_TestSuite]") { + 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 "); + do { INFO(std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); CHECK((str == result)); } while (false); +} + +TEST_CASE("heap_TestSuite.heap_remove", "[heap_TestSuite]") { + 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 "); + do { INFO(std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); CHECK((str == result)); } while (false); +} + +TEST_CASE("heap_TestSuite.heap_update", "[heap_TestSuite]") { + 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 "); + do { INFO(std::string("Mismatch between ") + result.getString() + " and control string " + str.getString()); CHECK((str == result)); } while (false); +} diff --git a/testsuite/base/rbptreeTest.cpp b/testsuite/base/rbptreeTest.cpp new file mode 100644 index 00000000000..c9456ec983d --- /dev/null +++ b/testsuite/base/rbptreeTest.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 +#include +#include + +#define FILL_TIMES (50) +#define FILL_COUNT (10000) + +TEST_CASE("rbptree_TestSuite.rbptree_stress", "[rbptree_TestSuite]") +{ + 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); + } + REQUIRE((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]); + } + REQUIRE((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); + } + REQUIRE((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]); + } + REQUIRE((cc_rbptree_size(&tree) == 0)); + + } + + + cc_rbptree_clean(&tree); +} diff --git a/testsuite/draggers/SoTransformerDraggerTest.cpp b/testsuite/draggers/SoTransformerDraggerTest.cpp new file mode 100644 index 00000000000..f45bd36fa7d --- /dev/null +++ b/testsuite/draggers/SoTransformerDraggerTest.cpp @@ -0,0 +1,127 @@ +/**************************************************************************\ +* 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 + +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; + REQUIRE((!copydict->find(entry, val))); +} + +TEST_CASE("SoTransformerDragger_TestSuite.dragger_deep_copy", "[SoTransformerDragger_TestSuite]") +{ + 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(); + + REQUIRE((origdictsize == copydictsize)); + + // make sure pointer sets have an empty union + origdict.applyToAll(ensure_unique_cb, ©dict); + + root->unref(); + copy->unref(); +} diff --git a/testsuite/fields/SoMFBitMaskTest.cpp b/testsuite/fields/SoMFBitMaskTest.cpp new file mode 100644 index 00000000000..7251a913c3a --- /dev/null +++ b/testsuite/fields/SoMFBitMaskTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFBitMask_TestSuite.SoMFBitMask_initialized", "[SoMFBitMask_TestSuite]") +{ + SoMFBitMask field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFBoolTest.cpp b/testsuite/fields/SoMFBoolTest.cpp new file mode 100644 index 00000000000..68c3476f218 --- /dev/null +++ b/testsuite/fields/SoMFBoolTest.cpp @@ -0,0 +1,76 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFBool_TestSuite.SoMFBool_initialized", "[SoMFBool_TestSuite]") +{ + SoMFBool field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} + +TEST_CASE("SoMFBool_TestSuite.array_ops", "[SoMFBool_TestSuite]") +{ + SoMFBool field; + field.set1Value(0, TRUE); + field.set1Value(1, FALSE); + field.set1Value(2, TRUE); + CHECK(((field.getNum()) == (3))); + field.deleteValues(1,1); + CHECK(((field.getNum()) == (2))); + CHECK(((field[0]) == (TRUE))); + CHECK(((field[1]) == (TRUE))); +} diff --git a/testsuite/fields/SoMFColorRGBATest.cpp b/testsuite/fields/SoMFColorRGBATest.cpp new file mode 100644 index 00000000000..ee1c189e1f5 --- /dev/null +++ b/testsuite/fields/SoMFColorRGBATest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFColorRGBA_TestSuite.SoMFColorRGBA_initialized", "[SoMFColorRGBA_TestSuite]") +{ + SoMFColorRGBA field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFColorTest.cpp b/testsuite/fields/SoMFColorTest.cpp new file mode 100644 index 00000000000..6a163501272 --- /dev/null +++ b/testsuite/fields/SoMFColorTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFColor_TestSuite.SoMFColor_initialized", "[SoMFColor_TestSuite]") +{ + SoMFColor field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFDoubleTest.cpp b/testsuite/fields/SoMFDoubleTest.cpp new file mode 100644 index 00000000000..4c94bc1df80 --- /dev/null +++ b/testsuite/fields/SoMFDoubleTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFDouble_TestSuite.SoMFDouble_initialized", "[SoMFDouble_TestSuite]") +{ + SoMFDouble field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFEngineTest.cpp b/testsuite/fields/SoMFEngineTest.cpp new file mode 100644 index 00000000000..462d70b870d --- /dev/null +++ b/testsuite/fields/SoMFEngineTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFEngine_TestSuite.SoMFEngine_initialized", "[SoMFEngine_TestSuite]") +{ + SoMFEngine field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFEnumTest.cpp b/testsuite/fields/SoMFEnumTest.cpp new file mode 100644 index 00000000000..2d7c3ca9781 --- /dev/null +++ b/testsuite/fields/SoMFEnumTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFEnum_TestSuite.SoMFEnum_initialized", "[SoMFEnum_TestSuite]") +{ + SoMFEnum field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFFloatTest.cpp b/testsuite/fields/SoMFFloatTest.cpp new file mode 100644 index 00000000000..f4751ea0c0f --- /dev/null +++ b/testsuite/fields/SoMFFloatTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFFloat_TestSuite.SoMFFloat_initialized", "[SoMFFloat_TestSuite]") +{ + SoMFFloat field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFInt32Test.cpp b/testsuite/fields/SoMFInt32Test.cpp new file mode 100644 index 00000000000..9577e3dfee0 --- /dev/null +++ b/testsuite/fields/SoMFInt32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFInt32_TestSuite.SoMFInt32_initialized", "[SoMFInt32_TestSuite]") +{ + SoMFInt32 field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFMatrixTest.cpp b/testsuite/fields/SoMFMatrixTest.cpp new file mode 100644 index 00000000000..14a94fa7de9 --- /dev/null +++ b/testsuite/fields/SoMFMatrixTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFMatrix_TestSuite.SoMFMatrix_initialized", "[SoMFMatrix_TestSuite]") +{ + SoMFMatrix field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFNameTest.cpp b/testsuite/fields/SoMFNameTest.cpp new file mode 100644 index 00000000000..71c1d75469f --- /dev/null +++ b/testsuite/fields/SoMFNameTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFName_TestSuite.SoMFName_initialized", "[SoMFName_TestSuite]") +{ + SoMFName field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFNodeTest.cpp b/testsuite/fields/SoMFNodeTest.cpp new file mode 100644 index 00000000000..8cd02f753cf --- /dev/null +++ b/testsuite/fields/SoMFNodeTest.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 + +// Do-nothing error handler for ignoring read errors while testing. +static void +readErrorHandler(const SoError * error, void * data) +{ +} + +TEST_CASE("SoMFNode_TestSuite.SoMFNode_initialized", "[SoMFNode_TestSuite]") +{ + SoMFNode field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} + +TEST_CASE("SoMFNode_TestSuite.NULLreading", "[SoMFNode_TestSuite]") +{ + // 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; + do { INFO("DEF/USE reading in SoMFNode is broken"); CHECK((field.read(&in, SbName("test")))); } while (false); + + SoReadError::setHandlerCallback(prevErrorCB, NULL); +} diff --git a/testsuite/fields/SoMFPathTest.cpp b/testsuite/fields/SoMFPathTest.cpp new file mode 100644 index 00000000000..c32ad416e96 --- /dev/null +++ b/testsuite/fields/SoMFPathTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFPath_TestSuite.SoMFPath_initialized", "[SoMFPath_TestSuite]") +{ + SoMFPath field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFPlaneTest.cpp b/testsuite/fields/SoMFPlaneTest.cpp new file mode 100644 index 00000000000..63589aec9fa --- /dev/null +++ b/testsuite/fields/SoMFPlaneTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFPlane_TestSuite.SoMFPlane_initialized", "[SoMFPlane_TestSuite]") +{ + SoMFPlane field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFRotationTest.cpp b/testsuite/fields/SoMFRotationTest.cpp new file mode 100644 index 00000000000..b68a921062f --- /dev/null +++ b/testsuite/fields/SoMFRotationTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFRotation_TestSuite.SoMFRotation_initialized", "[SoMFRotation_TestSuite]") +{ + SoMFRotation field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFShortTest.cpp b/testsuite/fields/SoMFShortTest.cpp new file mode 100644 index 00000000000..497974e61b8 --- /dev/null +++ b/testsuite/fields/SoMFShortTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFShort_TestSuite.SoMFShort_initialized", "[SoMFShort_TestSuite]") +{ + SoMFShort field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFStringTest.cpp b/testsuite/fields/SoMFStringTest.cpp new file mode 100644 index 00000000000..6de5a5d5fd5 --- /dev/null +++ b/testsuite/fields/SoMFStringTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFString_TestSuite.SoMFString_initialized", "[SoMFString_TestSuite]") +{ + SoMFString field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFTimeTest.cpp b/testsuite/fields/SoMFTimeTest.cpp new file mode 100644 index 00000000000..03b36f46959 --- /dev/null +++ b/testsuite/fields/SoMFTimeTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFTime_TestSuite.SoMFTime_initialized", "[SoMFTime_TestSuite]") +{ + SoMFTime field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFUInt32Test.cpp b/testsuite/fields/SoMFUInt32Test.cpp new file mode 100644 index 00000000000..47c0059e7a7 --- /dev/null +++ b/testsuite/fields/SoMFUInt32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFUInt32_TestSuite.SoMFUInt32_initialized", "[SoMFUInt32_TestSuite]") +{ + SoMFUInt32 field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFUShortTest.cpp b/testsuite/fields/SoMFUShortTest.cpp new file mode 100644 index 00000000000..b0012a16ec5 --- /dev/null +++ b/testsuite/fields/SoMFUShortTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFUShort_TestSuite.SoMFUShort_initialized", "[SoMFUShort_TestSuite]") +{ + SoMFUShort field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec2bTest.cpp b/testsuite/fields/SoMFVec2bTest.cpp new file mode 100644 index 00000000000..1ccffc2d4bb --- /dev/null +++ b/testsuite/fields/SoMFVec2bTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec2b_TestSuite.SoMFVec2b_initialized", "[SoMFVec2b_TestSuite]") +{ + SoMFVec2b field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec2dTest.cpp b/testsuite/fields/SoMFVec2dTest.cpp new file mode 100644 index 00000000000..fd83286f4da --- /dev/null +++ b/testsuite/fields/SoMFVec2dTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec2d_TestSuite.SoMFVec2d_initialized", "[SoMFVec2d_TestSuite]") +{ + SoMFVec2d field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec2fTest.cpp b/testsuite/fields/SoMFVec2fTest.cpp new file mode 100644 index 00000000000..ddea7733ccf --- /dev/null +++ b/testsuite/fields/SoMFVec2fTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec2f_TestSuite.SoMFVec2f_initialized", "[SoMFVec2f_TestSuite]") +{ + SoMFVec2f field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec2i32Test.cpp b/testsuite/fields/SoMFVec2i32Test.cpp new file mode 100644 index 00000000000..dd790cf3252 --- /dev/null +++ b/testsuite/fields/SoMFVec2i32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec2i32_TestSuite.SoMFVec2i32_initialized", "[SoMFVec2i32_TestSuite]") +{ + SoMFVec2i32 field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec2sTest.cpp b/testsuite/fields/SoMFVec2sTest.cpp new file mode 100644 index 00000000000..6db17dde072 --- /dev/null +++ b/testsuite/fields/SoMFVec2sTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec2s_TestSuite.SoMFVec2s_initialized", "[SoMFVec2s_TestSuite]") +{ + SoMFVec2s field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec3bTest.cpp b/testsuite/fields/SoMFVec3bTest.cpp new file mode 100644 index 00000000000..67922a7ff60 --- /dev/null +++ b/testsuite/fields/SoMFVec3bTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec3b_TestSuite.SoMFVec3b_initialized", "[SoMFVec3b_TestSuite]") +{ + SoMFVec3b field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec3dTest.cpp b/testsuite/fields/SoMFVec3dTest.cpp new file mode 100644 index 00000000000..9b46be5577d --- /dev/null +++ b/testsuite/fields/SoMFVec3dTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec3d_TestSuite.SoMFVec3d_initialized", "[SoMFVec3d_TestSuite]") +{ + SoMFVec3d field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec3fTest.cpp b/testsuite/fields/SoMFVec3fTest.cpp new file mode 100644 index 00000000000..01758b59149 --- /dev/null +++ b/testsuite/fields/SoMFVec3fTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec3f_TestSuite.SoMFVec3f_initialized", "[SoMFVec3f_TestSuite]") +{ + SoMFVec3f field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec3i32Test.cpp b/testsuite/fields/SoMFVec3i32Test.cpp new file mode 100644 index 00000000000..35cf92f87ba --- /dev/null +++ b/testsuite/fields/SoMFVec3i32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec3i32_TestSuite.SoMFVec3i32_initialized", "[SoMFVec3i32_TestSuite]") +{ + SoMFVec3i32 field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec3sTest.cpp b/testsuite/fields/SoMFVec3sTest.cpp new file mode 100644 index 00000000000..6c613351985 --- /dev/null +++ b/testsuite/fields/SoMFVec3sTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec3s_TestSuite.SoMFVec3s_initialized", "[SoMFVec3s_TestSuite]") +{ + SoMFVec3s field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec4bTest.cpp b/testsuite/fields/SoMFVec4bTest.cpp new file mode 100644 index 00000000000..c9d8a611405 --- /dev/null +++ b/testsuite/fields/SoMFVec4bTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec4b_TestSuite.SoMFVec4b_initialized", "[SoMFVec4b_TestSuite]") +{ + SoMFVec4b field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec4dTest.cpp b/testsuite/fields/SoMFVec4dTest.cpp new file mode 100644 index 00000000000..f18a848c139 --- /dev/null +++ b/testsuite/fields/SoMFVec4dTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec4d_TestSuite.SoMFVec4d_initialized", "[SoMFVec4d_TestSuite]") +{ + SoMFVec4d field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec4fTest.cpp b/testsuite/fields/SoMFVec4fTest.cpp new file mode 100644 index 00000000000..8cf714f053a --- /dev/null +++ b/testsuite/fields/SoMFVec4fTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec4f_TestSuite.SoMFVec4f_initialized", "[SoMFVec4f_TestSuite]") +{ + SoMFVec4f field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec4i32Test.cpp b/testsuite/fields/SoMFVec4i32Test.cpp new file mode 100644 index 00000000000..b2e7fd0bc79 --- /dev/null +++ b/testsuite/fields/SoMFVec4i32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec4i32_TestSuite.SoMFVec4i32_initialized", "[SoMFVec4i32_TestSuite]") +{ + SoMFVec4i32 field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec4sTest.cpp b/testsuite/fields/SoMFVec4sTest.cpp new file mode 100644 index 00000000000..17809b20d25 --- /dev/null +++ b/testsuite/fields/SoMFVec4sTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec4s_TestSuite.SoMFVec4s_initialized", "[SoMFVec4s_TestSuite]") +{ + SoMFVec4s field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec4ubTest.cpp b/testsuite/fields/SoMFVec4ubTest.cpp new file mode 100644 index 00000000000..7b6a415f5c5 --- /dev/null +++ b/testsuite/fields/SoMFVec4ubTest.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 + +TEST_CASE("SoMFVec4ub_TestSuite.SoMFVec4ub_initialized", "[SoMFVec4ub_TestSuite]") +{ + SoMFVec4ub field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} + +TEST_CASE("SoMFVec4ub_TestSuite.textinput", "[SoMFVec4ub_TestSuite]") +{ + SbBool ok; + SoMFVec4ub field; + ok = field.set("[]"); + CHECK(((ok) == (TRUE))); + CHECK(((field.getNum()) == (0))); + ok = field.set("1 2 3 4"); + CHECK(((ok) == (TRUE))); + CHECK(((field.getNum()) == (1))); + ok = field.set("[1 2 3 4]"); + CHECK(((ok) == (TRUE))); + CHECK(((field.getNum()) == (1))); + ok = field.set("[1 2 3 4 1 2 3 4]"); + CHECK(((ok) == (TRUE))); + CHECK(((field.getNum()) == (2))); + CHECK(((field[0]) == (field[1]))); + ok = field.set("[1 2 3 4, 1 2 3 4,]"); + CHECK(((ok) == (TRUE))); + CHECK(((field.getNum()) == (2))); + CHECK(((field[0]) == (field[1]))); +} diff --git a/testsuite/fields/SoMFVec4ui32Test.cpp b/testsuite/fields/SoMFVec4ui32Test.cpp new file mode 100644 index 00000000000..7fe50a27f53 --- /dev/null +++ b/testsuite/fields/SoMFVec4ui32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec4ui32_TestSuite.SoMFVec4ui32_initialized", "[SoMFVec4ui32_TestSuite]") +{ + SoMFVec4ui32 field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoMFVec4usTest.cpp b/testsuite/fields/SoMFVec4usTest.cpp new file mode 100644 index 00000000000..e63b99a3af1 --- /dev/null +++ b/testsuite/fields/SoMFVec4usTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoMFVec4us_TestSuite.SoMFVec4us_initialized", "[SoMFVec4us_TestSuite]") +{ + SoMFVec4us field; + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + CHECK(((field.getNum()) == (0))); +} diff --git a/testsuite/fields/SoSFBitMaskTest.cpp b/testsuite/fields/SoSFBitMaskTest.cpp new file mode 100644 index 00000000000..581148ba71d --- /dev/null +++ b/testsuite/fields/SoSFBitMaskTest.cpp @@ -0,0 +1,130 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFBitMask_TestSuite.SoSFBitMask_initialized", "[SoSFBitMask_TestSuite]") +{ + SoSFBitMask field; + do { INFO("SoSFBitMask class not initialized"); CHECK((SoSFBitMask::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("SoSFBitMask class not initialized"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} + +TEST_CASE("SoSFBitMask_TestSuite.textinput", "[SoSFBitMask_TestSuite]") +{ + 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 + do { INFO("accepted 'OTHER1' erroneously"); CHECK((ok == FALSE)); } while (false); + TestSuite::PopMessageSuppressFilters(); + CHECK(((TestSuite::GetReadErrorCount()) == (1))); + TestSuite::ResetReadErrorCount(); + + ok = field1.set("VALUE2"); + do { INFO("did not accept 'VALUE2'"); CHECK((ok == TRUE)); } while (false); + ok = field2.set("VALUE2"); + do { INFO("did not accept 'VALUE2'"); CHECK((ok == TRUE)); } while (false); + CHECK(((field1.getValue()) == (field2.getValue()))); + do { INFO("SoSFBitmask.isSame() problem"); CHECK((field1.isSame(field2))); } while (false); + + ok = field1.set("VALUE2"); + do { INFO("did not accept 'VALUE2'"); CHECK((ok == TRUE)); } while (false); + ok = field2.set("(VALUE1|VALUE3)"); + do { INFO("did not accept '(VALUE1|VALUE3)'"); CHECK((ok == TRUE)); } while (false); + CHECK(((field2.getValue()) == (VALUE1|VALUE3))); + do { INFO("SoSFBitmask.isSame() problem"); CHECK((!field2.isSame(field1))); } while (false); + + // failing test, but unclear if it is required to work + ok = field2.set("VALUE1|VALUE3"); // this ought to work too, right? + do { INFO("did not accept 'VALUE1|VALUE2'"); CHECK((ok == TRUE)); } while (false); + //CHECK(((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"); + do { INFO("did not accept 'VALUE2'"); CHECK((ok == TRUE)); } while (false); + ok = field3.set("OTHER2"); + do { INFO("did not accept 'OTHER2'"); CHECK((ok == TRUE)); } while (false); + CHECK(((field1.getValue()) == (field3.getValue()))); + do { INFO("SoSFBitmask.isSame() false positive"); CHECK((!field1.isSame(field3))); } while (false); + + // Numeric values don't work. + //ok = field1.set("0"); + //do { INFO("did not accept '0'"); CHECK((ok == TRUE)); } while (false); + //do { INFO("did not set value to 0"); CHECK((field1.getValue() == 0)); } while (false); + //ok = field1.set("1"); + //do { INFO("did not accept '1'"); CHECK((ok == TRUE)); } while (false); + //do { INFO("did not set value to 1"); CHECK((field1.getValue() == 1)); } while (false); +} diff --git a/testsuite/fields/SoSFBoolTest.cpp b/testsuite/fields/SoSFBoolTest.cpp new file mode 100644 index 00000000000..898644a4475 --- /dev/null +++ b/testsuite/fields/SoSFBoolTest.cpp @@ -0,0 +1,98 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFBool_TestSuite.SoSFBool_initialized", "[SoSFBool_TestSuite]") +{ + SoSFBool field; + do { INFO("SoSFBool class not initialized"); CHECK((SoSFBool::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} + +TEST_CASE("SoSFBool_TestSuite.textinput", "[SoSFBool_TestSuite]") +{ + SbBool ok; + SoSFBool field; + ok = field.set("TRUE"); + do { INFO("did not accept 'TRUE'"); CHECK((ok == TRUE)); } while (false); + CHECK(((field.getValue()) == (TRUE))); + ok = field.set("FALSE"); + do { INFO("did not accept 'FALSE'"); CHECK((ok == TRUE)); } while (false); + CHECK(((field.getValue()) == (FALSE))); + + TestSuite::ResetReadErrorCount(); + static const char * filters[] = { "Invalid value", NULL }; + TestSuite::PushMessageSuppressFilters(filters); + ok = field.set("MAYBE"); // emits two error messages + do { INFO("did accept 'MAYBE'"); CHECK((ok == FALSE)); } while (false); + do { INFO("did not emit error"); CHECK((TestSuite::GetReadErrorCount() == 1)); } while (false); + TestSuite::PopMessageSuppressFilters(); + TestSuite::ResetReadErrorCount(); + + ok = field.set("0"); + do { INFO("did not accept '0'"); CHECK((ok == TRUE)); } while (false); + CHECK(((field.getValue()) == (FALSE))); + ok = field.set("1"); + do { INFO("did not accept '1'"); CHECK((ok == TRUE)); } while (false); + CHECK(((field.getValue()) == (TRUE))); + + static const char * filters2[] = { "Illegal value", NULL }; + TestSuite::PushMessageSuppressFilters(filters2); + ok = field.set("2"); + do { INFO("did accept '2'"); CHECK((ok == FALSE)); } while (false); + TestSuite::PopMessageSuppressFilters(); + TestSuite::ResetReadErrorCount(); +} diff --git a/testsuite/fields/SoSFBox2dTest.cpp b/testsuite/fields/SoSFBox2dTest.cpp new file mode 100644 index 00000000000..20d3b8c3847 --- /dev/null +++ b/testsuite/fields/SoSFBox2dTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFBox2d_TestSuite.SoSFBox2d_initialized", "[SoSFBox2d_TestSuite]") +{ + SoSFBox2d field; + do { INFO("SoSFBox2d class not initialized"); CHECK((SoSFBox2d::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFBox2fTest.cpp b/testsuite/fields/SoSFBox2fTest.cpp new file mode 100644 index 00000000000..1f1782d0c56 --- /dev/null +++ b/testsuite/fields/SoSFBox2fTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFBox2f_TestSuite.SoSFBox2f_initialized", "[SoSFBox2f_TestSuite]") +{ + SoSFBox2f field; + do { INFO("SoSFBox2f class not initialized"); CHECK((SoSFBox2f::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFBox2i32Test.cpp b/testsuite/fields/SoSFBox2i32Test.cpp new file mode 100644 index 00000000000..f7c612a963a --- /dev/null +++ b/testsuite/fields/SoSFBox2i32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFBox2i32_TestSuite.SoSFBox2i32_initialized", "[SoSFBox2i32_TestSuite]") +{ + SoSFBox2i32 field; + do { INFO("SoSFBox2i32 class not initialized"); CHECK((SoSFBox2i32::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFBox2sTest.cpp b/testsuite/fields/SoSFBox2sTest.cpp new file mode 100644 index 00000000000..c40f9b96cc9 --- /dev/null +++ b/testsuite/fields/SoSFBox2sTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFBox2s_TestSuite.SoSFBox2s_initialized", "[SoSFBox2s_TestSuite]") +{ + SoSFBox2s field; + do { INFO("SoSFBox2s class not initialized"); CHECK((SoSFBox2s::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFBox3dTest.cpp b/testsuite/fields/SoSFBox3dTest.cpp new file mode 100644 index 00000000000..4290ea6d5d5 --- /dev/null +++ b/testsuite/fields/SoSFBox3dTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFBox3d_TestSuite.SoSFBox3d_initialized", "[SoSFBox3d_TestSuite]") +{ + SoSFBox3d field; + do { INFO("SoSFBox3d class not initialized"); CHECK((SoSFBox3d::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFBox3fTest.cpp b/testsuite/fields/SoSFBox3fTest.cpp new file mode 100644 index 00000000000..b78948ddc03 --- /dev/null +++ b/testsuite/fields/SoSFBox3fTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFBox3f_TestSuite.SoSFBox3f_initialized", "[SoSFBox3f_TestSuite]") +{ + SoSFBox3f field; + do { INFO("SoSFBox3f class not initialized"); CHECK((SoSFBox3f::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFBox3i32Test.cpp b/testsuite/fields/SoSFBox3i32Test.cpp new file mode 100644 index 00000000000..2084d8f1eaa --- /dev/null +++ b/testsuite/fields/SoSFBox3i32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFBox3i32_TestSuite.SoSFBox3i32_initialized", "[SoSFBox3i32_TestSuite]") +{ + SoSFBox3i32 field; + do { INFO("SoSFBox3i32 class not initialized"); CHECK((SoSFBox3i32::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFBox3sTest.cpp b/testsuite/fields/SoSFBox3sTest.cpp new file mode 100644 index 00000000000..e320f19603e --- /dev/null +++ b/testsuite/fields/SoSFBox3sTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFBox3s_TestSuite.SoSFBox3s_initialized", "[SoSFBox3s_TestSuite]") +{ + SoSFBox3s field; + do { INFO("SoSFBox3s class not initialized"); CHECK((SoSFBox3s::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFColorRGBATest.cpp b/testsuite/fields/SoSFColorRGBATest.cpp new file mode 100644 index 00000000000..57d3f4f4423 --- /dev/null +++ b/testsuite/fields/SoSFColorRGBATest.cpp @@ -0,0 +1,76 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFColorRGBA_TestSuite.SoSFColorRGBA_initialized", "[SoSFColorRGBA_TestSuite]") +{ + SoSFColorRGBA field; + do { INFO("SoSFColorRGBA class not initialized"); CHECK((SoSFColorRGBA::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} + +TEST_CASE("SoSFColorRGBA_TestSuite.textinput", "[SoSFColorRGBA_TestSuite]") +{ + SbBool ok; + SoSFColorRGBA field; + ok = field.set("0.0 .5 0 1"); + do { INFO("could not set value"); CHECK((ok == TRUE)); } while (false); + CHECK(((field.getValue()) == (SbColorRGBA(0, .5, 0, 1)))); + ok = field.set("0 0.5 1"); + do { INFO("accepted invalid (missing component) value"); CHECK((ok == FALSE)); } while (false); + ok = field.set("1 2 3 4"); + //do { INFO("accepted out-of-range value"); CHECK((ok == FALSE)); } while (false); +} diff --git a/testsuite/fields/SoSFColorTest.cpp b/testsuite/fields/SoSFColorTest.cpp new file mode 100644 index 00000000000..4b01a737eee --- /dev/null +++ b/testsuite/fields/SoSFColorTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFColor_TestSuite.SoSFColor_initialized", "[SoSFColor_TestSuite]") +{ + SoSFColor field; + do { INFO("SoSFColor class not initialized"); CHECK((SoSFColor::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFDoubleTest.cpp b/testsuite/fields/SoSFDoubleTest.cpp new file mode 100644 index 00000000000..ac34f499598 --- /dev/null +++ b/testsuite/fields/SoSFDoubleTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFDouble_TestSuite.SoSFDouble_initialized", "[SoSFDouble_TestSuite]") +{ + SoSFDouble field; + do { INFO("SoSFDouble class not initialized"); CHECK((SoSFDouble::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFEngineTest.cpp b/testsuite/fields/SoSFEngineTest.cpp new file mode 100644 index 00000000000..127e80237cf --- /dev/null +++ b/testsuite/fields/SoSFEngineTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFEngine_TestSuite.SoSFEngine_initialized", "[SoSFEngine_TestSuite]") +{ + SoSFEngine field; + do { INFO("SoSFEngine class not initialized"); CHECK((SoSFEngine::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFEnumTest.cpp b/testsuite/fields/SoSFEnumTest.cpp new file mode 100644 index 00000000000..f51650942f5 --- /dev/null +++ b/testsuite/fields/SoSFEnumTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFEnum_TestSuite.SoSFEnum_initialized", "[SoSFEnum_TestSuite]") +{ + SoSFEnum field; + do { INFO("SoSFEnum class not initialized"); CHECK((SoSFEnum::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFFloatTest.cpp b/testsuite/fields/SoSFFloatTest.cpp new file mode 100644 index 00000000000..d8d0fb8f3e4 --- /dev/null +++ b/testsuite/fields/SoSFFloatTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFFloat_TestSuite.SoSFFloat_initialized", "[SoSFFloat_TestSuite]") +{ + SoSFFloat field; + do { INFO("SoSFFloat class not initialized"); CHECK((SoSFFloat::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFImage3Test.cpp b/testsuite/fields/SoSFImage3Test.cpp new file mode 100644 index 00000000000..e8b8a4eb015 --- /dev/null +++ b/testsuite/fields/SoSFImage3Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFImage3_TestSuite.SoSFImage3_initialized", "[SoSFImage3_TestSuite]") +{ + SoSFImage3 field; + do { INFO("SoSFImage3 class not initialized"); CHECK((SoSFImage3::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFImageTest.cpp b/testsuite/fields/SoSFImageTest.cpp new file mode 100644 index 00000000000..dfdbf256afe --- /dev/null +++ b/testsuite/fields/SoSFImageTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFImage_TestSuite.SoSFImage_initialized", "[SoSFImage_TestSuite]") +{ + SoSFImage field; + do { INFO("SoSFImage class not initialized"); CHECK((SoSFImage::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFInt32Test.cpp b/testsuite/fields/SoSFInt32Test.cpp new file mode 100644 index 00000000000..38c5f51636c --- /dev/null +++ b/testsuite/fields/SoSFInt32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFInt32_TestSuite.SoSFInt32_initialized", "[SoSFInt32_TestSuite]") +{ + SoSFInt32 field; + do { INFO("SoSFInt32 class not initialized"); CHECK((SoSFInt32::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFMatrixTest.cpp b/testsuite/fields/SoSFMatrixTest.cpp new file mode 100644 index 00000000000..31b2165301c --- /dev/null +++ b/testsuite/fields/SoSFMatrixTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFMatrix_TestSuite.SoSFMatrix_initialized", "[SoSFMatrix_TestSuite]") +{ + SoSFMatrix field; + do { INFO("SoSFMatrix class not initialized"); CHECK((SoSFMatrix::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFNameTest.cpp b/testsuite/fields/SoSFNameTest.cpp new file mode 100644 index 00000000000..1d099a45403 --- /dev/null +++ b/testsuite/fields/SoSFNameTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFName_TestSuite.SoSFName_initialized", "[SoSFName_TestSuite]") +{ + SoSFName field; + do { INFO("SoSFName class not initialized"); CHECK((SoSFName::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFNodeTest.cpp b/testsuite/fields/SoSFNodeTest.cpp new file mode 100644 index 00000000000..3fc2128fda7 --- /dev/null +++ b/testsuite/fields/SoSFNodeTest.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 +#include + +TEST_CASE("SoSFNode_TestSuite.SoSFNode_initialized", "[SoSFNode_TestSuite]") +{ + SoSFNode field; + do { INFO("SoSFNode class not initialized"); CHECK((SoSFNode::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} + +#ifdef HAVE_VRML97 +TEST_CASE("SoSFNode_TestSuite.vrml97nullchild", "[SoSFNode_TestSuite]") +{ + // 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; + + do { INFO("failed to read VRML97 with NULL child in graph"); CHECK((readok)); } while (false); + if (g) { + g->ref(); + g->unref(); + } +} +#endif diff --git a/testsuite/fields/SoSFPathTest.cpp b/testsuite/fields/SoSFPathTest.cpp new file mode 100644 index 00000000000..56d432790bd --- /dev/null +++ b/testsuite/fields/SoSFPathTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFPath_TestSuite.SoSFPath_initialized", "[SoSFPath_TestSuite]") +{ + SoSFPath field; + do { INFO("SoSFPath class not initialized"); CHECK((SoSFPath::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFPlaneTest.cpp b/testsuite/fields/SoSFPlaneTest.cpp new file mode 100644 index 00000000000..1c18271c9c0 --- /dev/null +++ b/testsuite/fields/SoSFPlaneTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFPlane_TestSuite.SoSFPlane_initialized", "[SoSFPlane_TestSuite]") +{ + SoSFPlane field; + do { INFO("SoSFPlane class not initialized"); CHECK((SoSFPlane::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFRotationTest.cpp b/testsuite/fields/SoSFRotationTest.cpp new file mode 100644 index 00000000000..4bced39f9dd --- /dev/null +++ b/testsuite/fields/SoSFRotationTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFRotation_TestSuite.SoSFRotation_initialized", "[SoSFRotation_TestSuite]") +{ + SoSFRotation field; + do { INFO("SoSFRotation class not initialized"); CHECK((SoSFRotation::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFShortTest.cpp b/testsuite/fields/SoSFShortTest.cpp new file mode 100644 index 00000000000..cc839d3af5b --- /dev/null +++ b/testsuite/fields/SoSFShortTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFShort_TestSuite.SoSFShort_initialized", "[SoSFShort_TestSuite]") +{ + SoSFShort field; + do { INFO("SoSFShort class not initialized"); CHECK((SoSFShort::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFStringTest.cpp b/testsuite/fields/SoSFStringTest.cpp new file mode 100644 index 00000000000..69e1c8acd00 --- /dev/null +++ b/testsuite/fields/SoSFStringTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFString_TestSuite.SoSFString_initialized", "[SoSFString_TestSuite]") +{ + SoSFString field; + do { INFO("SoSFString class not initialized"); CHECK((SoSFString::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFTimeTest.cpp b/testsuite/fields/SoSFTimeTest.cpp new file mode 100644 index 00000000000..f996e483d4b --- /dev/null +++ b/testsuite/fields/SoSFTimeTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFTime_TestSuite.SoSFTime_initialized", "[SoSFTime_TestSuite]") +{ + SoSFTime field; + do { INFO("SoSFTime class not initialized"); CHECK((SoSFTime::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFTriggerTest.cpp b/testsuite/fields/SoSFTriggerTest.cpp new file mode 100644 index 00000000000..efb969d4cbc --- /dev/null +++ b/testsuite/fields/SoSFTriggerTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFTrigger_TestSuite.SoSFTrigger_initialized", "[SoSFTrigger_TestSuite]") +{ + SoSFTrigger field; + do { INFO("SoSFTrigger class not initialized"); CHECK((SoSFTrigger::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFUInt32Test.cpp b/testsuite/fields/SoSFUInt32Test.cpp new file mode 100644 index 00000000000..14f6235bf53 --- /dev/null +++ b/testsuite/fields/SoSFUInt32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFUInt32_TestSuite.SoSFUInt32_initialized", "[SoSFUInt32_TestSuite]") +{ + SoSFUInt32 field; + do { INFO("SoSFUInt32 class not initialized"); CHECK((SoSFUInt32::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFUShortTest.cpp b/testsuite/fields/SoSFUShortTest.cpp new file mode 100644 index 00000000000..1e15309dd6b --- /dev/null +++ b/testsuite/fields/SoSFUShortTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFUShort_TestSuite.SoSFUShort_initialized", "[SoSFUShort_TestSuite]") +{ + SoSFUShort field; + do { INFO("SoSFUShort class not initialized"); CHECK((SoSFUShort::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec2bTest.cpp b/testsuite/fields/SoSFVec2bTest.cpp new file mode 100644 index 00000000000..df81cb7850f --- /dev/null +++ b/testsuite/fields/SoSFVec2bTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec2b_TestSuite.SoSFVec2b_initialized", "[SoSFVec2b_TestSuite]") +{ + SoSFVec2b field; + do { INFO("SoSFVec2b class not initialized"); CHECK((SoSFVec2b::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec2dTest.cpp b/testsuite/fields/SoSFVec2dTest.cpp new file mode 100644 index 00000000000..ea67965e5a7 --- /dev/null +++ b/testsuite/fields/SoSFVec2dTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec2d_TestSuite.SoSFVec2d_initialized", "[SoSFVec2d_TestSuite]") +{ + SoSFVec2d field; + do { INFO("SoSFVec2d class not initialized"); CHECK((SoSFVec2d::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec2fTest.cpp b/testsuite/fields/SoSFVec2fTest.cpp new file mode 100644 index 00000000000..a5faf502ddb --- /dev/null +++ b/testsuite/fields/SoSFVec2fTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec2f_TestSuite.SoSFVec2f_initialized", "[SoSFVec2f_TestSuite]") +{ + SoSFVec2f field; + do { INFO("SoSFVec2f class not initialized"); CHECK((SoSFVec2f::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec2i32Test.cpp b/testsuite/fields/SoSFVec2i32Test.cpp new file mode 100644 index 00000000000..119b93220b1 --- /dev/null +++ b/testsuite/fields/SoSFVec2i32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec2i32_TestSuite.SoSFVec2i32_initialized", "[SoSFVec2i32_TestSuite]") +{ + SoSFVec2i32 field; + do { INFO("SoSFVec2i32 class not initialized"); CHECK((SoSFVec2i32::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec2sTest.cpp b/testsuite/fields/SoSFVec2sTest.cpp new file mode 100644 index 00000000000..22300c9d829 --- /dev/null +++ b/testsuite/fields/SoSFVec2sTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec2s_TestSuite.SoSFVec2s_initialized", "[SoSFVec2s_TestSuite]") +{ + SoSFVec2s field; + do { INFO("SoSFVec2s class not initialized"); CHECK((SoSFVec2s::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec3bTest.cpp b/testsuite/fields/SoSFVec3bTest.cpp new file mode 100644 index 00000000000..e25eb95a212 --- /dev/null +++ b/testsuite/fields/SoSFVec3bTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec3b_TestSuite.SoSFVec3b_initialized", "[SoSFVec3b_TestSuite]") +{ + SoSFVec3b field; + do { INFO("SoSFVec3b class not initialized"); CHECK((SoSFVec3b::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec3dTest.cpp b/testsuite/fields/SoSFVec3dTest.cpp new file mode 100644 index 00000000000..b61601ff4b3 --- /dev/null +++ b/testsuite/fields/SoSFVec3dTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec3d_TestSuite.SoSFVec3d_initialized", "[SoSFVec3d_TestSuite]") +{ + SoSFVec3d field; + do { INFO("SoSFVec3d class not initialized"); CHECK((SoSFVec3d::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec3fTest.cpp b/testsuite/fields/SoSFVec3fTest.cpp new file mode 100644 index 00000000000..17858b1fc7f --- /dev/null +++ b/testsuite/fields/SoSFVec3fTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec3f_TestSuite.SoSFVec3f_initialized", "[SoSFVec3f_TestSuite]") +{ + SoSFVec3f field; + do { INFO("SoSFVec3f class not initialized"); CHECK((SoSFVec3f::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec3i32Test.cpp b/testsuite/fields/SoSFVec3i32Test.cpp new file mode 100644 index 00000000000..189c387e28d --- /dev/null +++ b/testsuite/fields/SoSFVec3i32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec3i32_TestSuite.SoSFVec3i32_initialized", "[SoSFVec3i32_TestSuite]") +{ + SoSFVec3i32 field; + do { INFO("SoSFVec3i32 class not initialized"); CHECK((SoSFVec3i32::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec3sTest.cpp b/testsuite/fields/SoSFVec3sTest.cpp new file mode 100644 index 00000000000..dff4347cbb5 --- /dev/null +++ b/testsuite/fields/SoSFVec3sTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec3s_TestSuite.SoSFVec3s_initialized", "[SoSFVec3s_TestSuite]") +{ + SoSFVec3s field; + do { INFO("SoSFVec3s class not initialized"); CHECK((SoSFVec3s::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec4bTest.cpp b/testsuite/fields/SoSFVec4bTest.cpp new file mode 100644 index 00000000000..146f5d17c11 --- /dev/null +++ b/testsuite/fields/SoSFVec4bTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec4b_TestSuite.SoSFVec4b_initialized", "[SoSFVec4b_TestSuite]") +{ + SoSFVec4b field; + do { INFO("SoSFVec4b class not initialized"); CHECK((SoSFVec4b::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec4dTest.cpp b/testsuite/fields/SoSFVec4dTest.cpp new file mode 100644 index 00000000000..494747a5229 --- /dev/null +++ b/testsuite/fields/SoSFVec4dTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec4d_TestSuite.SoSFVec4d_initialized", "[SoSFVec4d_TestSuite]") +{ + SoSFVec4d field; + do { INFO("SoSFVec4d class not initialized"); CHECK((SoSFVec4d::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec4fTest.cpp b/testsuite/fields/SoSFVec4fTest.cpp new file mode 100644 index 00000000000..1c120a4fa83 --- /dev/null +++ b/testsuite/fields/SoSFVec4fTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec4f_TestSuite.SoSFVec4f_initialized", "[SoSFVec4f_TestSuite]") +{ + SoSFVec4f field; + do { INFO("SoSFVec4f class not initialized"); CHECK((SoSFVec4f::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec4i32Test.cpp b/testsuite/fields/SoSFVec4i32Test.cpp new file mode 100644 index 00000000000..f486c8efd0c --- /dev/null +++ b/testsuite/fields/SoSFVec4i32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec4i32_TestSuite.SoSFVec4i32_initialized", "[SoSFVec4i32_TestSuite]") +{ + SoSFVec4i32 field; + do { INFO("SoSFVec4i32 class not initialized"); CHECK((SoSFVec4i32::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec4sTest.cpp b/testsuite/fields/SoSFVec4sTest.cpp new file mode 100644 index 00000000000..811f52deb01 --- /dev/null +++ b/testsuite/fields/SoSFVec4sTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec4s_TestSuite.SoSFVec4s_initialized", "[SoSFVec4s_TestSuite]") +{ + SoSFVec4s field; + do { INFO("SoSFVec4s class not initialized"); CHECK((SoSFVec4s::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec4ubTest.cpp b/testsuite/fields/SoSFVec4ubTest.cpp new file mode 100644 index 00000000000..298d6059135 --- /dev/null +++ b/testsuite/fields/SoSFVec4ubTest.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 + +TEST_CASE("SoSFVec4ub_TestSuite.SoSFVec4ub_initialized", "[SoSFVec4ub_TestSuite]") +{ + do { INFO("SoSFVec4ub class not initialized"); CHECK((SoSFVec4ub::getClassTypeId() != SoType::badType())); } while (false); + SoSFVec4ub field; + do { INFO("SoSFVec4ub object wrongly initialized"); CHECK((field.getTypeId() != SoType::badType())); } while (false); + // no default value initialization to test + field.setValue(1, 2, 3, 4); + CHECK(((field.getValue()) == (SbVec4ub(1, 2, 3, 4)))); +} + +TEST_CASE("SoSFVec4ub_TestSuite.textinput", "[SoSFVec4ub_TestSuite]") +{ + TestSuite::ResetReadErrorCount(); + SbBool ok; + SoSFVec4ub field; + ok = field.set("1 2 3 4"); + do { INFO("SoSFVec4ub read error"); CHECK((ok == TRUE)); } while (false); + CHECK(((field.getValue()) == (SbVec4ub(1, 2, 3, 4)))); + CHECK(((TestSuite::GetReadErrorCount()) == (0))); + TestSuite::ResetReadErrorCount(); +} diff --git a/testsuite/fields/SoSFVec4ui32Test.cpp b/testsuite/fields/SoSFVec4ui32Test.cpp new file mode 100644 index 00000000000..1f31d0d8b94 --- /dev/null +++ b/testsuite/fields/SoSFVec4ui32Test.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec4ui32_TestSuite.SoSFVec4ui32_initialized", "[SoSFVec4ui32_TestSuite]") +{ + SoSFVec4ui32 field; + do { INFO("SoSFVec4ui32 class not initialized"); CHECK((SoSFVec4ui32::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/fields/SoSFVec4usTest.cpp b/testsuite/fields/SoSFVec4usTest.cpp new file mode 100644 index 00000000000..1422da83737 --- /dev/null +++ b/testsuite/fields/SoSFVec4usTest.cpp @@ -0,0 +1,85 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoSFVec4us_TestSuite.SoSFVec4us_initialized", "[SoSFVec4us_TestSuite]") +{ + SoSFVec4us field; + do { INFO("SoSFVec4us class not initialized"); CHECK((SoSFVec4us::getClassTypeId() != SoType::badType())); } while (false); + do { INFO("missing class initialization"); CHECK((field.getTypeId() != SoType::badType())); } while (false); +} + +TEST_CASE("SoSFVec4us_TestSuite.textinput", "[SoSFVec4us_TestSuite]") +{ + SoSFVec4us field; + field.set("1 2 3 4"); + CHECK(((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' + CHECK(((ok) == (FALSE))); + //CHECK(((TestSuite::GetReadErrorCount()) == (1))); + ok = field.set("3 525 32 3"); // should emit error message on '525' + //CHECK(((ok) == (FALSE))); + //CHECK(((TestSuite::GetReadErrorCount()) == (2))); + ok = field.set("3 32 3"); // error on account of too few numbers + CHECK(((ok) == (FALSE))); + //CHECK(((TestSuite::GetReadErrorCount()) == (3))); + // TestSuite::PopMessageSuppressFilters(); + TestSuite::ResetReadErrorCount(); +} diff --git a/testsuite/geo/SoGeoCoordinateTest.cpp b/testsuite/geo/SoGeoCoordinateTest.cpp new file mode 100644 index 00000000000..078f9881ba9 --- /dev/null +++ b/testsuite/geo/SoGeoCoordinateTest.cpp @@ -0,0 +1,64 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoGeoCoordinate_TestSuite.SoGeoCoordinate_initialized", "[SoGeoCoordinate_TestSuite]") +{ + do { INFO("SoGeoCoordinate class not initialized"); CHECK((SoGeoCoordinate::getClassTypeId() != SoType::badType())); } while (false); + SoRefPtr node(new SoGeoCoordinate); + do { INFO("missing class initialization"); CHECK((node->getTypeId() != SoType::badType())); } while (false); + CHECK(((node->point.getNum()) == (1))); +} diff --git a/testsuite/geo/SoGeoElementTest.cpp b/testsuite/geo/SoGeoElementTest.cpp new file mode 100644 index 00000000000..6d132a62f63 --- /dev/null +++ b/testsuite/geo/SoGeoElementTest.cpp @@ -0,0 +1,61 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoGeoElement_TestSuite.SoGeoElement_initialized", "[SoGeoElement_TestSuite]") +{ + do { INFO("missing class initialization"); CHECK((SoGeoElement::getClassStackIndex() != -1)); } while (false); +} diff --git a/testsuite/geo/SoGeoLocationTest.cpp b/testsuite/geo/SoGeoLocationTest.cpp new file mode 100644 index 00000000000..dd875922d88 --- /dev/null +++ b/testsuite/geo/SoGeoLocationTest.cpp @@ -0,0 +1,65 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoGeoLocation_TestSuite.SoGeoLocation_initialized", "[SoGeoLocation_TestSuite]") +{ + SoGeoLocation * node = new SoGeoLocation; + assert(node); + node->ref(); + do { INFO("missing class initialization"); CHECK((node->getTypeId() != SoType::badType())); } while (false); + node->unref(); +} diff --git a/testsuite/geo/SoGeoOriginTest.cpp b/testsuite/geo/SoGeoOriginTest.cpp new file mode 100644 index 00000000000..c36e4815ccf --- /dev/null +++ b/testsuite/geo/SoGeoOriginTest.cpp @@ -0,0 +1,65 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoGeoOrigin_TestSuite.SoGeoOrigin_initialized", "[SoGeoOrigin_TestSuite]") +{ + SoGeoOrigin * node = new SoGeoOrigin; + assert(node); + node->ref(); + do { INFO("missing class initialization"); CHECK((node->getTypeId() != SoType::badType())); } while (false); + node->unref(); +} diff --git a/testsuite/geo/SoGeoSeparatorTest.cpp b/testsuite/geo/SoGeoSeparatorTest.cpp new file mode 100644 index 00000000000..062fd33910d --- /dev/null +++ b/testsuite/geo/SoGeoSeparatorTest.cpp @@ -0,0 +1,63 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoGeoSeparator_TestSuite.SoGeoSeparator_initialized", "[SoGeoSeparator_TestSuite]") +{ + do { INFO("SoGeoSeparator class not initialized"); CHECK((SoGeoSeparator::getClassTypeId() != SoType::badType())); } while (false); + SoRefPtr node(new SoGeoSeparator); + do { INFO("SoGeoSeparator object wrongly initialized"); CHECK((node->getTypeId() != SoType::badType())); } while (false); +} diff --git a/testsuite/misc/SoBasePTest.cpp b/testsuite/misc/SoBasePTest.cpp new file mode 100644 index 00000000000..a1197839404 --- /dev/null +++ b/testsuite/misc/SoBasePTest.cpp @@ -0,0 +1,110 @@ +/**************************************************************************\ +* 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 + +// 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 + +TEST_CASE("SoBaseP_TestSuite.realTime_globalfield_import", "[SoBaseP_TestSuite]") +{ + // 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"); + do { INFO("internal realTime SoGlobalField value changed upon iv import"); CHECK((realtime == realtimeafter)); } while (false); + + // clean up + g->ref(); + g->unref(); + + //Restore state + realtime->setValue(realTimeStorage); + +} diff --git a/testsuite/misc/SoBaseTest.cpp b/testsuite/misc/SoBaseTest.cpp new file mode 100644 index 00000000000..579c769aced --- /dev/null +++ b/testsuite/misc/SoBaseTest.cpp @@ -0,0 +1,322 @@ +/**************************************************************************\ +* 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 + +/*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; + } + + +TEST_CASE("SoBase_TestSuite.checkWriteWithMultiref", "[SoBase_TestSuite]") +{ + 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) + do { INFO("don't mangle should be TRUE"); CHECK((dont_mangle_output_names(scenegraph)==TRUE)); } while (false); + else + do { INFO("don't mangle should be FALSE"); CHECK((dont_mangle_output_names(scenegraph)==FALSE)); } while (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 + } diff --git a/testsuite/misc/SoDBTest.cpp b/testsuite/misc/SoDBTest.cpp new file mode 100644 index 00000000000..feee3ce649b --- /dev/null +++ b/testsuite/misc/SoDBTest.cpp @@ -0,0 +1,261 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoDB_TestSuite.globalRealTimeField", "[SoDB_TestSuite]") +{ + //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"); + + REQUIRE((realtime != NULL)); + 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()); + do { INFO("realTime global field not close to actual time"); CHECK((clockdiff < 5.0)); } while (false); +} + +// Do-nothing error handler for ignoring read errors while testing. +static void +readErrorHandler(const SoError * error, void * data) +{ +} + +#ifdef HAVE_VRML97 +TEST_CASE("SoDB_TestSuite.readChildList", "[SoDB_TestSuite]") +{ + 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); + REQUIRE((root)); + root->ref(); + SoGroup * group = (SoGroup *) SoNode::getByName("TestGroup"); + do { INFO("Unexpected number of children"); REQUIRE((group->getNumChildren() == 3)); } while (false); + for (int i = 0; i < group->getNumChildren(); i++) { + do { INFO("Unexpected type"); REQUIRE((group->getChild(i)->isOfType(SoGroup::getClassTypeId()))); } while (false); + } + root->unref(); +} +#endif + +TEST_CASE("SoDB_TestSuite.readEmptyChildList", "[SoDB_TestSuite]") +{ + // 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"); + do { INFO("Should have no children"); CHECK((group->getNumChildren() == 0)); } while (false); + } + do { INFO("Expected the import to fail"); CHECK((root == NULL)); } while (false); + + SoReadError::setHandlerCallback(prevErrorCB, NULL); +} + +TEST_CASE("SoDB_TestSuite.readNullChildList", "[SoDB_TestSuite]") +{ + // 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"); + do { INFO("Should have no children"); CHECK((field->getNumNodes() == 0)); } while (false); + } + do { INFO("Expected the import to fail"); CHECK((root == NULL)); } while (false); + + SoReadError::setHandlerCallback(prevErrorCB, NULL); +} + +TEST_CASE("SoDB_TestSuite.readInvalidChildList", "[SoDB_TestSuite]") +{ + // 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); + do { INFO("Expected the import to fail"); CHECK((root == NULL)); } while (false); + + SoReadError::setHandlerCallback(prevErrorCB, NULL); +} + +TEST_CASE("SoDB_TestSuite.testAlternateRepNull", "[SoDB_TestSuite]") +{ + // 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); + do { INFO("Import should succeed"); CHECK((root)); } while (false); + root->ref(); + root->unref(); + + SoReadError::setHandlerCallback(prevErrorCB, NULL); +} + +TEST_CASE("SoDB_TestSuite.testInitCleanup", "[SoDB_TestSuite]") +{ + // 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 + +TEST_CASE("SoDB_TestSuite.globalfield_import", "[SoDB_TestSuite]") +{ + 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 + do { INFO("failed to read scene graph with realTime global field"); CHECK((readok)); } while (false); + if (!readok) { return; } + + g->ref(); + + SoSFTime * realtime = (SoSFTime *)SoDB::getGlobalField("realTime"); + + // supposed to get new value from file + do { INFO("realTime global field value not updated from imported value"); CHECK((realtime->getValue().getValue() == 0.0)); } while (false); + + SoRotationXYZ * r = (SoRotationXYZ *) + SoBase::getNamedBase("rotnode", SoRotationXYZ::getClassTypeId()); + assert(r); + + // check connection + SoField * master; + do { INFO("connection to realTime global field not set up properly"); CHECK(((r->angle.getNumConnections() == 1) && + r->angle.getConnectedField(master) && + (master == realtime))); } while (false); + + g->unref(); +} + +// ************************************************************************* diff --git a/testsuite/misc/SoTypeTest.cpp b/testsuite/misc/SoTypeTest.cpp new file mode 100644 index 00000000000..62042d05250 --- /dev/null +++ b/testsuite/misc/SoTypeTest.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 +#include +#include +#include + +static void * createInstance(void) +{ + return (void *)0x1234; +} + +TEST_CASE("SoType_TestSuite.testRemoveType", "[SoType_TestSuite]") +{ + do { INFO("Type didn't init to badType"); CHECK((SoType::fromName(SbName("MyClass")) == SoType::badType())); } while (false); + SoType newtype = SoType::createType(SoNode::getClassTypeId(), SbName("MyClass"), createInstance, 0); + do { INFO("Type didn't init correctly"); CHECK((SoType::fromName(SbName("MyClass")) != SoType::badType())); } while (false); + bool success = SoType::removeType(SbName("MyClass")); + do { INFO("removeType() failed"); CHECK((success)); } while (false); + do { INFO("Type didn't deregister correctly"); CHECK((SoType::fromName(SbName("MyClass")) == SoType::badType())); } while (false); +} diff --git a/testsuite/nodes/SoAnnotationTest.cpp b/testsuite/nodes/SoAnnotationTest.cpp new file mode 100644 index 00000000000..969b6d5a5e6 --- /dev/null +++ b/testsuite/nodes/SoAnnotationTest.cpp @@ -0,0 +1,65 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoAnnotation_TestSuite.SoAnnotation_initialized", "[SoAnnotation_TestSuite]") +{ + SoAnnotation * node = new SoAnnotation; + assert(node); + node->ref(); + do { INFO("missing class initialization"); CHECK((node->getTypeId() != SoType::badType())); } while (false); + node->unref(); +} diff --git a/testsuite/scxml/SbStringConvertTest.cpp b/testsuite/scxml/SbStringConvertTest.cpp new file mode 100644 index 00000000000..3114f69d861 --- /dev/null +++ b/testsuite/scxml/SbStringConvertTest.cpp @@ -0,0 +1,154 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SbStringConvert_TestSuite.SbVec3sfromString", "[SbStringConvert_TestSuite]") { + typedef SbVec3s ToTest; + ToTest foo; + SbString test = "SbVec3s(1,-2,3)"; + ToTest trueVal(1,-2,3); + foo = SbStringConvert::fromString(test); + do { INFO(std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); CHECK((trueVal == foo)); } while (false); +} + +TEST_CASE("SbStringConvert_TestSuite.SbVec3sToString", "[SbStringConvert_TestSuite]") { + typedef SbVec3s ToTest; + SbString foo; + ToTest test(1,-2,3); + SbString trueVal = "SbVec3s(1, -2, 3)"; + foo = SbStringConvert::toString(test); + do { INFO(std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); CHECK((trueVal == foo)); } while (false); +} + +TEST_CASE("SbStringConvert_TestSuite.SbVec3sfromSbVec3f", "[SbStringConvert_TestSuite]") { + typedef SbVec3s ToTest; + ToTest foo; + SbString test = "SbVec3f(1,-2,3)"; + ToTest trueVal(1,-2,3); + SbBool conversionOk = TRUE; + foo = SbStringConvert::fromString(test, &conversionOk); + do { INFO(std::string("Able to create SbVec3s from ") + test.getString()); CHECK((conversionOk == FALSE)); } while (false); +} + +TEST_CASE("SbStringConvert_TestSuite.SbVec3fToString", "[SbStringConvert_TestSuite]") { + 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); + do { INFO(std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); CHECK((trueVal == foo)); } while (false); +} + +TEST_CASE("SbStringConvert_TestSuite.SbVec3fToIntString", "[SbStringConvert_TestSuite]") { + typedef SbVec3f ToTest; + SbString foo; + ToTest test(1,-2,3); + SbString trueVal = "SbVec3f(1, -2, 3)"; + foo = SbStringConvert::toString(test); + do { INFO(std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); CHECK((trueVal == foo)); } while (false); +} + +TEST_CASE("SbStringConvert_TestSuite.SbVec3fFromIntString", "[SbStringConvert_TestSuite]") { + typedef SbVec3f ToTest; + ToTest foo; + SbString test = "SbVec3f(1,-2,3)"; + ToTest trueVal(1,-2,3); + SbBool conversionOk = TRUE; + foo = SbStringConvert::fromString(test, &conversionOk); + do { INFO(std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); CHECK((conversionOk && trueVal == foo)); } while (false); +} + +TEST_CASE("SbStringConvert_TestSuite.SbVec3fFromFloatString", "[SbStringConvert_TestSuite]") { + 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); + do { INFO(std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); CHECK((conversionOk && trueVal == foo)); } while (false); +} + +TEST_CASE("SbStringConvert_TestSuite.SbRotationFromString", "[SbStringConvert_TestSuite]") { + 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); + do { INFO(std::string("Mismatch between ") + foo.toString().getString() + " and control " + trueVal.toString().getString()); CHECK((conversionOk && trueVal == foo)); } while (false); +} + +TEST_CASE("SbStringConvert_TestSuite.SbRotationToString", "[SbStringConvert_TestSuite]") { + 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); + do { INFO(std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); CHECK((trueVal == foo)); } while (false); +} + +TEST_CASE("SbStringConvert_TestSuite.SbRotationToIntString", "[SbStringConvert_TestSuite]") { + typedef SbRotation ToTest; + SbString foo; + ToTest test(0,0,0,1); + SbString trueVal = "SbRotation(0, 0, 0, 1)"; + foo = SbStringConvert::toString(test); + do { INFO(std::string("Mismatch between ") + foo.getString() + " and control " + trueVal.getString()); CHECK((trueVal == foo)); } while (false); +} diff --git a/testsuite/scxml/ScXMLMinimumEvaluatorTest.cpp b/testsuite/scxml/ScXMLMinimumEvaluatorTest.cpp new file mode 100644 index 00000000000..646611250d6 --- /dev/null +++ b/testsuite/scxml/ScXMLMinimumEvaluatorTest.cpp @@ -0,0 +1,92 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("ScXMLMinimumEvaluator_TestSuite.MimimumExpressions", "[ScXMLMinimumEvaluator_TestSuite]") +{ + 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')"); + */ + +} diff --git a/testsuite/shaders/SoFragmentShaderTest.cpp b/testsuite/shaders/SoFragmentShaderTest.cpp new file mode 100644 index 00000000000..38863e39484 --- /dev/null +++ b/testsuite/shaders/SoFragmentShaderTest.cpp @@ -0,0 +1,65 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoFragmentShader_TestSuite.SoFragmentShader_initialized", "[SoFragmentShader_TestSuite]") +{ + SoFragmentShader * node = new SoFragmentShader; + assert(node); + node->ref(); + do { INFO("missing class initialization"); CHECK((node->getTypeId() != SoType::badType())); } while (false); + node->unref(); +} diff --git a/testsuite/shaders/SoGeometryShaderTest.cpp b/testsuite/shaders/SoGeometryShaderTest.cpp new file mode 100644 index 00000000000..5393fa6b3a6 --- /dev/null +++ b/testsuite/shaders/SoGeometryShaderTest.cpp @@ -0,0 +1,65 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoGeometryShader_TestSuite.SoGeometryShader_initialized", "[SoGeometryShader_TestSuite]") +{ + SoGeometryShader * node = new SoGeometryShader; + assert(node); + node->ref(); + do { INFO("missing class initialization"); CHECK((node->getTypeId() != SoType::badType())); } while (false); + node->unref(); +} diff --git a/testsuite/shaders/SoShaderParameterTest.cpp b/testsuite/shaders/SoShaderParameterTest.cpp new file mode 100644 index 00000000000..c6e0b5cf1c0 --- /dev/null +++ b/testsuite/shaders/SoShaderParameterTest.cpp @@ -0,0 +1,197 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoShaderParameter_TestSuite.SoShaderParameter_initialized", "[SoShaderParameter_TestSuite]") +{ + { + SoShaderParameter1f * parameter1f = new SoShaderParameter1f; + assert(parameter1f); + parameter1f->ref(); + do { INFO("missing class initialization"); CHECK((parameter1f->getTypeId() != SoType::badType())); } while (false); + parameter1f->unref(); + } + { + SoShaderParameter1i * parameter1i = new SoShaderParameter1i; + assert(parameter1i); + parameter1i->ref(); + do { INFO("missing class initialization"); CHECK((parameter1i->getTypeId() != SoType::badType())); } while (false); + parameter1i->unref(); + } + { + SoShaderParameter2f * parameter2f = new SoShaderParameter2f; + assert(parameter2f); + parameter2f->ref(); + do { INFO("missing class initialization"); CHECK((parameter2f->getTypeId() != SoType::badType())); } while (false); + parameter2f->unref(); + } + { + SoShaderParameter2i * parameter2i = new SoShaderParameter2i; + assert(parameter2i); + parameter2i->ref(); + do { INFO("missing class initialization"); CHECK((parameter2i->getTypeId() != SoType::badType())); } while (false); + parameter2i->unref(); + } + { + SoShaderParameter3f * parameter3f = new SoShaderParameter3f; + assert(parameter3f); + parameter3f->ref(); + do { INFO("missing class initialization"); CHECK((parameter3f->getTypeId() != SoType::badType())); } while (false); + parameter3f->unref(); + } + { + SoShaderParameter3i * parameter3i = new SoShaderParameter3i; + assert(parameter3i); + parameter3i->ref(); + do { INFO("missing class initialization"); CHECK((parameter3i->getTypeId() != SoType::badType())); } while (false); + parameter3i->unref(); + } + { + SoShaderParameter4f * parameter4f = new SoShaderParameter4f; + assert(parameter4f); + parameter4f->ref(); + do { INFO("missing class initialization"); CHECK((parameter4f->getTypeId() != SoType::badType())); } while (false); + parameter4f->unref(); + } + { + SoShaderParameter4i * parameter4i = new SoShaderParameter4i; + assert(parameter4i); + parameter4i->ref(); + do { INFO("missing class initialization"); CHECK((parameter4i->getTypeId() != SoType::badType())); } while (false); + parameter4i->unref(); + } + + { + SoShaderParameterArray1f * parametera1f = new SoShaderParameterArray1f; + assert(parametera1f); + parametera1f->ref(); + do { INFO("missing class initialization"); CHECK((parametera1f->getTypeId() != SoType::badType())); } while (false); + parametera1f->unref(); + } + { + SoShaderParameterArray1i * parametera1i = new SoShaderParameterArray1i; + assert(parametera1i); + parametera1i->ref(); + do { INFO("missing class initialization"); CHECK((parametera1i->getTypeId() != SoType::badType())); } while (false); + parametera1i->unref(); + } + { + SoShaderParameterArray2f * parametera2f = new SoShaderParameterArray2f; + assert(parametera2f); + parametera2f->ref(); + do { INFO("missing class initialization"); CHECK((parametera2f->getTypeId() != SoType::badType())); } while (false); + parametera2f->unref(); + } + { + SoShaderParameterArray2i * parametera2i = new SoShaderParameterArray2i; + assert(parametera2i); + parametera2i->ref(); + do { INFO("missing class initialization"); CHECK((parametera2i->getTypeId() != SoType::badType())); } while (false); + parametera2i->unref(); + } + { + SoShaderParameterArray3f * parametera3f = new SoShaderParameterArray3f; + assert(parametera3f); + parametera3f->ref(); + do { INFO("missing class initialization"); CHECK((parametera3f->getTypeId() != SoType::badType())); } while (false); + parametera3f->unref(); + } + { + SoShaderParameterArray3i * parametera3i = new SoShaderParameterArray3i; + assert(parametera3i); + parametera3i->ref(); + do { INFO("missing class initialization"); CHECK((parametera3i->getTypeId() != SoType::badType())); } while (false); + parametera3i->unref(); + } + { + SoShaderParameterArray4f * parametera4f = new SoShaderParameterArray4f; + assert(parametera4f); + parametera4f->ref(); + do { INFO("missing class initialization"); CHECK((parametera4f->getTypeId() != SoType::badType())); } while (false); + parametera4f->unref(); + } + { + SoShaderParameterArray4i * parametera4i = new SoShaderParameterArray4i; + assert(parametera4i); + parametera4i->ref(); + do { INFO("missing class initialization"); CHECK((parametera4i->getTypeId() != SoType::badType())); } while (false); + parametera4i->unref(); + } + + { + SoShaderParameterMatrix * matrix = new SoShaderParameterMatrix; + assert(matrix); + matrix->ref(); + do { INFO("missing class initialization"); CHECK((matrix->getTypeId() != SoType::badType())); } while (false); + matrix->unref(); + } + { + SoShaderParameterMatrixArray * matrixarray = new SoShaderParameterMatrixArray; + assert(matrixarray); + matrixarray->ref(); + do { INFO("missing class initialization"); CHECK((matrixarray->getTypeId() != SoType::badType())); } while (false); + matrixarray->unref(); + } + + { + SoShaderStateMatrixParameter * statematrix = new SoShaderStateMatrixParameter; + assert(statematrix); + statematrix->ref(); + do { INFO("missing class initialization"); CHECK((statematrix->getTypeId() != SoType::badType())); } while (false); + statematrix->unref(); + } +} diff --git a/testsuite/shaders/SoShaderProgramTest.cpp b/testsuite/shaders/SoShaderProgramTest.cpp new file mode 100644 index 00000000000..f6b4fc5db19 --- /dev/null +++ b/testsuite/shaders/SoShaderProgramTest.cpp @@ -0,0 +1,65 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoShaderProgram_TestSuite.SoShaderProgram_initialized", "[SoShaderProgram_TestSuite]") +{ + SoShaderProgram * node = new SoShaderProgram; + assert(node); + node->ref(); + do { INFO("missing class initialization"); CHECK((node->getTypeId() != SoType::badType())); } while (false); + node->unref(); +} diff --git a/testsuite/shaders/SoVertexShaderTest.cpp b/testsuite/shaders/SoVertexShaderTest.cpp new file mode 100644 index 00000000000..66b90bd5c6e --- /dev/null +++ b/testsuite/shaders/SoVertexShaderTest.cpp @@ -0,0 +1,65 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoVertexShader_TestSuite.SoVertexShader_initialized", "[SoVertexShader_TestSuite]") +{ + SoVertexShader * node = new SoVertexShader; + assert(node); + node->ref(); + do { INFO("missing class initialization"); CHECK((node->getTypeId() != SoType::badType())); } while (false); + node->unref(); +} diff --git a/testsuite/shadows/SoGLShadowCullingElementTest.cpp b/testsuite/shadows/SoGLShadowCullingElementTest.cpp new file mode 100644 index 00000000000..eee9973ba6c --- /dev/null +++ b/testsuite/shadows/SoGLShadowCullingElementTest.cpp @@ -0,0 +1,61 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoGLShadowCullingElement_TestSuite.SoGLShadowCullingElement_initialized", "[SoGLShadowCullingElement_TestSuite]") +{ + do { INFO("missing class initialization"); CHECK((SoGLShadowCullingElement::getClassStackIndex() != -1)); } while (false); +} diff --git a/testsuite/shadows/SoShadowCullingTest.cpp b/testsuite/shadows/SoShadowCullingTest.cpp new file mode 100644 index 00000000000..5c36ca475a3 --- /dev/null +++ b/testsuite/shadows/SoShadowCullingTest.cpp @@ -0,0 +1,65 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoShadowCulling_TestSuite.SoShadowCulling_initialized", "[SoShadowCulling_TestSuite]") +{ + SoShadowCulling * node = new SoShadowCulling; + assert(node); + node->ref(); + do { INFO("missing class initialization"); CHECK((node->getTypeId() != SoType::badType())); } while (false); + node->unref(); +} diff --git a/testsuite/shadows/SoShadowDirectionalLightTest.cpp b/testsuite/shadows/SoShadowDirectionalLightTest.cpp new file mode 100644 index 00000000000..fcce26e349d --- /dev/null +++ b/testsuite/shadows/SoShadowDirectionalLightTest.cpp @@ -0,0 +1,65 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoShadowDirectionalLight_TestSuite.SoShadowDirectionalLight_initialized", "[SoShadowDirectionalLight_TestSuite]") +{ + SoShadowDirectionalLight * node = new SoShadowDirectionalLight; + assert(node); + node->ref(); + do { INFO("missing class initialization"); CHECK((node->getTypeId() != SoType::badType())); } while (false); + node->unref(); +} diff --git a/testsuite/shadows/SoShadowGroupTest.cpp b/testsuite/shadows/SoShadowGroupTest.cpp new file mode 100644 index 00000000000..d6c72b064d4 --- /dev/null +++ b/testsuite/shadows/SoShadowGroupTest.cpp @@ -0,0 +1,65 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoShadowGroup_TestSuite.SoShadowGroup_initialized", "[SoShadowGroup_TestSuite]") +{ + SoShadowGroup * node = new SoShadowGroup; + assert(node); + node->ref(); + do { INFO("missing class initialization"); CHECK((node->getTypeId() != SoType::badType())); } while (false); + node->unref(); +} diff --git a/testsuite/shadows/SoShadowSpotLightTest.cpp b/testsuite/shadows/SoShadowSpotLightTest.cpp new file mode 100644 index 00000000000..206f72063b6 --- /dev/null +++ b/testsuite/shadows/SoShadowSpotLightTest.cpp @@ -0,0 +1,65 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoShadowSpotLight_TestSuite.SoShadowSpotLight_initialized", "[SoShadowSpotLight_TestSuite]") +{ + SoShadowSpotLight * node = new SoShadowSpotLight; + assert(node); + node->ref(); + do { INFO("missing class initialization"); CHECK((node->getTypeId() != SoType::badType())); } while (false); + node->unref(); +} diff --git a/testsuite/shadows/SoShadowStyleElementTest.cpp b/testsuite/shadows/SoShadowStyleElementTest.cpp new file mode 100644 index 00000000000..54c146874d0 --- /dev/null +++ b/testsuite/shadows/SoShadowStyleElementTest.cpp @@ -0,0 +1,61 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoShadowStyleElement_TestSuite.SoShadowStyleElement_initialized", "[SoShadowStyleElement_TestSuite]") +{ + do { INFO("missing class initialization"); CHECK((SoShadowStyleElement::getClassStackIndex() != -1)); } while (false); +} diff --git a/testsuite/shadows/SoShadowStyleTest.cpp b/testsuite/shadows/SoShadowStyleTest.cpp new file mode 100644 index 00000000000..e8786ec23d3 --- /dev/null +++ b/testsuite/shadows/SoShadowStyleTest.cpp @@ -0,0 +1,65 @@ +/**************************************************************************\ +* 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 + +TEST_CASE("SoShadowStyle_TestSuite.SoShadowStyle_initialized", "[SoShadowStyle_TestSuite]") +{ + SoShadowStyle * node = new SoShadowStyle; + assert(node); + node->ref(); + do { INFO("missing class initialization"); CHECK((node->getTypeId() != SoType::badType())); } while (false); + node->unref(); +} diff --git a/testsuite/soscxml/ScXMLCoinEvaluatorTest.cpp b/testsuite/soscxml/ScXMLCoinEvaluatorTest.cpp new file mode 100644 index 00000000000..295ba2b2a97 --- /dev/null +++ b/testsuite/soscxml/ScXMLCoinEvaluatorTest.cpp @@ -0,0 +1,130 @@ +/**************************************************************************\ +* 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 + +// 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) \ + do { INFO(M); REQUIRE((P)); } while (false); \ + 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; +} + + +TEST_CASE("ScXMLCoinEvaluator_TestSuite.BasicExpressions", "[ScXMLCoinEvaluator_TestSuite]") +{ + 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()); +} 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