-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned up some cruft, tweaked index creation methods, added small un…
…it test for idx creation
- Loading branch information
Showing
4 changed files
with
43 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,44 @@ void add_patient(protobufs::Command &cmdadd, int id, string name, int age, | |
p->set_string_value("Random"); | ||
} | ||
|
||
TEST(PMGDQueryHandler, addIndexTest){ | ||
|
||
VDMSConfig::init("unit_tests/config-pmgd-tests.json"); | ||
PMGDQueryHandler::init(); | ||
PMGDQueryHandler qh; | ||
int idx_build_rc; | ||
|
||
vector<protobufs::Command *> cmds; | ||
|
||
idx_build_rc = qh.build_node_int_index((char * ) "Patient", (char *) "Age"); | ||
|
||
int txid = 1, patientid = 1, eid = 1, query_count = 0; | ||
//Begin TX | ||
protobufs::Command cmdtx; | ||
cmdtx.set_cmd_id(protobufs::Command::TxBegin); | ||
cmdtx.set_tx_id(txid); | ||
cmds.push_back(&cmdtx); | ||
query_count++; | ||
|
||
protobufs::Command cmdadd1; | ||
cmdadd1.set_tx_id(txid); | ||
add_patient(cmdadd1, patientid++, "Keira F.", 39, | ||
"Sat Nov 12 17:59:24 PDT 1984", "[email protected]", FEMALE); | ||
cmds.push_back(&cmdadd1); | ||
query_count++; | ||
|
||
//commit TX | ||
protobufs::Command cmdtxcommit; | ||
cmdtxcommit.set_cmd_id(protobufs::Command::TxCommit); | ||
cmdtxcommit.set_tx_id(txid); | ||
cmds.push_back(&cmdtxcommit); | ||
|
||
//TODO prints/RC checks | ||
qh.print_node_idx_stats((char *)"Patient", (char *)"Age"); | ||
ASSERT_EQ(idx_build_rc, 0); | ||
|
||
} | ||
|
||
TEST(PMGDQueryHandler, addTest) { | ||
VDMSConfig::init("unit_tests/config-pmgd-tests.json"); | ||
PMGDQueryHandler::init(); | ||
|