Fix swapped expected and actual values in some of the util tests

Originally committed to SVN as r5498.
This commit is contained in:
Thomas Goyne 2011-07-26 19:51:19 +00:00
parent 231adad93f
commit 5a9fe91899
1 changed files with 6 additions and 9 deletions

View File

@ -68,25 +68,25 @@ TEST_F(lagi_util, UtilRenameExNotFound) {
TEST_F(lagi_util, Utilstr_lower) { TEST_F(lagi_util, Utilstr_lower) {
std::string str("-!ABCDEFGHIJKLMNOPQRSTUVWXYZ123"); std::string str("-!ABCDEFGHIJKLMNOPQRSTUVWXYZ123");
util::str_lower(str); util::str_lower(str);
EXPECT_STREQ(str.c_str(), "-!abcdefghijklmnopqrstuvwxyz123"); EXPECT_STREQ("-!abcdefghijklmnopqrstuvwxyz123", str.c_str());
} }
TEST_F(lagi_util, UtilstrtoiInvalidRange) { TEST_F(lagi_util, UtilstrtoiInvalidRange) {
std::string str("2147483650"); std::string str("2147483650");
EXPECT_EQ(util::strtoi(str), 0); EXPECT_EQ(0, util::strtoi(str));
str.assign("-2147483650"); str.assign("-2147483650");
EXPECT_EQ(util::strtoi(str), 0); EXPECT_EQ(0, util::strtoi(str));
} }
TEST_F(lagi_util, UtilstrtoiInvalidString) { TEST_F(lagi_util, UtilstrtoiInvalidString) {
std::string str("bottles of beer on the wall"); std::string str("bottles of beer on the wall");
EXPECT_EQ(util::strtoi(str), 0); EXPECT_EQ(0, util::strtoi(str));
} }
TEST_F(lagi_util, UtilstrtoiNumberWithString) { TEST_F(lagi_util, UtilstrtoiNumberWithString) {
std::string str("24 bottles of beer on the wall"); std::string str("24 bottles of beer on the wall");
EXPECT_EQ(util::strtoi(str), 24); EXPECT_EQ(24, util::strtoi(str));
} }
TEST_F(lagi_util, UtilstrtoiValidString) { TEST_F(lagi_util, UtilstrtoiValidString) {
@ -94,7 +94,7 @@ TEST_F(lagi_util, UtilstrtoiValidString) {
int i; int i;
EXPECT_NO_THROW(i = util::strtoi(str)); EXPECT_NO_THROW(i = util::strtoi(str));
EXPECT_EQ(i, 24); EXPECT_EQ(24, i);
} }
TEST_F(lagi_util, UtilfreespaceFile) { TEST_F(lagi_util, UtilfreespaceFile) {
@ -119,7 +119,4 @@ TEST_F(lagi_util, UtilfreespaceInvalid) {
EXPECT_ANY_THROW(util::freespace(path)); EXPECT_ANY_THROW(util::freespace(path));
} }
} // namespace agi } // namespace agi