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

Function test_query

cachedb/test/test_cachedb.c:231–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231static int test_query(cachedb_funcs *api, cachedb_con *con,
232 const cdb_dict_t *pairs)
233{
234 cdb_res_t res;
235
236 if (!ok(api->query(con, NULL, &res) == 0, "query: NULL filter"))
237 return 0;
238
239 ok(res.count == 2, "query: 2 results");
240 dbg_cdb_dict("pairs: ", pairs);
241 dbg_cdb_dict("res 1: ", nth_dict(&res, 1));
242 dbg_cdb_dict("res 2: ", nth_dict(&res, 2));
243
244 ok(!dict_cmp(nth_dict(&res, 1), nth_dict(&res, 2)), "identical results");
245
246 cdb_free_rows(&res);
247
248 return 1;
249}
250
251static int test_update(cachedb_funcs *api, cachedb_con *con,
252 cdb_dict_t *out_pairs)

Callers 1

test_column_opsFunction · 0.85

Calls 3

nth_dictFunction · 0.85
dict_cmpFunction · 0.85
cdb_free_rowsFunction · 0.85

Tested by

no test coverage detected