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

Function create_test_db

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

Source from the content-addressed store, hash-verified

392}
393
394static struct db *create_test_db(void)
395{
396 struct db *db;
397 char *dsn, *filename;
398
399 int fd = tmpdir_mkstemp(tmpctx, "ldb-XXXXXX", &filename);
400 if (fd == -1)
401 return NULL;
402 close(fd);
403
404 dsn = tal_fmt(NULL, "sqlite3://%s", filename);
405 tal_free(filename);
406 db = db_open(NULL, dsn, true, true, db_error, (struct lightningd *)NULL);
407 db->data_version = 0;
408 db->report_changes_fn = NULL;
409
410 tal_free(dsn);
411 return db;
412}
413
414static bool test_empty_db_migrate(struct lightningd *ld)
415{

Callers 4

test_empty_db_migrateFunction · 0.85
test_primitivesFunction · 0.85
test_varsFunction · 0.85
test_manip_columnsFunction · 0.85

Calls 2

tmpdir_mkstempFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected