MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_primitives

Function test_primitives

wallet/test/run-db.c:432–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430}
431
432static 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
459static bool test_vars(struct lightningd *ld)
460{

Callers 1

mainFunction · 0.70

Calls 4

create_test_dbFunction · 0.85
db_exec_prepared_v2Function · 0.85
tal_freeFunction · 0.85
db_commit_transactionFunction · 0.50

Tested by

no test coverage detected