Test code is should be updated according the latest generator version

Add protobufgen output files to the grpcgen test for auto checking
them up to date

Pick-to: 6.5
Change-Id: Ia7c3fcedfc9b3a4f0e66e748db8d5d818b4fb069
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Tatiana Borisova 2023-03-09 19:02:21 +01:00
parent b0fbb0beb5
commit fa202dd944
3 changed files with 15 additions and 10 deletions

View File

@ -51,9 +51,9 @@ void SimpleStringMessage::registerTypes()
SimpleStringMessage::SimpleStringMessage() : QProtobufMessage(&SimpleStringMessage::staticMetaObject) SimpleStringMessage::SimpleStringMessage() : QProtobufMessage(&SimpleStringMessage::staticMetaObject)
{ {
} }
SimpleStringMessage::SimpleStringMessage(const SimpleStringMessage &other) : QProtobufMessage(other) SimpleStringMessage::SimpleStringMessage(const SimpleStringMessage &other) : QProtobufMessage(other),
m_testFieldString(other.m_testFieldString)
{ {
setTestFieldString(other.m_testFieldString);
} }
SimpleStringMessage &SimpleStringMessage::operator =(const SimpleStringMessage &other) SimpleStringMessage &SimpleStringMessage::operator =(const SimpleStringMessage &other)
{ {
@ -136,9 +136,9 @@ SimpleIntMessage::SimpleIntMessage() : QProtobufMessage(&SimpleIntMessage::stati
m_testField(0) m_testField(0)
{ {
} }
SimpleIntMessage::SimpleIntMessage(const SimpleIntMessage &other) : QProtobufMessage(other) SimpleIntMessage::SimpleIntMessage(const SimpleIntMessage &other) : QProtobufMessage(other),
m_testField(other.m_testField)
{ {
setTestField(other.m_testField);
} }
SimpleIntMessage &SimpleIntMessage::operator =(const SimpleIntMessage &other) SimpleIntMessage &SimpleIntMessage::operator =(const SimpleIntMessage &other)
{ {
@ -213,9 +213,9 @@ void BlobMessage::registerTypes()
BlobMessage::BlobMessage() : QProtobufMessage(&BlobMessage::staticMetaObject) BlobMessage::BlobMessage() : QProtobufMessage(&BlobMessage::staticMetaObject)
{ {
} }
BlobMessage::BlobMessage(const BlobMessage &other) : QProtobufMessage(other) BlobMessage::BlobMessage(const BlobMessage &other) : QProtobufMessage(other),
m_testBytes(other.m_testBytes)
{ {
setTestBytes(other.m_testBytes);
} }
BlobMessage &BlobMessage::operator =(const BlobMessage &other) BlobMessage &BlobMessage::operator =(const BlobMessage &other)
{ {

View File

@ -38,7 +38,7 @@ public:
Q_ENUM(QtProtobufFieldEnum) Q_ENUM(QtProtobufFieldEnum)
SimpleStringMessage(); SimpleStringMessage();
~SimpleStringMessage() override; ~SimpleStringMessage();
SimpleStringMessage(const SimpleStringMessage &other); SimpleStringMessage(const SimpleStringMessage &other);
SimpleStringMessage &operator =(const SimpleStringMessage &other); SimpleStringMessage &operator =(const SimpleStringMessage &other);
SimpleStringMessage(SimpleStringMessage &&other) noexcept; SimpleStringMessage(SimpleStringMessage &&other) noexcept;
@ -72,7 +72,7 @@ public:
Q_ENUM(QtProtobufFieldEnum) Q_ENUM(QtProtobufFieldEnum)
SimpleIntMessage(); SimpleIntMessage();
~SimpleIntMessage() override; ~SimpleIntMessage();
SimpleIntMessage(const SimpleIntMessage &other); SimpleIntMessage(const SimpleIntMessage &other);
SimpleIntMessage &operator =(const SimpleIntMessage &other); SimpleIntMessage &operator =(const SimpleIntMessage &other);
SimpleIntMessage(SimpleIntMessage &&other) noexcept; SimpleIntMessage(SimpleIntMessage &&other) noexcept;
@ -110,7 +110,7 @@ public:
Q_ENUM(QtProtobufFieldEnum) Q_ENUM(QtProtobufFieldEnum)
BlobMessage(); BlobMessage();
~BlobMessage() override; ~BlobMessage();
BlobMessage(const BlobMessage &other); BlobMessage(const BlobMessage &other);
BlobMessage &operator =(const BlobMessage &other); BlobMessage &operator =(const BlobMessage &other);
BlobMessage(BlobMessage &&other) noexcept; BlobMessage(BlobMessage &&other) noexcept;

View File

@ -12,6 +12,8 @@
#define DEFSTR(x) #x #define DEFSTR(x) #x
using namespace Qt::StringLiterals; using namespace Qt::StringLiterals;
const QLatin1StringView cppProtobufGenExtension(".qpb.cpp");
const QLatin1StringView headerProtobufGenExtension(".qpb.h");
const QLatin1StringView cppExtension("_client.grpc.qpb.cpp"); const QLatin1StringView cppExtension("_client.grpc.qpb.cpp");
const QLatin1StringView headerExtension("_client.grpc.qpb.h"); const QLatin1StringView headerExtension("_client.grpc.qpb.h");
const QLatin1StringView grpcGenQtprotobufKey(" --plugin=protoc-gen-qtgrpc="); const QLatin1StringView grpcGenQtprotobufKey(" --plugin=protoc-gen-qtgrpc=");
@ -185,7 +187,10 @@ void tst_qtgrpcgen::cmakeGeneratedFile_data()
QTest::addColumn<QString>("folder"); QTest::addColumn<QString>("folder");
QTest::addColumn<QString>("extension"); QTest::addColumn<QString>("extension");
const QLatin1StringView extensions[] = { cppExtension, headerExtension }; const QLatin1StringView extensions[] = { cppProtobufGenExtension,
headerProtobufGenExtension,
cppExtension,
headerExtension };
for (const auto extension : extensions) { for (const auto extension : extensions) {
QTest::addRow("testservice%s", extension.data()) QTest::addRow("testservice%s", extension.data())