clang-format-editor icon indicating copy to clipboard operation
clang-format-editor copied to clipboard

Configurator crash

Open espr14 opened this issue 2 years ago • 2 comments

  1. Insert this code into the Configurator.
  2. Turn on any option.
  3. Application crashes in few seconds.
#include "pch.h"
#include "CppUnitTest.h"
#include "../HelloWorldUnitTestCPP/HelloWorldUnitTestCPP.cpp"   // Update using your project name

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace HelloWorldTests
{
   TEST_CLASS(HelloWorldTests)
   {
   public:

      TEST_METHOD(TestMethod)
      {
         std::string expected = "Hello World!\n";

         std::stringstream buffer;
         std::streambuf* sbuf = std::cout.rdbuf(); // Save cout's buffer
         std::cout.rdbuf(buffer.rdbuf()); // Redirect cout to the stringstream buffer

         // Call main() in your test
         int result = main();

         // When finished, redirect cout to the original buffer 
         std::cout.rdbuf(sbuf);
         std::cout << "std original buffer: \n";
         std::cout << buffer.get();

         // Test
         Assert::AreEqual(expected, buffer.str());
      }
   };
}

espr14 avatar Sep 08 '22 08:09 espr14

for me it also crashes after analyzing for a while, no matter which .cpp or .h file i select. additionally, it shows a message box with a warning when starting up image

consulion avatar Apr 06 '23 12:04 consulion

Hi @espr14,

A fix for this issue is available in Clang Format Editor v2023.4.2

Thank you for reporting this problem

Kind regards, Marina

mariru27 avatar Aug 18 '23 10:08 mariru27