MCPcopy Create free account
hub / github.com/couchbase/forestdb / loadDocsWithRandomKeys

Function loadDocsWithRandomKeys

tests/functional/fdb_extended_test.cc:100–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100static 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
124static void updateDocsWithRandomKeys(fdb_file_handle *dbfile,
125 fdb_kvs_handle *db,

Callers 4

test_multi_readersFunction · 0.85
test_rollback_compactionFunction · 0.85

Calls 2

_set_random_stringFunction · 0.85

Tested by

no test coverage detected