Adjust test case

This commit is contained in:
kaetemi 2019-05-01 12:49:01 +08:00
parent 83fdb7b4a1
commit d1fd45b29a

View file

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