MCPcopy Create free account
hub / github.com/apache/impala / TestErrorString

Method TestErrorString

be/src/exprs/expr-test.cc:743–755  ·  view source on GitHub ↗

"Execute 'expr' and check that the returned error ends with 'error_string'"

Source from the content-addressed store, hash-verified

741
742 // "Execute 'expr' and check that the returned error ends with 'error_string'"
743 void TestErrorString(const string& expr, const string& error_string) {
744 string stmt = "select " + expr;
745 vector<FieldSchema> result_types;
746 string result_row;
747 Status status = executor_->Exec(stmt, &result_types);
748 status = executor_->FetchResult(&result_row);
749 ASSERT_FALSE(status.ok());
750 // Ignore the tailing '\n' characters when matching
751 string actual_msg = boost::trim_right_copy(status.msg().msg());
752 string expected_msg = boost::trim_right_copy(error_string);
753 ASSERT_TRUE(EndsWith(actual_msg, expected_msg)) << "Actual: '"
754 << status.msg().msg() << "'" << endl << "Expected: '" << error_string << "'";
755 }
756
757 template <typename T> void TestFixedPointComparisons(bool test_boundaries) {
758 int64_t t_min = numeric_limits<T>::min();

Callers

nothing calls this directly

Calls 4

EndsWithFunction · 0.85
ExecMethod · 0.45
FetchResultMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected