Author: wyoung
Date: Tue Feb 12 02:09:37 2008
New Revision: 2176
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2176&view=rev
Log:
Wrote a test case for test/string.cpp that wasn't getting called.
(Ooopsie.) Made up several ways to call it, so now we know string to
int conversions are working.
Modified:
trunk/test/string.cpp
Modified: trunk/test/string.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/test/string.cpp?rev=2176&r1=2175&r2=2176&view=diff
==============================================================================
--- trunk/test/string.cpp (original)
+++ trunk/test/string.cpp Tue Feb 12 02:09:37 2008
@@ -117,9 +117,9 @@
}
else {
std::cerr << "Conversion of \"" << s << "\" to int " <<
- (conv_threw ? "did not " : "") << "throw; did "
<<
- (throw_expected ? "not " : "") << "expect it
to." <<
- std::endl;
+ (conv_threw ? "did not throw" : "threw") << ";
" <<
+ (throw_expected ? "did not expect" :
"expected") <<
+ " it to." << std::endl;
return false;
}
}
@@ -179,6 +179,9 @@
mysqlpp::String empty;
mysqlpp::String zero("0");
mysqlpp::String nonzero("42");
+ mysqlpp::String intable1("42.");
+ mysqlpp::String intable2("42.0");
+ mysqlpp::String nonint("42.1");
failures += test_equality(empty, mysqlpp::Date()) == false;
failures += test_equality(empty,
@@ -195,7 +198,13 @@
failures += test_locale() == false;
failures += test_float_conversion() == false;
failures += test_float_conversion() == false;
-
+ failures += test_int_conversion(empty, false) == false;
+ failures += test_int_conversion(zero, false) == false;
+ failures += test_int_conversion(nonzero, false) == false;
+ failures += test_int_conversion(intable1, false) == false;
+ failures += test_int_conversion(intable2, false) == false;
+ failures += test_int_conversion(nonint, true) == false;
+
return failures;
}
catch (mysqlpp::Exception& e) {
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits