Skip to content

Commit

Permalink
p4: add test cases for task 4 (#650)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Chi <[email protected]>
  • Loading branch information
skyzh authored Nov 7, 2023
1 parent 11b8453 commit 76d2426
Show file tree
Hide file tree
Showing 5 changed files with 931 additions and 96 deletions.
8 changes: 5 additions & 3 deletions test/txn/txn_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,10 @@ void CheckUndoLogColumn(BustubInstance &instance, const std::string &txn_var_nam
func; \
}

void Execute(BustubInstance &instance, const std::string &query) {
fmt::println(stderr, "- execute sql=\"{}\"", query);
void Execute(BustubInstance &instance, const std::string &query, bool log = true) {
if (log) {
fmt::println(stderr, "- execute sql=\"{}\"", query);
}
NoopWriter writer;
if (!instance.ExecuteSql(query, writer)) {
std::cerr << "failed to execute sql" << std::endl;
Expand All @@ -229,7 +231,7 @@ void TableHeapEntryNoMoreThan(BustubInstance &instance, TableInfo *table_info, s
fmt::println(stderr, " -- error: expect table heap to contain at most {} elements, found {}", upper_limit, cnt);
std::terminate();
}
fmt::println(stderr, "- verify table heap");
fmt::println(stderr, "");
}

void ExecuteTxn(BustubInstance &instance, const std::string &txn_var_name, Transaction *txn, const std::string &query) {
Expand Down
Loading

0 comments on commit 76d2426

Please sign in to comment.