| 303 | } |
| 304 | |
| 305 | static void validateUDFError(std::function<void()> createFunc, std::string errMsg) { |
| 306 | try { |
| 307 | createFunc(); |
| 308 | } catch (CatalogException& e) { |
| 309 | ASSERT_EQ(std::string(e.what()), errMsg); |
| 310 | return; |
| 311 | } catch (Exception&) { |
| 312 | FAIL(); |
| 313 | } |
| 314 | FAIL(); |
| 315 | } |
| 316 | |
| 317 | TEST_F(ApiTest, UDFError) { |
| 318 | conn->createScalarFunction("add5", &add5); |