Permalink
Browse files

Made jsontest work with 64-bit integers, and fixed an error.

git-svn-id: https://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk@222 1f120ed1-78a5-a849-adca-83f0a9e25bb6
  • Loading branch information...
aaronjacobs authored and rjeczalik committed May 26, 2011
1 parent f9a1e30 commit 3df0a174243977d3d8f193718d2e32fb196b7962
Showing with 24 additions and 0 deletions.
  1. +19 −0 src/test_lib_json/jsontest.cpp
  2. +5 −0 src/test_lib_json/jsontest.h
@@ -275,6 +275,25 @@ TestResult::operator << ( unsigned int value )
}
+#ifdef JSON_HAS_INT64
+TestResult &
+TestResult::operator << ( Json::Int64 value )
+{
+ char buffer[32];
+ sprintf( buffer, "%lld", value );
+ return addToLastFailure( buffer );
+}
+
+TestResult &
+TestResult::operator << ( Json::UInt64 value )
+{
+ char buffer[32];
+ sprintf( buffer, "%ull", value );
+ return addToLastFailure( buffer );
+}
+#endif
+
+
TestResult &
TestResult::operator << ( double value )
{
@@ -87,6 +87,10 @@ namespace JsonTest {
TestResult &operator << ( bool value );
TestResult &operator << ( int value );
TestResult &operator << ( unsigned int value );
+#ifdef JSON_HAS_INT64
+ TestResult &operator << ( Json::Int64 value );
+ TestResult &operator << ( Json::UInt64 value );
+#endif
TestResult &operator << ( double value );
TestResult &operator << ( const char *value );
TestResult &operator << ( const std::string &value );
@@ -229,6 +233,7 @@ namespace JsonTest {
#define JSONTEST_ASSERT_STRING_EQUAL( expected, actual ) \
JsonTest::checkStringEqual( *result_, \
std::string(expected), std::string(actual), \
+ __FILE__, __LINE__, \
#expected " == " #actual )
/// \brief Begin a fixture test case.

0 comments on commit 3df0a17

Please sign in to comment.