diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-03-11 16:47:49 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-03-11 16:47:49 +0300 |
commit | 3d3a63d289cdaa8bc4d4a3820d499ea5a3205b43 (patch) | |
tree | e608c7ebe88503c670fcec02b6db5f54a6843dd2 /test/driver.c | |
parent | aa5ecc3b21bf88c5b9b9c17912e4efbd96eeab34 (diff) |
Release version 3.18.2+7v3.18.2
Place libsqlite3 and sqlite3 packages into single repository.
Diffstat (limited to 'test/driver.c')
-rw-r--r-- | test/driver.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/test/driver.c b/test/driver.c deleted file mode 100644 index 2eabb06..0000000 --- a/test/driver.c +++ /dev/null @@ -1,56 +0,0 @@ -/* file : test/driver.c - * copyright : not copyrighted - public domain - */ - -/* - * Basic test to make sure the library is usable. - */ - -#ifdef NDEBUG -# undef NDEBUG -#endif - -#include <sqlite3.h> - -#include <stddef.h> /* NULL */ -#include <assert.h> - -static int -sql (sqlite3* db, const char* stmt) -{ - return sqlite3_exec (db, stmt, NULL, NULL, NULL) == SQLITE_OK; -} - -int -main () -{ - sqlite3* db; - int r; - - r = sqlite3_open_v2 (":memory:", - &db, - SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, - NULL); - assert (r == SQLITE_OK); - - assert (sql (db, "BEGIN")); - assert (sql (db, "CREATE TABLE test (id INTEGER PRIMARY KEY, str TEXT)")); - assert (sql (db, "COMMIT")); - - assert (sql (db, "BEGIN")); - assert (sql (db, "INSERT INTO test VALUES (123, 'abc')")); - assert (sql (db, "COMMIT")); - - assert (sql (db, "BEGIN")); - assert (!sql (db, "INSERT INTO test VALUES (123, 'ABC')")); - assert (sql (db, "ROLLBACK")); - - assert (sql (db, "BEGIN")); - assert (sql (db, "DROP TABLE test")); - assert (sql (db, "COMMIT")); - - r = sqlite3_close (db); - assert (r == SQLITE_OK); - - return 0; -} |