From f0ce88e605b3717d50a7c153aa9b00c002b24805 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Wed, 15 Sep 2010 05:54:15 +0200 Subject: made leak in test3 more transparent --- include/sqlite3xx/result.hpp | 2 +- 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++ ) { -- cgit v1.2.3-54-g00ecf