Changeset 1370
- Timestamp:
- 08/10/08 00:46:11 (5 months ago)
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/test/test000.cxx (modified) (2 diffs)
- trunk/test/test001.cxx (modified) (1 diff)
- trunk/test/test002.cxx (modified) (3 diffs)
- trunk/test/test004.cxx (modified) (2 diffs)
- trunk/test/test005.cxx (modified) (1 diff)
- trunk/test/test006.cxx (modified) (1 diff)
- trunk/test/test007.cxx (modified) (2 diffs)
- trunk/test/test008.cxx (modified) (1 diff)
- trunk/test/test009.cxx (modified) (1 diff)
- trunk/test/test085.cxx (modified) (1 diff)
- trunk/test/test090.cxx (modified) (1 diff)
- trunk/test/test092.cxx (modified) (1 diff)
- trunk/test/test_helpers.hxx (modified) (2 diffs)
- trunk/test/unit/test_escape.cxx (modified) (1 diff)
- trunk/test/unit/test_pipeline.cxx (modified) (1 diff)
- trunk/test/unit/test_simultaneous_transactions.cxx (modified) (1 diff)
- trunk/test/unit/test_sql_cursor.cxx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r1368 r1370 1 2008-08-10 Jeroen T. Vermeulen <jtv@xs4all.nl> 2 include/pqxx/connection.hxx, src/connection.cxx: 3 - Doc/comment update 4 test/test000.cxx, test/test001.cxx, test/test002.cxx, test/test004.cxx, 5 test/test005.cxx, test/test006.cxx, test/test007.cxx, test/test008.cxx, 6 test/test009.cxx, test/test085.cxx, test/test090.cxx, test/test092.cxx, 7 test/test_helpers.hxx, test/unit/test_escape.cxx, 8 test/unit/test_pipeline.cxx, test/unit/test_simultaneous_transactions.cxx, 9 test/unit/test_sql_cursor.cxx: 10 - New TestCase::run() so normal tests don't need pqxx::test::pqxxtest() 11 - Rigged up test setup so it runs with nullconnection 12 - Consistently use TestCase for database-connecting tests 1 13 2008-08-09 Jeroen T. Vermeulen <jtv@xs4all.nl> 2 14 test/test000.cxx, test/test002.cxx, test/test004.cxx, test/test007.cxx, trunk/test/test000.cxx
r1368 r1370 82 82 83 83 84 void test_000( )84 void test_000(connection_base &, transaction_base &) 85 85 { 86 86 PQXX_CHECK_EQUAL(oid_none, … … 257 257 int main() 258 258 { 259 return test::pqxxtest(test_000); 260 } 261 259 test::TestCase<nullconnection, nontransaction> test000("test_000", test_000); 260 return test000.run(); 261 } 262 trunk/test/test001.cxx
r1355 r1370 52 52 { 53 53 test::TestCase<> test001("test_001", test_001); 54 return test ::pqxxtest(test001);54 return test001.run(); 55 55 } 56 56 trunk/test/test002.cxx
r1368 r1370 1 1 #include <pqxx/compiler-internal.hxx> 2 2 3 #include <iostream> 4 3 #include <iostream> 5 4 #include <pqxx/connection> 6 5 #include <pqxx/transaction> … … 27 26 } 28 27 29 void test_002( )28 void test_002(connection_base &, transaction_base &) 30 29 { 31 30 // Before we really connect, test the expected behaviour of the default … … 105 104 int main() 106 105 { 107 return test::pqxxtest(test_002); 106 test::TestCase<nullconnection, nontransaction> test002("test_002", test_002); 107 return test002.run(); 108 108 } 109 109 trunk/test/test004.cxx
r1368 r1370 77 77 78 78 79 void test_004( )79 void test_004(connection_base &C, transaction_base &T) 80 80 { 81 connection C(""); 81 T.abort(); 82 82 83 cout << "Adding listener..." << endl; 83 84 TestListener L(C); … … 109 110 int main() 110 111 { 111 return test::pqxxtest(test_004); 112 test::TestCase<connection, nontransaction> test004("test_004", test_004); 113 return test004.run(); 112 114 } 113 115 trunk/test/test005.cxx
r1361 r1370 80 80 { 81 81 test::TestCase<> test005("test_005", test_005); 82 return test ::pqxxtest(test005);82 return test005.run(); 83 83 } 84 84 trunk/test/test006.cxx
r1361 r1370 134 134 { 135 135 test::TestCase<> test006("test_006", test_006); 136 return test ::pqxxtest(test006);136 return test006.run(); 137 137 } 138 138 trunk/test/test007.cxx
r1368 r1370 159 159 160 160 161 void test_007( )161 void test_007(connection_base &C, transaction_base &T) 162 162 { 163 connection C;163 T.abort(); 164 164 C.set_client_encoding("SQL_ASCII"); 165 165 … … 180 180 } // namespace 181 181 182 182 183 int main() 183 184 { 184 test::pqxxtest(test_007); 185 test::TestCase<> test007("test_007", test_007); 186 return test007.run(); 185 187 } 186 188 trunk/test/test008.cxx
r1364 r1370 64 64 { 65 65 test::TestCase<> test008("test_008", test_008); 66 return test ::pqxxtest(test008);66 return test008.run(); 67 67 } 68 68 trunk/test/test009.cxx
r1367 r1370 102 102 { 103 103 test::TestCase<> test009("test_009", test_009); 104 return test ::pqxxtest(test009);104 return test009.run(); 105 105 } 106 106 trunk/test/test085.cxx
r1368 r1370 207 207 { 208 208 test::TestCase<lazyconnection, nontransaction> test085("test_085", test_085); 209 return test ::pqxxtest(test085);210 } 211 209 return test085.run(); 210 } 211 trunk/test/test090.cxx
r1368 r1370 83 83 { 84 84 test::TestCase<connection, nontransaction> test090("test_090", test_090); 85 return test ::pqxxtest(test090);85 return test090.run(); 86 86 } 87 87 trunk/test/test092.cxx
r1368 r1370 83 83 { 84 84 test::TestCase<lazyconnection> test092("test_092", test_092); 85 return test ::pqxxtest(test092);85 return test092.run(); 86 86 } 87 87 trunk/test/test_helpers.hxx
r1368 r1370 87 87 inline void prepare_series(transaction_base &t, int lowest, int highest) 88 88 { 89 if (!have_generate_series(t.conn())) 89 connection_base &conn = t.conn(); 90 // Don't do this for nullconnections, so nullconnection tests can run. 91 if (conn.is_open() && !have_generate_series(conn)) 90 92 { 91 93 t.exec("CREATE TEMP TABLE series(x integer)"); … … 133 135 } 134 136 137 // Invoke test function with its expected arguments 135 138 void operator()() { m_func(m_conn, m_trans); } 139 140 // Run test, catching errors & returning Unix-style success value 141 int run() { return pqxxtest(*this); } 136 142 137 143 private: trunk/test/unit/test_escape.cxx
r1349 r1370 68 68 { 69 69 test::TestCase<> test1("test_esc", test_esc); 70 return test ::pqxxtest(test1);70 return test1.run(); 71 71 } 72 72 trunk/test/unit/test_pipeline.cxx
r1368 r1370 54 54 { 55 55 test::TestCase<> test("pipeline_detach", test_pipeline_detach); 56 return test ::pqxxtest(test);56 return test.run(); 57 57 } 58 58 trunk/test/unit/test_simultaneous_transactions.cxx
r1345 r1370 21 21 { 22 22 test::TestCase<> test("simultaneous_trans", test_simultaneous_transactions); 23 return test ::pqxxtest(test);23 return test.run(); 24 24 } 25 25 trunk/test/unit/test_sql_cursor.cxx
r1368 r1370 288 288 test4("hold_cursor", test_hold_cursor); 289 289 290 return test ::pqxxtest(test1) +291 test ::pqxxtest(test2) +292 test ::pqxxtest(test3) +293 test ::pqxxtest(test4);294 } 295 290 return test1.run() + 291 test2.run() + 292 test3.run() + 293 test4.run(); 294 } 295
