diff --git a/TODO.txt b/TODO.txt index 485ea61..177e67f 100644 --- a/TODO.txt +++ b/TODO.txt @@ -6,8 +6,6 @@ Adding an encapsulation to the statement ref counter => V0.5.0 -using assert() in example program to provide a basic test coverage - Missing features in v0.4.0: - Blob - getColumnByName ? std::map getRow() ? diff --git a/src/example1/main.cpp b/src/example1/main.cpp index caf8dce..f06b5dc 100644 --- a/src/example1/main.cpp +++ b/src/example1/main.cpp @@ -107,6 +107,7 @@ int main (void) catch (std::exception& e) { std::cout << "SQLite exception: " << e.what() << std::endl; + abort(); // unexpected error : abort the example program } //////////////////////////////////////////////////////////////////////////// @@ -124,6 +125,7 @@ int main (void) catch (std::exception& e) { std::cout << "SQLite exception: " << e.what() << std::endl; + abort(); // unexpected error : abort the example program } // The execAndGet wrapper example (3/5) : @@ -142,6 +144,7 @@ int main (void) catch (std::exception& e) { std::cout << "SQLite exception: " << e.what() << std::endl; + abort(); // unexpected error : abort the example program } //////////////////////////////////////////////////////////////////////////// @@ -181,6 +184,7 @@ int main (void) catch (std::exception& e) { std::cout << "SQLite exception: " << e.what() << std::endl; + abort(); // unexpected error : abort the example program } remove("test.db3"); @@ -211,6 +215,7 @@ int main (void) catch (std::exception& e) { std::cout << "SQLite exception: " << e.what() << std::endl; + abort(); // unexpected error : abort the example program } // Exemple of a rollbacked transaction : @@ -225,12 +230,15 @@ int main (void) nb = db.exec("INSERT INTO test ObviousError"); std::cout << "INSERT INTO test \"error\", returned " << nb << std::endl; + abort(); // unexpected success : abort the example program + // Commit transaction transaction.commit(); } catch (std::exception& e) { std::cout << "SQLite exception: " << e.what() << std::endl; + // expected error, see above } // Check the results (expect only one row of result, as the second one has been rollbacked by the error) @@ -244,6 +252,7 @@ int main (void) catch (std::exception& e) { std::cout << "SQLite exception: " << e.what() << std::endl; + abort(); // unexpected error : abort the example program } remove("transaction.db3");