diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2010-09-15 05:54:15 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2010-09-15 05:54:15 +0200 |
commit | f0ce88e605b3717d50a7c153aa9b00c002b24805 (patch) | |
tree | ec6507fd0c5ddb1b5e2982e33f110922d668d736 | |
parent | 21daedc6ff6de2966fe350dceb543a752d845a75 (diff) | |
download | sqlitexx-f0ce88e605b3717d50a7c153aa9b00c002b24805.tar.gz sqlitexx-f0ce88e605b3717d50a7c153aa9b00c002b24805.tar.bz2 |
made leak in test3 more transparent
-rw-r--r-- | include/sqlite3xx/result.hpp | 2 | ||||
-rw-r--r-- | tests/test3.cpp | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/sqlite3xx/result.hpp b/include/sqlite3xx/result.hpp index 77d1938..62d0ad5 100644 --- a/include/sqlite3xx/result.hpp +++ b/include/sqlite3xx/result.hpp @@ -223,7 +223,7 @@ class SQLITEXX_LIBEXPORT result { } value; public: - CachedValue( ) { type = 0; }; + CachedValue( ) { type = 0; value.s = NULL; }; CachedValue( const CachedValue& v ); ~CachedValue( ); CachedValue& operator= ( const CachedValue& v ); diff --git a/tests/test3.cpp b/tests/test3.cpp index e5ac76c..1cbd59d 100644 --- a/tests/test3.cpp +++ b/tests/test3.cpp @@ -52,12 +52,12 @@ int main( ) { ( "integer", prepare::treat_direct ) ( "text", prepare::treat_direct ) ( "double", prepare::treat_direct ); - result r = wi.prepared( "ins" )( 5 )( "bla" )( 8.933 ).exec( ); - cout << "inserted " << r.affected_rows( ) << " rows." << endl; - r = wi.prepared( "ins" )( 18 )( "bli" )( 4.7771 ).exec( ); - cout << "inserted " << r.affected_rows( ) << " rows." << endl; - r = wi.prepared( "ins" )( 7 )( "blu" )( -1.11111 ).exec( ); - cout << "inserted " << r.affected_rows( ) << " rows." << endl; + result rins = wi.prepared( "ins" )( 5 )( "bla" )( 8.933 ).exec( ); + cout << "inserted " << rins.affected_rows( ) << " rows." << endl; + rins = wi.prepared( "ins" )( 18 )( "bli" )( 4.7771 ).exec( ); + cout << "inserted " << rins.affected_rows( ) << " rows." << endl; + rins = wi.prepared( "ins" )( 7 )( "blu" )( -1.11111 ).exec( ); + cout << "inserted " << rins.affected_rows( ) << " rows." << endl; wi.commit( ); work wq( c, "query" ); @@ -66,7 +66,7 @@ int main( ) { ( "integer", prepare::treat_direct ) ( "integer", prepare::treat_direct ); - r = wq.prepared( "qry" )( 4 )( 8 ).exec( ); + result r = wq.prepared( "qry" )( 4 )( 8 ).exec( ); cout << "found " << r.size( ) << " records.." << endl; cout << "found " << r.columns( ) << " columns.." << endl; for( result::size_type i = 0; i < r.columns( ); i++ ) { |