mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
Fix upgrading of ID3v2.3 genre with number 0 (Blues)
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1114089 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
@ -40,6 +40,7 @@ class TestString : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testUTF16DecodeEmptyWithBOM);
|
||||
CPPUNIT_TEST(testAppendCharDetach);
|
||||
CPPUNIT_TEST(testAppendStringDetach);
|
||||
CPPUNIT_TEST(testToInt);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -165,6 +166,33 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(3, String("foo.bar").rfind("."));
|
||||
}
|
||||
|
||||
void testToInt()
|
||||
{
|
||||
bool ok;
|
||||
CPPUNIT_ASSERT_EQUAL(String("123").toInt(&ok), 123);
|
||||
CPPUNIT_ASSERT_EQUAL(ok, true);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(String("-123").toInt(&ok), -123);
|
||||
CPPUNIT_ASSERT_EQUAL(ok, true);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(String("abc").toInt(&ok), 0);
|
||||
CPPUNIT_ASSERT_EQUAL(ok, false);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(String("1x").toInt(&ok), 1);
|
||||
CPPUNIT_ASSERT_EQUAL(ok, false);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(String("").toInt(&ok), 0);
|
||||
CPPUNIT_ASSERT_EQUAL(ok, false);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(String("-").toInt(&ok), 0);
|
||||
CPPUNIT_ASSERT_EQUAL(ok, false);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(String("123").toInt(), 123);
|
||||
CPPUNIT_ASSERT_EQUAL(String("-123").toInt(), -123);
|
||||
CPPUNIT_ASSERT_EQUAL(String("123aa").toInt(), 123);
|
||||
CPPUNIT_ASSERT_EQUAL(String("-123aa").toInt(), -123);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestString);
|
||||
|
Reference in New Issue
Block a user