Skip to content

Commit c9b2c2b

Browse files
Fix #1536 missing lower-casing in case of DefaultMonitoring enabled
1 parent 4e1fd89 commit c9b2c2b

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

tests/aws-cpp-sdk-core-tests/utils/logging/LoggingTest.cpp

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,15 @@ class LoggingTestLogFileRace : public Aws::Testing::AwsCppSdkGTestSuite
392392
{
393393
};
394394

395+
void LogOnCRTLogSystemInterfaceWithoutVaArgs(CRTLogSystemInterface* object, LogLevel logLevel, const char* subjectName, const char* formatStr, ...)
396+
{
397+
va_list args;
398+
va_start(args, formatStr);
399+
assert(object);
400+
object->Log(logLevel, subjectName, formatStr, args);
401+
va_end(args);
402+
}
403+
395404
TEST_F(LoggingTestLogFileRace, testRaceOnLogFile)
396405
{
397406
/*
@@ -470,12 +479,12 @@ TEST_F(LoggingTestLogFileRace, testMockCrtRaceOnLogFile)
470479
Aws::UniquePtr<MockCRTLogSystem> logSystem =
471480
Aws::MakeUnique<MockCRTLogSystem>(AllocationTag, LogLevel::Info, crtLogs);
472481
Aws::String logMsgTag = "testMockCrtRaceOnLogFile thread #" + Aws::Utils::StringUtils::to_string(i);
473-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), "Knock knock", nullptr);
474-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), " - Who's there?", nullptr);
475-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), " - Race condition!", nullptr);
482+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), "Knock knock");
483+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), " - Who's there?");
484+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), " - Race condition!");
476485
for(size_t j = 0; j < 100; ++j)
477486
{
478-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), "All work and no play makes Jack a dull boy", nullptr);
487+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), "All work and no play makes Jack a dull boy");
479488
}
480489

481490
return true;
@@ -522,12 +531,12 @@ TEST_F(LoggingTestLogFileRace, testMockCrtRaceOnSingleLogger)
522531
}
523532

524533
Aws::String logMsgTag = "testMockCrtRaceOnLogFile thread #" + Aws::Utils::StringUtils::to_string(i);
525-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), "Knock knock", nullptr);
526-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), " - Who's there?", nullptr);
527-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), " - Race condition!", nullptr);
534+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), "Knock knock");
535+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), " - Who's there?");
536+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), " - Race condition!");
528537
for(size_t j = 0; j < 100; ++j)
529538
{
530-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), "All work and no play makes Jack a dull boy", nullptr);
539+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), "All work and no play makes Jack a dull boy");
531540
}
532541

533542
return true;
@@ -572,12 +581,12 @@ TEST_F(LoggingTestLogFileRace, testCrtLoggerRaceMultipleLoggers)
572581
Aws::UniquePtr<DefaultCRTLogSystem> logSystem =
573582
Aws::MakeUnique<DefaultCRTLogSystem>(AllocationTag, LogLevel::Info);
574583
Aws::String logMsgTag = "testCrtRaceOnLogFile thread #" + Aws::Utils::StringUtils::to_string(i);
575-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), "Knock knock", nullptr);
576-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), " - Who's there?", nullptr);
577-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), " - Race condition!", nullptr);
584+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), "Knock knock");
585+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), " - Who's there?");
586+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), " - Race condition!");
578587
for(size_t j = 0; j < 100; ++j)
579588
{
580-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), "All work and no play makes Jack a dull boy", nullptr);
589+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), "All work and no play makes Jack a dull boy");
581590
}
582591

583592
return true;
@@ -623,12 +632,12 @@ TEST_F(LoggingTestLogFileRace, testCrtLoggerRaceSingleLogger)
623632

624633

625634
Aws::String logMsgTag = "testCrtRaceOnLogFile thread #" + Aws::Utils::StringUtils::to_string(i);
626-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), "Knock knock", nullptr);
627-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), " - Who's there?", nullptr);
628-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), " - Race condition!", nullptr);
635+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), "Knock knock");
636+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), " - Who's there?");
637+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), " - Race condition!");
629638
for(size_t j = 0; j < 100; ++j)
630639
{
631-
logSystem->Log(LogLevel::Info, logMsgTag.c_str(), "All work and no play makes Jack a dull boy", nullptr);
640+
LogOnCRTLogSystemInterfaceWithoutVaArgs(logSystem.get(), LogLevel::Info, logMsgTag.c_str(), "All work and no play makes Jack a dull boy");
632641
}
633642

634643
return true;

0 commit comments

Comments
 (0)