clang-format-editor
clang-format-editor copied to clipboard
Configurator crash
- Insert this code into the Configurator.
- Turn on any option.
- 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());
}
};
}
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
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