|
|
|
@ -707,6 +707,12 @@ struct CUTMiscStringCommon : public Test::Suite
|
|
|
|
|
ret = NLMISC::fromString("yes", val);
|
|
|
|
|
TEST_ASSERT(ret && val);
|
|
|
|
|
|
|
|
|
|
ret = NLMISC::fromString("YES", val);
|
|
|
|
|
TEST_ASSERT(ret && val);
|
|
|
|
|
|
|
|
|
|
ret = NLMISC::fromString("True", val);
|
|
|
|
|
TEST_ASSERT(ret && val);
|
|
|
|
|
|
|
|
|
|
// false values
|
|
|
|
|
ret = NLMISC::fromString("0", val);
|
|
|
|
|
TEST_ASSERT(ret && !val);
|
|
|
|
@ -730,14 +736,17 @@ struct CUTMiscStringCommon : public Test::Suite
|
|
|
|
|
TEST_ASSERT(ret && !val);
|
|
|
|
|
|
|
|
|
|
// wrong values
|
|
|
|
|
ret = NLMISC::fromString("YES", val);
|
|
|
|
|
TEST_ASSERT(!ret && !val);
|
|
|
|
|
|
|
|
|
|
ret = NLMISC::fromString("foo", val);
|
|
|
|
|
TEST_ASSERT(!ret && !val);
|
|
|
|
|
|
|
|
|
|
ret = NLMISC::fromString("a", val);
|
|
|
|
|
TEST_ASSERT(!ret && !val);
|
|
|
|
|
|
|
|
|
|
ret = NLMISC::fromString("Yesss", val);
|
|
|
|
|
TEST_ASSERT(!ret && !val);
|
|
|
|
|
|
|
|
|
|
ret = NLMISC::fromString("nope", val);
|
|
|
|
|
TEST_ASSERT(!ret && !val);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|