summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2023-02-13 11:58:29 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-02-16 15:06:20 +0000
commit1bfc594c44b2e303ebd2f40eb1d402131689ccd8 (patch)
tree2caaaf58359e385712438677ece9cc970e961222
parentcbc8780b8aba69f09c7562550a8332bd66db20f7 (diff)
Rename Error enums for QCanFrameProcessor & QCanDbcFileParser
This change is only applied to new API introduced to Qt 6.5. The new names reflect the fact that scoped enums already state the word "Error" in their "scope" due to their explicit C++ naming. Change-Id: Ie7e4e0f5450f6ee19da537dc936c6024853979f6 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 3e55105068f02613bf687ed61e4bd12eab603c81) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/serialbus/qcandbcfileparser.cpp16
-rw-r--r--src/serialbus/qcandbcfileparser.h6
-rw-r--r--src/serialbus/qcandbcfileparser_p.h2
-rw-r--r--src/serialbus/qcanframeprocessor.cpp22
-rw-r--r--src/serialbus/qcanframeprocessor.h6
-rw-r--r--src/serialbus/qcanframeprocessor_p.h2
-rw-r--r--tests/auto/qcandbcfileparser/tst_qcandbcfileparser.cpp50
-rw-r--r--tests/auto/qcanframeprocessor/tst_qcanframeprocessor.cpp30
8 files changed, 67 insertions, 67 deletions
diff --git a/src/serialbus/qcandbcfileparser.cpp b/src/serialbus/qcandbcfileparser.cpp
index df7e0fa..7733c37 100644
--- a/src/serialbus/qcandbcfileparser.cpp
+++ b/src/serialbus/qcandbcfileparser.cpp
@@ -38,7 +38,7 @@ QT_BEGIN_NAMESPACE
Call the \l error() method to get the error which occurred during the
parsing. If the parsing completes successfully, this method will return
- \l {QCanDbcFileParser::}{NoError}. Otherwise, you can use an
+ \l {QCanDbcFileParser::}{None}. Otherwise, you can use an
\l errorString() method to get the string representation of an error.
During the parsing some non-critical problems may occur as well. Such
@@ -128,9 +128,9 @@ QT_BEGIN_NAMESPACE
This enum represents the possible errors that can happen during the parsing
of a DBC file.
- \value NoError No error occurred.
- \value FileReadError An error occurred while opening or reading the file.
- \value ParseError An error occurred while parsing the content of the file.
+ \value None No error occurred.
+ \value FileReading An error occurred while opening or reading the file.
+ \value Parsing An error occurred while parsing the content of the file.
*/
/*!
@@ -311,7 +311,7 @@ static constexpr auto kCharStrRegExp = "((?![\\\"\\\\])[\x20-\x7e])*"_L1;
void QCanDbcFileParserPrivate::reset()
{
m_fileName.clear();
- m_error = QCanDbcFileParser::Error::NoError;
+ m_error = QCanDbcFileParser::Error::None;
m_errorString.clear();
m_warnings.clear();
m_lineOffset = 0;
@@ -331,7 +331,7 @@ bool QCanDbcFileParserPrivate::parseFile(const QString &fileName)
{
QFile f(fileName);
if (!f.open(QIODevice::ReadOnly)) {
- m_error = QCanDbcFileParser::Error::FileReadError;
+ m_error = QCanDbcFileParser::Error::FileReading;
m_errorString = f.errorString();
return false;
}
@@ -362,7 +362,7 @@ bool QCanDbcFileParserPrivate::processLine(const QStringView line)
if (data.startsWith(kMessageDef)) {
if (m_seenExtraData) {
// Unexpected position of message description
- m_error = QCanDbcFileParser::Error::ParseError;
+ m_error = QCanDbcFileParser::Error::Parsing;
m_errorString = QObject::tr("Failed to parse file %1. Unexpected position "
"of %2 section.").arg(m_fileName, kMessageDef);
return false;
@@ -377,7 +377,7 @@ bool QCanDbcFileParserPrivate::processLine(const QStringView line)
while (data.startsWith(kSignalDef)) {
if (!m_isProcessingMessage || m_seenExtraData) {
// Unexpected position of signal description
- m_error = QCanDbcFileParser::Error::ParseError;
+ m_error = QCanDbcFileParser::Error::Parsing;
m_errorString = QObject::tr("Failed to parse file %1. Unexpected position "
"of %2 section.").arg(m_fileName, kSignalDef);
return false;
diff --git a/src/serialbus/qcandbcfileparser.h b/src/serialbus/qcandbcfileparser.h
index 782c290..c279264 100644
--- a/src/serialbus/qcandbcfileparser.h
+++ b/src/serialbus/qcandbcfileparser.h
@@ -21,9 +21,9 @@ class QCanDbcFileParser
{
public:
enum class Error : quint8 {
- NoError = 0,
- FileReadError,
- ParseError
+ None = 0,
+ FileReading,
+ Parsing
};
// The DBC protocol uses unsigned_integer to describe the supported values.
diff --git a/src/serialbus/qcandbcfileparser_p.h b/src/serialbus/qcandbcfileparser_p.h
index 6381b39..90c763f 100644
--- a/src/serialbus/qcandbcfileparser_p.h
+++ b/src/serialbus/qcandbcfileparser_p.h
@@ -46,7 +46,7 @@ public:
QList<QCanMessageDescription> getMessages() const;
QString m_fileName;
- QCanDbcFileParser::Error m_error = QCanDbcFileParser::Error::NoError;
+ QCanDbcFileParser::Error m_error = QCanDbcFileParser::Error::None;
QString m_errorString;
QStringList m_warnings;
qsizetype m_lineOffset = 0;
diff --git a/src/serialbus/qcanframeprocessor.cpp b/src/serialbus/qcanframeprocessor.cpp
index 2a98496..72c2550 100644
--- a/src/serialbus/qcanframeprocessor.cpp
+++ b/src/serialbus/qcanframeprocessor.cpp
@@ -111,14 +111,14 @@ static quint16 extractMaxBitNum(quint16 startBit, quint16 bitLength, QSysInfo::E
This enum represents the possible errors that can occur while
encoding or decoding the \l QCanBusFrame.
- \value NoError No error occurred.
+ \value None No error occurred.
\value InvalidFrame The received frame is invalid and cannot be parsed.
\value UnsupportedFrameFormat The format of the received frame is not
supported and cannot be parsed.
- \value DecodingError An error occurred during decoding. Use
+ \value Decoding An error occurred during decoding. Use
\l errorString() to get a string representation
of the error.
- \value EncodingError An error occurred during encoding. Use
+ \value Encoding An error occurred during encoding. Use
\l errorString() to get a string representation
of the error.
*/
@@ -195,13 +195,13 @@ QCanBusFrame QCanFrameProcessor::prepareFrame(QtCanBus::UniqueId uniqueId,
d->resetErrors();
if (!d->uidDescription.isValid()) {
- d->setError(Error::EncodingError,
+ d->setError(Error::Encoding,
QObject::tr("No valid unique identifier description is specified."));
return QCanBusFrame(QCanBusFrame::InvalidFrame);
}
if (!d->messages.contains(uniqueId)) {
- d->setError(Error::EncodingError,
+ d->setError(Error::Encoding,
QObject::tr("Failed to find message description for unique id %1.").
arg(qToUnderlying(uniqueId)));
return QCanBusFrame(QCanBusFrame::InvalidFrame);
@@ -218,7 +218,7 @@ QCanBusFrame QCanFrameProcessor::prepareFrame(QtCanBus::UniqueId uniqueId,
unsigned char *data = uidInPayload ? reinterpret_cast<unsigned char *>(payload.data())
: reinterpret_cast<unsigned char *>(&canFrameId);
if (!d->fillUniqueId(data, bitsSize, uniqueId)) {
- d->setError(Error::EncodingError,
+ d->setError(Error::Encoding,
QObject::tr("Failed to encode unique id %1 into the frame").
arg(qToUnderlying(uniqueId)));
return QCanBusFrame(QCanBusFrame::InvalidFrame);
@@ -446,21 +446,21 @@ QCanFrameProcessor::ParseResult QCanFrameProcessor::parseFrame(const QCanBusFram
return {};
}
if (!d->uidDescription.isValid()) {
- d->setError(Error::DecodingError,
+ d->setError(Error::Decoding,
QObject::tr("No valid unique identifier description is specified."));
return {};
}
const auto uidOpt = d->extractUniqueId(frame);
if (!uidOpt.has_value()) {
- d->setError(Error::DecodingError,
+ d->setError(Error::Decoding,
QObject::tr("Failed to extract unique id from the frame."));
return {};
}
const auto uniqueId = uidOpt.value();
if (!d->messages.contains(uniqueId)) {
- d->setError(Error::DecodingError,
+ d->setError(Error::Decoding,
QObject::tr("Could not find a message description for unique id %1.").
arg(qToUnderlying(uniqueId)));
return {};
@@ -468,7 +468,7 @@ QCanFrameProcessor::ParseResult QCanFrameProcessor::parseFrame(const QCanBusFram
const auto message = d->messages.value(uniqueId);
if (message.size() != frame.payload().size()) {
- d->setError(Error::DecodingError,
+ d->setError(Error::Decoding,
QObject::tr("Payload size does not match message description. "
"Actual size = %1, expected size = %2.").
arg(frame.payload().size()).arg(message.size()));
@@ -538,7 +538,7 @@ QCanFrameProcessor::ParseResult QCanFrameProcessor::parseFrame(const QCanBusFram
void QCanFrameProcessorPrivate::resetErrors()
{
- error = QCanFrameProcessor::Error::NoError;
+ error = QCanFrameProcessor::Error::None;
errorString.clear();
warnings.clear();
}
diff --git a/src/serialbus/qcanframeprocessor.h b/src/serialbus/qcanframeprocessor.h
index ef5c552..bdfbde0 100644
--- a/src/serialbus/qcanframeprocessor.h
+++ b/src/serialbus/qcanframeprocessor.h
@@ -22,11 +22,11 @@ class QCanFrameProcessor
{
public:
enum class Error : quint8 {
- NoError = 0,
+ None = 0,
InvalidFrame,
UnsupportedFrameFormat,
- DecodingError,
- EncodingError,
+ Decoding,
+ Encoding,
};
struct ParseResult {
diff --git a/src/serialbus/qcanframeprocessor_p.h b/src/serialbus/qcanframeprocessor_p.h
index 361a726..cd01be2 100644
--- a/src/serialbus/qcanframeprocessor_p.h
+++ b/src/serialbus/qcanframeprocessor_p.h
@@ -42,7 +42,7 @@ public:
static QCanFrameProcessorPrivate *get(const QCanFrameProcessor &processor);
- QCanFrameProcessor::Error error = QCanFrameProcessor::Error::NoError;
+ QCanFrameProcessor::Error error = QCanFrameProcessor::Error::None;
QString errorString;
QStringList warnings;
QHash<QtCanBus::UniqueId, QCanMessageDescription> messages;
diff --git a/tests/auto/qcandbcfileparser/tst_qcandbcfileparser.cpp b/tests/auto/qcandbcfileparser/tst_qcandbcfileparser.cpp
index 9f859f3..feeaa08 100644
--- a/tests/auto/qcandbcfileparser/tst_qcandbcfileparser.cpp
+++ b/tests/auto/qcandbcfileparser/tst_qcandbcfileparser.cpp
@@ -39,7 +39,7 @@ void tst_QCanDbcFileParser::initTestCase()
void tst_QCanDbcFileParser::construct()
{
QCanDbcFileParser parser;
- QCOMPARE(parser.error(), QCanDbcFileParser::Error::NoError);
+ QCOMPARE(parser.error(), QCanDbcFileParser::Error::None);
QVERIFY(parser.errorString().isEmpty());
QVERIFY(parser.warnings().isEmpty());
QVERIFY(parser.messageDescriptions().isEmpty());
@@ -75,7 +75,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("invalid filename")
<< QStringList{ u"nonexisting_file.dbc"_s }
- << QCanDbcFileParser::Error::FileReadError << errorDesc
+ << QCanDbcFileParser::Error::FileReading << errorDesc
<< QStringList() << QList<QCanMessageDescription>();
}
@@ -88,7 +88,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("invalid message definitions")
<< QStringList{ u"invalid_messages.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< expectedWarnings
<< QList<QCanMessageDescription>();
@@ -126,7 +126,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("invalid signal definitions")
<< QStringList{ u"invalid_signals.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< expectedWarnings
<< QList<QCanMessageDescription>();
@@ -175,7 +175,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("different signal names")
<< QStringList{ u"signal_names.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< expectedWarnings << descriptions;
}
@@ -205,7 +205,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("valid message and signals")
<< QStringList{ u"valid_message_and_signals.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< QStringList() << descriptions;
}
@@ -237,7 +237,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("different endian")
<< QStringList{ u"different_endian.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< QStringList() << descriptions;
}
@@ -286,7 +286,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("different data types")
<< QStringList{ u"different_data_types.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< QStringList() << descriptions;
}
@@ -342,7 +342,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("different factor and offset")
<< QStringList{ u"different_factor_offset.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< QStringList() << descriptions;
}
@@ -398,7 +398,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("different ranges")
<< QStringList{ u"different_ranges.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< QStringList() << descriptions;
}
@@ -439,7 +439,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("multiple receivers")
<< QStringList{ u"multiple_receivers.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< QStringList() << descriptions;
}
@@ -488,7 +488,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("message and signals in one line")
<< QStringList{ u"message_signals_in_one_line.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< QStringList() << descriptions;
}
@@ -530,7 +530,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("random whitespaces")
<< QStringList{ u"random_whitespaces.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< QStringList() << descriptions;
}
@@ -578,7 +578,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("comments processing")
<< QStringList{ u"messages_with_comments.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< QStringList() << descriptions;
messageDesc.setComment("");
@@ -637,7 +637,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("simple multiplexing")
<< QStringList{ u"simple_multiplexing.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< expectedWarnings << descriptions;
}
@@ -726,7 +726,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("extended multiplexing")
<< QStringList{ u"extended_multiplexing.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< expectedWarnings << descriptions;
}
@@ -760,7 +760,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("char string test")
<< QStringList{ u"char_string_test.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< expectedWarnings << descriptions;
}
@@ -771,7 +771,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("invalid message desc pos")
<< QStringList{ fileName }
- << QCanDbcFileParser::Error::ParseError << expectedError
+ << QCanDbcFileParser::Error::Parsing << expectedError
<< QStringList() << QList<QCanMessageDescription>();
}
@@ -782,7 +782,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("invalid signal desc pos")
<< QStringList{ fileName }
- << QCanDbcFileParser::Error::ParseError << expectedError
+ << QCanDbcFileParser::Error::Parsing << expectedError
<< QStringList() << QList<QCanMessageDescription>();
}
@@ -876,7 +876,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("multiple files")
<< QStringList{ u"multiple_files_1.dbc"_s, u"multiple_files_2.dbc"_s }
- << QCanDbcFileParser::Error::NoError << QString()
+ << QCanDbcFileParser::Error::None << QString()
<< expectedWarnings << descriptions;
}
@@ -887,7 +887,7 @@ void tst_QCanDbcFileParser::parseFile_data()
QTest::addRow("multiple files and error")
<< QStringList{ u"multiple_files_1.dbc"_s, fileName }
- << QCanDbcFileParser::Error::ParseError << expectedError
+ << QCanDbcFileParser::Error::Parsing << expectedError
<< QStringList() << QList<QCanMessageDescription>();
}
}
@@ -914,7 +914,7 @@ void tst_QCanDbcFileParser::parseFile()
QCOMPARE_EQ(parser.error(), expectedError);
QCOMPARE_EQ(parser.errorString(), expectedErrorDescription);
- if (expectedError != QCanDbcFileParser::Error::NoError)
+ if (expectedError != QCanDbcFileParser::Error::None)
return; // no need to compare other data if we already had an error
// Some warnings may come in unspecified order, so sort them before
@@ -985,7 +985,7 @@ void tst_QCanDbcFileParser::valueDescriptions()
const QString fileName = u"value_descriptions.dbc"_s;
QCanDbcFileParser parser;
parser.parse(m_filesDir + fileName);
- QCOMPARE(parser.error(), QCanDbcFileParser::Error::NoError);
+ QCOMPARE(parser.error(), QCanDbcFileParser::Error::None);
QCOMPARE(parser.messageValueDescriptions(), expectedDescriptions);
QCOMPARE(parser.warnings(), expectedWarnings);
@@ -998,7 +998,7 @@ void tst_QCanDbcFileParser::resetState()
QCanDbcFileParser parser;
parser.parse(m_filesDir + fileName);
- QCOMPARE(parser.error(), QCanDbcFileParser::Error::NoError);
+ QCOMPARE(parser.error(), QCanDbcFileParser::Error::None);
QVERIFY(!parser.messageDescriptions().isEmpty());
QVERIFY(!parser.warnings().isEmpty());
QVERIFY(!parser.messageValueDescriptions().isEmpty());
@@ -1007,7 +1007,7 @@ void tst_QCanDbcFileParser::resetState()
// other getters should return default values
const QString invalidName = u"invalid_file"_s;
parser.parse(m_filesDir + invalidName);
- QCOMPARE(parser.error(), QCanDbcFileParser::Error::FileReadError);
+ QCOMPARE(parser.error(), QCanDbcFileParser::Error::FileReading);
QVERIFY(parser.messageDescriptions().isEmpty());
QVERIFY(parser.warnings().isEmpty());
QVERIFY(parser.messageValueDescriptions().isEmpty());
diff --git a/tests/auto/qcanframeprocessor/tst_qcanframeprocessor.cpp b/tests/auto/qcanframeprocessor/tst_qcanframeprocessor.cpp
index f547b7e..6de5389 100644
--- a/tests/auto/qcanframeprocessor/tst_qcanframeprocessor.cpp
+++ b/tests/auto/qcanframeprocessor/tst_qcanframeprocessor.cpp
@@ -66,7 +66,7 @@ void tst_QCanFrameProcessor::construct()
QCanFrameProcessor p;
QVERIFY(p.messageDescriptions().isEmpty());
- QCOMPARE(p.error(), QCanFrameProcessor::Error::NoError);
+ QCOMPARE(p.error(), QCanFrameProcessor::Error::None);
QVERIFY(p.errorString().isEmpty());
QVERIFY(p.warnings().isEmpty());
QVERIFY(!p.uniqueIdDescription().isValid());
@@ -761,7 +761,7 @@ void tst_QCanFrameProcessor::parseWithErrorsAndWarnings_data()
QTest::addRow("No UID description")
<< QCanMessageDescription() << QCanUniqueIdDescription()
<< QCanBusFrame(123, QByteArray(2, 0x01))
- << QCanFrameProcessor::Error::DecodingError
+ << QCanFrameProcessor::Error::Decoding
<< tr("No valid unique identifier description is specified.")
<< QStringList() << QtCanBus::UniqueId(0) << QVariantMap();
@@ -773,7 +773,7 @@ void tst_QCanFrameProcessor::parseWithErrorsAndWarnings_data()
QTest::addRow("UID extraction failed")
<< QCanMessageDescription() << uidDesc
<< QCanBusFrame(123, QByteArray(2, 0x01))
- << QCanFrameProcessor::Error::DecodingError
+ << QCanFrameProcessor::Error::Decoding
<< tr("Failed to extract unique id from the frame.")
<< QStringList() << QtCanBus::UniqueId(0) << QVariantMap();
@@ -783,7 +783,7 @@ void tst_QCanFrameProcessor::parseWithErrorsAndWarnings_data()
QTest::addRow("Unknown unique id")
<< QCanMessageDescription() << uidDesc
<< QCanBusFrame(123, QByteArray(8, 0x01))
- << QCanFrameProcessor::Error::DecodingError
+ << QCanFrameProcessor::Error::Decoding
<< tr("Could not find a message description for unique id 123.")
<< QStringList() << QtCanBus::UniqueId(0) << QVariantMap();
@@ -801,7 +801,7 @@ void tst_QCanFrameProcessor::parseWithErrorsAndWarnings_data()
QTest::addRow("Invalid payload size")
<< messageDesc << uidDesc
<< QCanBusFrame(123, QByteArray(8, 0x01))
- << QCanFrameProcessor::Error::DecodingError
+ << QCanFrameProcessor::Error::Decoding
<< tr("Payload size does not match message description. "
"Actual size = 8, expected size = 2.")
<< QStringList()
@@ -824,7 +824,7 @@ void tst_QCanFrameProcessor::parseWithErrorsAndWarnings_data()
// Invalid signal skipped, and we still get results from other signals
QTest::addRow("invalid signal desc warning")
<< messageDesc << uidDesc << QCanBusFrame(123, QByteArray(8, 0x01))
- << QCanFrameProcessor::Error::NoError << QString()
+ << QCanFrameProcessor::Error::None << QString()
<< expectedWarnings << QtCanBus::UniqueId(123)
<< QVariantMap({ qMakePair("s0", 0x0101) });
@@ -848,7 +848,7 @@ void tst_QCanFrameProcessor::parseWithErrorsAndWarnings_data()
// Two invalid signals skipped, two valid results are received
QTest::addRow("invalid signal desc warning")
<< messageDesc << uidDesc << QCanBusFrame(123, QByteArray(8, 0x01))
- << QCanFrameProcessor::Error::NoError << QString()
+ << QCanFrameProcessor::Error::None << QString()
<< expectedWarnings << QtCanBus::UniqueId(123)
<< QVariantMap({ qMakePair("s0", 0x0101), qMakePair("s1", 0x01) });
}
@@ -1588,7 +1588,7 @@ void tst_QCanFrameProcessor::prepareWithErrorsAndWarnings_data()
QTest::addRow("no UID description")
<< QCanMessageDescription() << QCanUniqueIdDescription()
<< QtCanBus::UniqueId(0) << QVariantMap()
- << QCanFrameProcessor::Error::EncodingError
+ << QCanFrameProcessor::Error::Encoding
<< tr("No valid unique identifier description is specified.")
<< QStringList() << QCanBusFrame::FrameId(0) << QByteArray();
@@ -1597,7 +1597,7 @@ void tst_QCanFrameProcessor::prepareWithErrorsAndWarnings_data()
QTest::addRow("no message description")
<< QCanMessageDescription() << uidDesc << QtCanBus::UniqueId(123)
- << QVariantMap() << QCanFrameProcessor::Error::EncodingError
+ << QVariantMap() << QCanFrameProcessor::Error::Encoding
<< tr("Failed to find message description for unique id 123.")
<< QStringList() << QCanBusFrame::FrameId(0) << QByteArray();
@@ -1617,7 +1617,7 @@ void tst_QCanFrameProcessor::prepareWithErrorsAndWarnings_data()
QTest::addRow("set UID fail")
<< messageDesc << uidDesc << messageDesc.uniqueId()
- << QVariantMap() << QCanFrameProcessor::Error::EncodingError
+ << QVariantMap() << QCanFrameProcessor::Error::Encoding
<< tr("Failed to encode unique id 123 into the frame")
<< QStringList() << QCanBusFrame::FrameId(0) << QByteArray();
@@ -1631,7 +1631,7 @@ void tst_QCanFrameProcessor::prepareWithErrorsAndWarnings_data()
QTest::addRow("no signal description")
<< messageDesc << uidDesc << messageDesc.uniqueId()
<< QVariantMap({ qMakePair("s0", 1), qMakePair("s1", 2) })
- << QCanFrameProcessor::Error::NoError << QString()
+ << QCanFrameProcessor::Error::None << QString()
<< warnings << QCanBusFrame::FrameId(messageDesc.uniqueId())
<< QByteArray::fromHex("0100");
@@ -1647,7 +1647,7 @@ void tst_QCanFrameProcessor::prepareWithErrorsAndWarnings_data()
QTest::addRow("invalid signal description")
<< messageDesc << uidDesc << messageDesc.uniqueId()
<< QVariantMap({ qMakePair("s0", 1), qMakePair("s1", 2), qMakePair("s2", 3) })
- << QCanFrameProcessor::Error::NoError << QString()
+ << QCanFrameProcessor::Error::None << QString()
<< warnings << QCanBusFrame::FrameId(messageDesc.uniqueId())
<< QByteArray::fromHex("0100");
@@ -1664,7 +1664,7 @@ void tst_QCanFrameProcessor::prepareWithErrorsAndWarnings_data()
<< messageDesc << uidDesc << messageDesc.uniqueId()
<< QVariantMap({ qMakePair("s0", 1), qMakePair("s1", 2),
qMakePair("s2", 3), qMakePair("s3", 4) })
- << QCanFrameProcessor::Error::NoError << QString()
+ << QCanFrameProcessor::Error::None << QString()
<< warnings << QCanBusFrame::FrameId(messageDesc.uniqueId())
<< QByteArray::fromHex("0100");
@@ -1723,7 +1723,7 @@ void tst_QCanFrameProcessor::prepareWithErrorsAndWarnings_data()
<< messageDesc << uidDesc << messageDesc.uniqueId()
<< QVariantMap({ qMakePair("s0", 1), qMakePair("s1", 10), qMakePair("s2", 2),
qMakePair("s3", 5), qMakePair("s4", 6) })
- << QCanFrameProcessor::Error::NoError << QString()
+ << QCanFrameProcessor::Error::None << QString()
<< warnings << QCanBusFrame::FrameId(messageDesc.uniqueId())
<< QByteArray::fromHex("1205");
}
@@ -1860,7 +1860,7 @@ void tst_QCanFrameProcessor::prepareUniqueId()
processor.setMessageDescriptions({ messageDescription });
const auto result = processor.prepareFrame(uniqueId, signalValues);
- QCOMPARE(processor.error(), QCanFrameProcessor::Error::NoError);
+ QCOMPARE(processor.error(), QCanFrameProcessor::Error::None);
QCOMPARE(result.frameId(), expectedFrame.frameId());
QCOMPARE(result.payload(), expectedFrame.payload());
}