From: Tsuda Kageyu Date: Thu, 19 Nov 2015 05:52:02 +0000 (+0900) Subject: Add some tests for String::toInt() with too large values. X-Git-Tag: v1.11beta~97^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95ef0e7882e66fb7fddd4c958fa0d5f335874d48;p=taglib Add some tests for String::toInt() with too large values. --- diff --git a/tests/test_string.cpp b/tests/test_string.cpp index afb2aa23..68a14ed9 100644 --- a/tests/test_string.cpp +++ b/tests/test_string.cpp @@ -241,6 +241,12 @@ public: CPPUNIT_ASSERT_EQUAL(String("-123").toInt(), -123); CPPUNIT_ASSERT_EQUAL(String("123aa").toInt(), 123); CPPUNIT_ASSERT_EQUAL(String("-123aa").toInt(), -123); + + String("2147483648").toInt(&ok); + CPPUNIT_ASSERT_EQUAL(ok, false); + + String("-2147483649").toInt(&ok); + CPPUNIT_ASSERT_EQUAL(ok, false); } void testSubstr()