@@ -392,6 +392,15 @@ class LoggingTestLogFileRace : public Aws::Testing::AwsCppSdkGTestSuite
392
392
{
393
393
};
394
394
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
+
395
404
TEST_F (LoggingTestLogFileRace, testRaceOnLogFile)
396
405
{
397
406
/*
@@ -470,12 +479,12 @@ TEST_F(LoggingTestLogFileRace, testMockCrtRaceOnLogFile)
470
479
Aws::UniquePtr<MockCRTLogSystem> logSystem =
471
480
Aws::MakeUnique<MockCRTLogSystem>(AllocationTag, LogLevel::Info, crtLogs);
472
481
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!" );
476
485
for (size_t j = 0 ; j < 100 ; ++j)
477
486
{
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" );
479
488
}
480
489
481
490
return true ;
@@ -522,12 +531,12 @@ TEST_F(LoggingTestLogFileRace, testMockCrtRaceOnSingleLogger)
522
531
}
523
532
524
533
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!" );
528
537
for (size_t j = 0 ; j < 100 ; ++j)
529
538
{
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" );
531
540
}
532
541
533
542
return true ;
@@ -572,12 +581,12 @@ TEST_F(LoggingTestLogFileRace, testCrtLoggerRaceMultipleLoggers)
572
581
Aws::UniquePtr<DefaultCRTLogSystem> logSystem =
573
582
Aws::MakeUnique<DefaultCRTLogSystem>(AllocationTag, LogLevel::Info);
574
583
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!" );
578
587
for (size_t j = 0 ; j < 100 ; ++j)
579
588
{
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" );
581
590
}
582
591
583
592
return true ;
@@ -623,12 +632,12 @@ TEST_F(LoggingTestLogFileRace, testCrtLoggerRaceSingleLogger)
623
632
624
633
625
634
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!" );
629
638
for (size_t j = 0 ; j < 100 ; ++j)
630
639
{
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" );
632
641
}
633
642
634
643
return true ;
0 commit comments