Skip to content

Commit

Permalink
Use global allocator in ntcs::Async tests that utilize global state
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrm456 authored Dec 4, 2024
1 parent 76fe37a commit fcfef30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
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

0 comments on commit fcfef30

Please sign in to comment.