Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit ba3dd2a

Browse files
schedutronapavlo
authored andcommitted
Refactor test case
1 parent ccfa941 commit ba3dd2a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

test/sql/insert_sql_test.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -573,23 +573,19 @@ TEST_F(InsertSQLTests, NonExistentTable) {
573573
catalog::Catalog::GetInstance()->CreateDatabase(DEFAULT_DB_NAME, txn);
574574
txn_manager.CommitTransaction(txn);
575575
std::string error_message;
576-
int rows_changed;
577576
std::unique_ptr<optimizer::AbstractOptimizer> optimizer(
578577
new optimizer::Optimizer());
579578
// Insert an int into a non-existent table.
580579
std::string query("INSERT INTO NonExistentTable VALUES(3);");
581580
txn = txn_manager.BeginTransaction();
582-
rows_changed = 0;
583581
EXPECT_THROW({
584582
try {
585583
TestingSQLUtil::GeneratePlanWithOptimizer(optimizer, query, txn);
586-
} catch (peloton::Exception &ex) {
587-
EXPECT_EQ(ExceptionType::CATALOG, ex.GetType());
584+
} catch (peloton::CatalogException &ex) {
588585
EXPECT_STREQ("Table nonexistenttable is not found", ex.what());
589586
throw peloton::CatalogException(ex.what());
590587
}
591588
}, peloton::CatalogException);
592-
EXPECT_EQ(0, rows_changed);
593589
}
594590

595591
} // namespace test

0 commit comments

Comments
 (0)