feat(cpp): add functions related to system#3102
feat(cpp): add functions related to system#3102slbotbm wants to merge 2 commits intoapache:masterfrom
Conversation
|
This PR is ready for review |
| ASSERT_NE(client, nullptr); | ||
|
|
||
| const auto heartbeat_interval = client->heartbeat_interval(); | ||
| EXPECT_EQ(heartbeat_interval, 5'000'000u); |
There was a problem hiding this comment.
magic 5'000'000u (and 10'000'000u at L757). define constexpr std::uint64_t kDefaultHeartbeatMicros = 5'000'000ull; or derive from IggyDuration::from("5s").as_micros().
| ASSERT_NO_THROW(client->connect()); | ||
| ASSERT_THROW(client->get_stats(), std::exception); | ||
|
|
||
| ASSERT_NO_THROW(iggy::ffi::delete_connection(client)); |
There was a problem hiding this comment.
every test manually does delete_connection(client); client = nullptr;. wrap in struct ScopedClient { ~ScopedClient() { iggy::ffi::delete_connection(p); } }; to cut ~30 lines of boilerplate and recover correctness on test-assertion failure - today the connection leaks if an ASSERT_* aborts mid-test.
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you need a review, please ensure CI is green and the PR is rebased on the latest master. Don't hesitate to ping the maintainers - either @core on Discord or by mentioning them directly here on the PR. Thank you for your contribution! |
Which issue does this PR close?
Works toward completion of #2100
Rationale
This PR adds functions related to the system, and tests for previously untested functions.
What changed?
This PR adds:
The places labelled TODO will be completed after merging of #3046.
Local Execution
AI Usage
If AI tools were used, please answer: