]> git.tdb.fi Git - libs/core.git/blobdiff - tests/lexicalcast.cpp
Add missing terminator entries to some test data arrays
[libs/core.git] / tests / lexicalcast.cpp
index a983f1b146675aa7d5dd4883f7ef6a3d99a5ddc4..37439fc8d105d9b96b815615e086121ac8fc1333 100644 (file)
@@ -99,6 +99,7 @@ void LexicalCastTests::oct_integers()
                { 012345, "%#08o", "00012345" },
                { 012345, "%+#o", "+012345" },
                { -012345, "%#o", "-012345" },
+               { 0, 0, 0 }
        };
        test_values<int>(values);
 }
@@ -114,6 +115,7 @@ void LexicalCastTests::bin_integers()
                { 0xcf3, "%#016b", "0b00110011110011" },
                { 0xcf3, "%+#b", "+0b110011110011" },
                { -0xcf3, "%#b", "-0b110011110011" },
+               { 0, 0, 0 }
        };
        test_values<int>(values);
 }
@@ -207,7 +209,7 @@ void LexicalCastTests::test_values(const Value<T> *values)
 {
        for(const Value<T> *i=values; i->format; ++i)
        {
-               string result = lexical_cast(i->value, i->format);
+               string result = lexical_cast<string>(i->value, i->format);
                expect_equal(result, result==i->result, format("result == \"%s\"", c_escape(i->result)));
        }
 }