MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / test_bind_array_in_sp

Function test_bind_array_in_sp

tests/tools/cdb2bind.c:709–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

707}
708
709static void test_bind_array_in_sp(void)
710{
711 create_procedure_sp_carray();
712
713 cdb2_hndl_tp *hndl = NULL;
714 test_open(&hndl, db);
715
716 test_exec(hndl, "exec procedure sp_carray()");
717 char *exp[] = {
718 "0.0", "1.0", "2.0", "3.0", "4.0", //array of doubles
719 "5","6","7","8","9", "10", //array of integers
720 "hello", "world", //array of strings
721 "Comdb2", "592" //array of blobs
722 };
723 int rc, n = 0;
724 while ((rc = cdb2_next_record(hndl)) == CDB2_OK) {
725 char *val = cdb2_column_value(hndl, 0);
726 if (strcmp(val, exp[n]) != 0) {
727 fprintf(stderr, "cdb2_next_record exp:%s val:%s\n", exp[n], val);
728 abort();
729 }
730 ++n;
731 }
732 if (rc != CDB2_OK_DONE) {
733 fprintf(stderr, "cdb2_next_record failed rc:%d err:%s\n", rc, cdb2_errstr(hndl));
734 abort();
735 }
736}
737
738int main(int argc, char *argv[])
739{

Callers 1

mainFunction · 0.85

Calls 6

cdb2_next_recordFunction · 0.85
cdb2_column_valueFunction · 0.85
cdb2_errstrFunction · 0.85
test_openFunction · 0.70
test_execFunction · 0.70

Tested by

no test coverage detected