[CDRIVER-4253] Use with_error client and pool constructors in test suite Created: 29/Dec/21  Updated: 10/Feb/23

Status: Backlog
Project: C Driver
Component/s: libmongoc, tests
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-3723 Validate URI options on client/client... Closed
Epic Link: CDRIVER-2733

 Description   

CDRIVER-3723 will introduce new mongoc_client_new_from_uri_with_error and mongoc_client_pool_new_with_error methods. Ideally, the test suite should use these methods when creating clients and pools with test_framework_client_new_from_uri and test_framework_client_pool_new_from_uri, respectively.

Since those internal functions can currently return NULL (for tests that expect client/pool construction to fail), the functions may need to be augmented to take an optional bson_error_t. That would allow callers to use ASSERT_OR_PRINT, which in turn will allow for more intuitive error messages when client/pool construction fails (vs. possible segfaults).


Generated at Wed Feb 07 21:20:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.