| 430 | } |
| 431 | |
| 432 | static bool test_primitives(void) |
| 433 | { |
| 434 | struct db_stmt *stmt; |
| 435 | struct db *db = create_test_db(); |
| 436 | |
| 437 | db_begin_transaction(db); |
| 438 | CHECK(db->in_transaction); |
| 439 | db_commit_transaction(db); |
| 440 | CHECK(!db->in_transaction); |
| 441 | db_begin_transaction(db); |
| 442 | db_commit_transaction(db); |
| 443 | |
| 444 | db_begin_transaction(db); |
| 445 | stmt = db_prepare_v2(db, SQL("SELECT name FROM sqlite_master WHERE type='table';")); |
| 446 | db_exec_prepared_v2(stmt); |
| 447 | tal_free(stmt); |
| 448 | |
| 449 | /* We didn't migrate the DB, so don't have the vars table. Pretend we |
| 450 | * didn't change anything so we don't bump the data_version. */ |
| 451 | db->dirty = false; |
| 452 | db_commit_transaction(db); |
| 453 | CHECK(!db->in_transaction); |
| 454 | tal_free(db); |
| 455 | |
| 456 | return true; |
| 457 | } |
| 458 | |
| 459 | static bool test_vars(struct lightningd *ld) |
| 460 | { |
no test coverage detected