| 98 | } |
| 99 | |
| 100 | static void loadDocsWithRandomKeys(fdb_file_handle *dbfile, |
| 101 | fdb_kvs_handle *db, |
| 102 | fdb_doc **doc, |
| 103 | int num_docs) { |
| 104 | TEST_INIT(); |
| 105 | fdb_status status; |
| 106 | char keybuf[1024], metabuf[1024], bodybuf[1024]; |
| 107 | |
| 108 | // insert documents |
| 109 | for (int i = 0; i < num_docs; ++i){ |
| 110 | _set_random_string_smallabt(keybuf, KSIZE); |
| 111 | _set_random_string_smallabt(metabuf, MSIZE); |
| 112 | _set_random_string(bodybuf, VSIZE); |
| 113 | status = fdb_doc_create(&doc[i], (void*)keybuf, KSIZE, |
| 114 | (void*)metabuf, MSIZE, (void*)bodybuf, VSIZE); |
| 115 | TEST_CHK(status == FDB_RESULT_SUCCESS); |
| 116 | fdb_set(db, doc[i]); |
| 117 | TEST_CHK(status == FDB_RESULT_SUCCESS); |
| 118 | } |
| 119 | |
| 120 | // commit |
| 121 | fdb_commit(dbfile, FDB_COMMIT_NORMAL); |
| 122 | } |
| 123 | |
| 124 | static void updateDocsWithRandomKeys(fdb_file_handle *dbfile, |
| 125 | fdb_kvs_handle *db, |
no test coverage detected