Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use global allocator in ntcs::Async tests that utilize global state #244

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions groups/ntc/ntccfg/ntccfg_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ bool FormatUtil::printFloat(FormatOutput output,
length = rc;
}
#else
int rc = sprintf(buffer, format, args);
int rc = sprintf(buffer, format, value);
length = rc;
#endif

Expand Down Expand Up @@ -1796,7 +1796,7 @@ bool FormatUtil::printDouble(FormatOutput output,
length = rc;
}
#else
int rc = sprintf(buffer, format, args);
int rc = sprintf(buffer, format, value);
length = rc;
#endif

Expand Down
10 changes: 3 additions & 7 deletions groups/ntc/ntcs/ntcs_async.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ NTSCFG_TEST_FUNCTION(ntcs::AsyncTest::verifyStrand)
{
bslmt::Semaphore semaphore;

bsl::shared_ptr<ntci::Strand> strand =
ntcs::Async::createStrand(NTSCFG_TEST_ALLOCATOR);
bsl::shared_ptr<ntci::Strand> strand = ntcs::Async::createStrand();

strand->execute(NTCCFG_BIND(&AsyncTest::processFunction, &semaphore));

Expand All @@ -105,13 +104,10 @@ NTSCFG_TEST_FUNCTION(ntcs::AsyncTest::verifyTimer)
ntci::TimerCallback timerCallback(NTCCFG_BIND(&AsyncTest::processTimer,
&semaphore,
NTCCFG_BIND_PLACEHOLDER_1,
NTCCFG_BIND_PLACEHOLDER_2),
NTSCFG_TEST_ALLOCATOR);
NTCCFG_BIND_PLACEHOLDER_2));

bsl::shared_ptr<ntci::Timer> timer =
ntcs::Async::createTimer(timerOptions,
timerCallback,
NTSCFG_TEST_ALLOCATOR);
ntcs::Async::createTimer(timerOptions, timerCallback);

timer->schedule(timer->currentTime() + bsls::TimeInterval(1));

Expand Down
Loading