File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -305,10 +305,17 @@ TEST_CASE("custom functions") {
305305 storage.sync_schema ();
306306
307307 storage.create_aggregate_function <MeanFunction>();
308- // test the case when `MeanFunction::step()` was never called
309- { REQUIRE_NOTHROW (storage.select (func<MeanFunction>(&User::id))); }
308+ // test w/o a result set, i.e when the final aggregate call is the first to require the aggregate function
309+ REQUIRE_NOTHROW (storage.select (func<MeanFunction>(&User::id)));
310310 storage.delete_aggregate_function <MeanFunction>();
311311
312+ storage.create_aggregate_function <NonAllocatableAggregateFunction>();
313+ // test w/o a result set, i.e when the final aggregate call is the first to require the aggregate function
314+ REQUIRE_THROWS_MATCHES (storage.select (func<NonAllocatableAggregateFunction>(&User::id)),
315+ std::system_error,
316+ ErrorCodeExceptionMatcher (sqlite_errc (SQLITE_NOMEM)));
317+ storage.delete_aggregate_function <NonAllocatableAggregateFunction>();
318+
312319 // call before creation
313320 REQUIRE_THROWS_WITH (storage.select (func<SqrtFunction>(4 )), ContainsSubstring (" no such function" ));
314321
You can’t perform that action at this time.
0 commit comments