X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fprops%2FpropertyObject_test.cxx;h=b2c458ad5a12da9b33a52c601451fe1c35b0568e;hb=7479ae521ce3f8d713419f1a57d544c71e25cb30;hp=2b2ee1ec01060eb86200ab9c62546f2c105bdf0b;hpb=c3c97f2956d3546d28ad7f036462dd2401a3bab1;p=simgear.git diff --git a/simgear/props/propertyObject_test.cxx b/simgear/props/propertyObject_test.cxx index 2b2ee1ec..b2c458ad 100644 --- a/simgear/props/propertyObject_test.cxx +++ b/simgear/props/propertyObject_test.cxx @@ -149,6 +149,27 @@ void testReadMissing() } } +void testCreate() +{ + PropertyObject a = PropertyObject::create("a/lemon", true); + assert(a == true); + assert(testRoot->getBoolValue("a/lemon") == true); + + + PropertyObject b(PropertyObject::create("a/pear", 3142)); + assert(b == 3142); + + PropertyObject c(PropertyObject::create("a/lime", "fofofo")); + assert(c == "fofofo"); + +// check overloads for string version + SGPropertyNode* n = testRoot->getNode("b", true); + PropertyObject d(PropertyObject::create(n, "grape", "xyz")); + assert(!strcmp(testRoot->getStringValue("b/grape"), "xyz")); + + +} + int main(int argc, char* argv[]) { testRoot = new SGPropertyNode(); @@ -170,6 +191,7 @@ int main(int argc, char* argv[]) testString(); testAssignment(); testSTLContainer(); + testCreate(); return EXIT_SUCCESS; }