MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / test_column_ops

Function test_column_ops

cachedb/test/test_cachedb.c:403–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401}
402
403static int test_column_ops(cachedb_funcs *api, cachedb_con *con1,
404 cachedb_con *con2, const char *cachedb_name)
405{
406 cdb_dict_t cols;
407 cachedb_con *con;
408
409 if (con2)
410 con = con2;
411 else
412 con = con1;
413
414 if (CACHEDB_CAPABILITY(api, CACHEDB_CAP_TRUNCATE))
415 ok(api->truncate(con) == 0, "truncate");
416
417 if (!ok(test_update(api, con, &cols), "test update-set")
418 || !ok(test_query(api, con, &cols), "test query-set")
419 || !ok(test_update_unset(api, con, &cols), "test update-unset")
420 || !ok(test_query_unset(api, con, &cols, cachedb_name), "test query-unset"))
421 return 0;
422
423 if (CACHEDB_CAPABILITY(api, CACHEDB_CAP_TRUNCATE))
424 ok(api->truncate(con) == 0, "truncate");
425
426 cdb_free_entries(&cols, osips_pkg_free);
427
428 if (con2)
429 con = con1;
430
431 if (CACHEDB_CAPABILITY(api, CACHEDB_CAP_TRUNCATE))
432 ok(api->truncate(con) == 0, "truncate");
433
434 if (!ok(test_query_filters(api, con, cachedb_name), "test query filters"))
435 return 0;
436
437 if (CACHEDB_CAPABILITY(api, CACHEDB_CAP_TRUNCATE))
438 ok(api->truncate(con) == 0, "truncate");
439
440 return 1;
441}
442
443static int test_map_set(cachedb_funcs *api, cachedb_con *con,
444 cdb_dict_t *out_pairs1, cdb_dict_t *out_pairs2)

Callers 1

test_cachedb_apiFunction · 0.85

Calls 6

test_updateFunction · 0.85
test_queryFunction · 0.85
test_update_unsetFunction · 0.85
test_query_unsetFunction · 0.85
cdb_free_entriesFunction · 0.85
test_query_filtersFunction · 0.85

Tested by

no test coverage detected