@@ -318,8 +318,6 @@ class TestTelemeter : public Telemeter {
318318 TestTelemeter (std::string SessionId) : Uuid(SessionId), Counter(0 ) {}
319319
320320 static std::unique_ptr<TestTelemeter> createInstance (Config *config) {
321- llvm::errs () << " ============================== createInstance is called"
322- << " \n " ;
323321 if (!config->EnableTelemetry )
324322 return nullptr ;
325323 CurrentContext->ExpectedUuid = nextUuid ();
@@ -348,7 +346,7 @@ class TestTelemeter : public Telemeter {
348346
349347 // The vendor can add additional stuff to the entry before logging.
350348 if (auto *S = dyn_cast<StartupEvent>(Entry)) {
351- S->MagicStartupMsg = llvm::Twine (" One_ " , ToolPath).str ();
349+ S->MagicStartupMsg = llvm::Twine (" Startup_ " , ToolPath).str ();
352350 }
353351 emitToDestinations (Entry);
354352 }
@@ -364,7 +362,7 @@ class TestTelemeter : public Telemeter {
364362
365363 // The vendor can add additional stuff to the entry before logging.
366364 if (auto *E = dyn_cast<ExitEvent>(Entry)) {
367- E->MagicExitMsg = llvm::Twine (" Three_ " , ToolPath).str ();
365+ E->MagicExitMsg = llvm::Twine (" Exit_ " , ToolPath).str ();
368366 }
369367
370368 emitToDestinations (Entry);
@@ -549,11 +547,11 @@ TEST(TelemetryTest, TelemetryEnabled) {
549547 {
550548 std::string ExpectedBuffer =
551549 (" SessionId:" + llvm::Twine (CurrentContext->ExpectedUuid ) + " \n " +
552- " MagicStartupMsg:One_ " + llvm::Twine (ToolName) + " \n " +
550+ " MagicStartupMsg:Startup_ " + llvm::Twine (ToolName) + " \n " +
553551 " SessionId:" + llvm::Twine (CurrentContext->ExpectedUuid ) + " \n " +
554552 " MSG_0:Two\n " + " MSG_1:Deux\n " + " MSG_2:Zwei\n " +
555553 " SessionId:" + llvm::Twine (CurrentContext->ExpectedUuid ) + " \n " +
556- " MagicExitMsg:Three_ " + llvm::Twine (ToolName) + " \n " )
554+ " MagicExitMsg:Exit_ " + llvm::Twine (ToolName) + " \n " )
557555 .str ();
558556
559557 EXPECT_STREQ (ExpectedBuffer.c_str (), CurrentContext->Buffer .c_str ());
@@ -570,7 +568,7 @@ TEST(TelemetryTest, TelemetryEnabled) {
570568 ASSERT_NE (StartupEntry, nullptr );
571569 EXPECT_STREQ (
572570 (" [[\" SessionId\" ,\" " + llvm::Twine (CurrentContext->ExpectedUuid ) +
573- " \" ],[\" MagicStartupMsg\" ,\" One_ " + llvm::Twine (ToolName) + " \" ]]" )
571+ " \" ],[\" MagicStartupMsg\" ,\" Startup_ " + llvm::Twine (ToolName) + " \" ]]" )
574572 .str ()
575573 .c_str (),
576574 ValueToString (StartupEntry).c_str ());
@@ -592,7 +590,7 @@ TEST(TelemetryTest, TelemetryEnabled) {
592590 ASSERT_NE (ExitEntry, nullptr );
593591 EXPECT_STREQ (
594592 (" [[\" SessionId\" ,\" " + llvm::Twine (CurrentContext->ExpectedUuid ) +
595- " \" ],[\" MagicExitMsg\" ,\" Three_ " + llvm::Twine (ToolName) + " \" ]]" )
593+ " \" ],[\" MagicExitMsg\" ,\" Exit_ " + llvm::Twine (ToolName) + " \" ]]" )
596594 .str ()
597595 .c_str (),
598596 ValueToString (ExitEntry).c_str ());
@@ -629,12 +627,12 @@ TEST(TelemetryTest, TelemetryEnabledSanitizeData) {
629627 // The StringDestination should have removed the odd-positioned msgs.
630628 std::string ExpectedBuffer =
631629 (" SessionId:" + llvm::Twine (CurrentContext->ExpectedUuid ) + " \n " +
632- " MagicStartupMsg:One_ " + llvm::Twine (ToolName) + " \n " +
630+ " MagicStartupMsg:Startup_ " + llvm::Twine (ToolName) + " \n " +
633631 " SessionId:" + llvm::Twine (CurrentContext->ExpectedUuid ) + " \n " +
634632 " MSG_0:Two\n " + " MSG_1:\n " + // <<< was sanitized away.
635633 " MSG_2:Zwei\n " +
636634 " SessionId:" + llvm::Twine (CurrentContext->ExpectedUuid ) + " \n " +
637- " MagicExitMsg:Three_ " + llvm::Twine (ToolName) + " \n " )
635+ " MagicExitMsg:Exit_ " + llvm::Twine (ToolName) + " \n " )
638636 .str ();
639637 EXPECT_STREQ (ExpectedBuffer.c_str (), CurrentContext->Buffer .c_str ());
640638 }
@@ -650,7 +648,7 @@ TEST(TelemetryTest, TelemetryEnabledSanitizeData) {
650648 ASSERT_NE (StartupEntry, nullptr );
651649 EXPECT_STREQ (
652650 (" [[\" SessionId\" ,\" " + llvm::Twine (CurrentContext->ExpectedUuid ) +
653- " \" ],[\" MagicStartupMsg\" ,\" One_ " + llvm::Twine (ToolName) + " \" ]]" )
651+ " \" ],[\" MagicStartupMsg\" ,\" Startup_ " + llvm::Twine (ToolName) + " \" ]]" )
654652 .str ()
655653 .c_str (),
656654 ValueToString (StartupEntry).c_str ());
@@ -670,7 +668,7 @@ TEST(TelemetryTest, TelemetryEnabledSanitizeData) {
670668 ASSERT_NE (ExitEntry, nullptr );
671669 EXPECT_STREQ (
672670 (" [[\" SessionId\" ,\" " + llvm::Twine (CurrentContext->ExpectedUuid ) +
673- " \" ],[\" MagicExitMsg\" ,\" Three_ " + llvm::Twine (ToolName) + " \" ]]" )
671+ " \" ],[\" MagicExitMsg\" ,\" Exit_ " + llvm::Twine (ToolName) + " \" ]]" )
674672 .str ()
675673 .c_str (),
676674 ValueToString (ExitEntry).c_str ());
0 commit comments