| 707 | } |
| 708 | |
| 709 | static 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 | |
| 738 | int main(int argc, char *argv[]) |
| 739 | { |
no test coverage detected