CppEditor: Adapt some test data

... so that the tests pass with both the built-in indenter and
ClangFormat.

Change-Id: I0f870c507dabd80ccfc35f1d3021b2ddabe422d2
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2023-07-03 12:27:26 +02:00
parent c1f6d70445
commit 3f61223c0f

View File

@@ -2746,15 +2746,15 @@ void QuickfixTest::testGenerateGetterSetterCustomTemplate()
const _ customTypeDecl = R"--(
namespace N1 {
namespace N2 {
struct test{};
}
template<typename T>
struct custom {
namespace N2 {
struct test{};
}
template<typename T>
struct custom {
void assign(const custom<T>&);
bool equals(const custom<T>&);
T* get();
};
};
)--";
// Header File
original = customTypeDecl + R"--(
@@ -5210,10 +5210,10 @@ void QuickfixTest::testInsertDefsFromDecls_data()
QTest::addColumn<int>("mode");
QByteArray origHeader = R"(
namespace N {
class @C
{
public:
namespace N {
class @C
{
public:
friend void ignoredFriend();
void ignoredImplemented() {};
void ignoredImplemented2(); // Below
@@ -5223,27 +5223,27 @@ void QuickfixTest::testInsertDefsFromDecls_data()
void funcBelow();
void funcCppFile();
signals:
signals:
void ignoredSignal();
};
};
inline void C::ignoredImplemented2() {}
inline void C::ignoredImplemented2() {}
} // namespace N)";
} // namespace N)";
QByteArray origSource = R"(
#include "file.h"
#include "file.h"
namespace N {
namespace N {
void C::ignoredImplemented3() {}
void C::ignoredImplemented3() {}
} // namespace N)";
} // namespace N)";
QByteArray expectedHeader = R"(
namespace N {
class C
{
public:
namespace N {
class C
{
public:
friend void ignoredFriend();
void ignoredImplemented() {};
void ignoredImplemented2(); // Below
@@ -5256,31 +5256,31 @@ void QuickfixTest::testInsertDefsFromDecls_data()
void funcBelow();
void funcCppFile();
signals:
signals:
void ignoredSignal();
};
};
inline void C::ignoredImplemented2() {}
inline void C::ignoredImplemented2() {}
inline void C::funcBelow()
{
inline void C::funcBelow()
{
}
}
} // namespace N)";
} // namespace N)";
QByteArray expectedSource = R"(
#include "file.h"
#include "file.h"
namespace N {
namespace N {
void C::ignoredImplemented3() {}
void C::ignoredImplemented3() {}
void C::funcCppFile()
{
void C::funcCppFile()
{
}
}
} // namespace N)";
} // namespace N)";
QTest::addRow("normal case")
<< QByteArrayList{origHeader, expectedHeader}
<< QByteArrayList{origSource, expectedSource}