mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 19:51:58 +01:00
Poco 1.9.1 assert true (#2255)
* Rename assert by assertTrue * Update submodules * Missing assertTrue * Rename poco_assertTrue to poco_assert * Rename poco_assertTrue to poco_assert
This commit is contained in:
committed by
Aleksandar Fabijanic
parent
5a1bf5eb4a
commit
960ecb38f0
@@ -43,35 +43,35 @@ void TextConverterTest::testIdentityASCII()
|
||||
std::string empty;
|
||||
std::string result0;
|
||||
int errors = converter.convert(empty, result0);
|
||||
assert (result0 == empty);
|
||||
assert (errors == 0);
|
||||
assertTrue (result0 == empty);
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string fooBar = "foo bar";
|
||||
std::string result1;
|
||||
errors = converter.convert(fooBar, result1);
|
||||
assert (result1 == fooBar);
|
||||
assert (errors == 0);
|
||||
assertTrue (result1 == fooBar);
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string result2;
|
||||
errors = converter.convert(fooBar.data(), (int) fooBar.length(), result2);
|
||||
assert (result2 == fooBar);
|
||||
assert (errors == 0);
|
||||
assertTrue (result2 == fooBar);
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string result3;
|
||||
errors = converter.convert("", 0, result3);
|
||||
assert (result3.empty());
|
||||
assert (errors == 0);
|
||||
assertTrue (result3.empty());
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string x = "x";
|
||||
std::string result4;
|
||||
errors = converter.convert(x, result4);
|
||||
assert (result4 == x);
|
||||
assert (errors == 0);
|
||||
assertTrue (result4 == x);
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string result5;
|
||||
errors = converter.convert("x", 1, result5);
|
||||
assert (result5 == x);
|
||||
assert (errors == 0);
|
||||
assertTrue (result5 == x);
|
||||
assertTrue (errors == 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,59 +83,59 @@ void TextConverterTest::testIdentityUTF8()
|
||||
std::string empty;
|
||||
std::string result0;
|
||||
int errors = converter.convert(empty, result0);
|
||||
assert (result0 == empty);
|
||||
assert (errors == 0);
|
||||
assertTrue (result0 == empty);
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string fooBar = "foo bar";
|
||||
std::string result1;
|
||||
errors = converter.convert(fooBar, result1);
|
||||
assert (result1 == fooBar);
|
||||
assert (errors == 0);
|
||||
assertTrue (result1 == fooBar);
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string result2;
|
||||
errors = converter.convert(fooBar.data(), (int) fooBar.length(), result2);
|
||||
assert (result2 == fooBar);
|
||||
assert (errors == 0);
|
||||
assertTrue (result2 == fooBar);
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string result3;
|
||||
errors = converter.convert("", 0, result3);
|
||||
assert (result3.empty());
|
||||
assert (errors == 0);
|
||||
assertTrue (result3.empty());
|
||||
assertTrue (errors == 0);
|
||||
|
||||
const unsigned char greek[] = {0x20, 0xce, 0xba, 0xe1, 0xbd, 0xb9, 0xcf, 0x83, 0xce, 0xbc, 0xce, 0xb5, 0x20, 0x00};
|
||||
std::string text((const char*) greek);
|
||||
|
||||
std::string result4;
|
||||
errors = converter.convert(text, result4);
|
||||
assert (result4 == text);
|
||||
assert (errors == 0);
|
||||
assertTrue (result4 == text);
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string result5;
|
||||
errors = converter.convert((char*) greek, 13, result5);
|
||||
assert (result5 == text);
|
||||
assert (errors == 0);
|
||||
assertTrue (result5 == text);
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string x = "x";
|
||||
std::string result6;
|
||||
errors = converter.convert(x, result6);
|
||||
assert (result6 == x);
|
||||
assert (errors == 0);
|
||||
assertTrue (result6 == x);
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string result7;
|
||||
errors = converter.convert("x", 1, result7);
|
||||
assert (result7 == x);
|
||||
assert (errors == 0);
|
||||
assertTrue (result7 == x);
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string utfChar((char*) greek + 1, 2);
|
||||
std::string result8;
|
||||
errors = converter.convert(utfChar, result8);
|
||||
assert (result8 == utfChar);
|
||||
assert (errors == 0);
|
||||
assertTrue (result8 == utfChar);
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string result9;
|
||||
errors = converter.convert((char*) greek + 1, 2, result9);
|
||||
assert (result9 == utfChar);
|
||||
assert (errors == 0);
|
||||
assertTrue (result9 == utfChar);
|
||||
assertTrue (errors == 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -149,12 +149,12 @@ void TextConverterTest::testUTF8toASCII()
|
||||
std::string text((const char*) greek);
|
||||
std::string result0;
|
||||
int errors = converter.convert(text, result0);
|
||||
assert (result0 == " ????? AB");
|
||||
assert (errors == 0);
|
||||
assertTrue (result0 == " ????? AB");
|
||||
assertTrue (errors == 0);
|
||||
|
||||
std::string result1;
|
||||
errors = converter.convert("abcde", 5, result1);
|
||||
assert (result1 == "abcde");
|
||||
assertTrue (result1 == "abcde");
|
||||
}
|
||||
|
||||
|
||||
@@ -171,14 +171,14 @@ void TextConverterTest::testLatin1toUTF8()
|
||||
|
||||
std::string result0;
|
||||
int errors = converter.convert(latin1Text, result0);
|
||||
assert (result0 == utf8Text);
|
||||
assert (errors == 0);
|
||||
assertTrue (result0 == utf8Text);
|
||||
assertTrue (errors == 0);
|
||||
assertEqual((long) result0.size(), 7);
|
||||
|
||||
std::string result1;
|
||||
errors = converter.convert(latin1Chars, 6, result1);
|
||||
assert (result1 == utf8Text);
|
||||
assert (errors == 0);
|
||||
assertTrue (result1 == utf8Text);
|
||||
assertTrue (errors == 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ void TextConverterTest::testErrors()
|
||||
|
||||
std::string result;
|
||||
int errors = converter.convert(badText, result);
|
||||
assert (errors == 2);
|
||||
assertTrue (errors == 2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user