diff options
Diffstat (limited to 'academic/labplot2/p2.patch')
-rw-r--r-- | academic/labplot2/p2.patch | 875 |
1 files changed, 875 insertions, 0 deletions
diff --git a/academic/labplot2/p2.patch b/academic/labplot2/p2.patch new file mode 100644 index 0000000000000..51a58d97b1a2e --- /dev/null +++ b/academic/labplot2/p2.patch @@ -0,0 +1,875 @@ +--- BLFFilterTest.cpp 2023-03-18 18:11:03.000000000 -0300 ++++ BLFFilterTest.cpp.new 2023-04-17 19:04:26.304237377 -0300 +@@ -1,12 +1,12 @@ + /* +- File : BLFFilterTest.cpp ++ F ile : B*LFFilterTest.cpp + Project : LabPlot + Description : Tests for the BLF Filter + -------------------------------------------------------------------- + SPDX-FileCopyrightText: 2023 Martin Marmsoler <martin.marmsoler@gmail.com> + + SPDX-License-Identifier: GPL-2.0-or-later +-*/ ++ */ + + #include "BLFFilterTest.h" + #include "backend/datasources/filters/CANFilterPrivate.h" +@@ -15,10 +15,12 @@ + #include "qtestcase.h" + #include <math.h> + ++#ifdef HAVE_VECTOR_BLF ++ + #include <Vector/BLF.h> + + static const std::string PRIMITIVE_DBC = +- R"(VERSION "1.0.0" ++R"(VERSION "1.0.0" + + NS_ : + +@@ -101,20 +103,20 @@ + QTemporaryFile dbcFile(QStringLiteral("XXXXXX.dbc")); + QVERIFY(dbcFile.open()); + const auto dbcContent = R"(BO_ 234 MSG1: 8 Vector__XXX +-SG_ Sig1 : 0|8@0- (0.1,0) [-3276.8|-3276.7] "C" Vector__XXX +-SG_ Sig2 : 8|8@0- (0.1,0) [-3276.8|-3276.7] "C" Vector__XXX +-)"; +- createDBCFile(dbcFile.fileName(), dbcContent); +- +- // Start Test +- +- VectorBLFFilter filter; +- QCOMPARE(filter.isValid(blfFileName.fileName()), true); +- +- // File is valid, but dbc file not +- Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); +- filter.readDataFromFile(blfFileName.fileName(), &s); +- QCOMPARE(s.columnCount(), 2); // column count not changed means no data was added ++ SG_ Sig1 : 0|8@0- (0.1,0) [-3276.8|-3276.7] "C" Vector__XXX ++ SG_ Sig2 : 8|8@0- (0.1,0) [-3276.8|-3276.7] "C" Vector__XXX ++ )"; ++createDBCFile(dbcFile.fileName(), dbcContent); ++ ++// Start Test ++ ++VectorBLFFilter filter; ++QCOMPARE(filter.isValid(blfFileName.fileName()), true); ++ ++// File is valid, but dbc file not ++Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); ++filter.readDataFromFile(blfFileName.fileName(), &s); ++QCOMPARE(s.columnCount(), 2); // column count not changed means no data was added + } + + void BLFFilterTest::testValidBLFValidDBCSingleMessageBigEndian() { +@@ -130,40 +132,40 @@ + const auto dbcContent = R"(BO_ 234 MSG1: 8 Vector__XXX + SG_ Sig1 : 7|8@0- (0.1,0) [-3276.8|-3276.7] "C" Vector__XXX + SG_ Sig2 : 15|8@0- (0.1,0) [-3276.8|-3276.7] "C" Vector__XXX +-)"; +- createDBCFile(dbcFile.fileName(), dbcContent); ++ )"; ++createDBCFile(dbcFile.fileName(), dbcContent); + +- // Start Test ++// Start Test + +- VectorBLFFilter filter; +- QCOMPARE(filter.isValid(blfFileName.fileName()), true); ++VectorBLFFilter filter; ++QCOMPARE(filter.isValid(blfFileName.fileName()), true); + +- // Valid blf and valid dbc +- filter.setDBCFile(dbcFile.fileName()); +- Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); +- filter.readDataFromFile(blfFileName.fileName(), &s); +- QCOMPARE(s.columnCount(), 3); // time + Sig1 + Sig2 ++// Valid blf and valid dbc ++filter.setDBCFile(dbcFile.fileName()); ++Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); ++filter.readDataFromFile(blfFileName.fileName(), &s); ++QCOMPARE(s.columnCount(), 3); // time + Sig1 + Sig2 + +- { ++{ + // Time + const auto* c = s.column(0); + QCOMPARE(c->rowCount(), 1); + QCOMPARE(c->valueAt(0), 5e-9); // nanoseconds +- } ++} + +- { ++{ + // Sig1 + const auto* c = s.column(1); + QCOMPARE(c->rowCount(), 1); + QCOMPARE(c->valueAt(0), 0x01 * 0.1); +- } ++} + +- { ++{ + // Sig2 + const auto* c = s.column(2); + QCOMPARE(c->rowCount(), 1); + QCOMPARE(c->valueAt(0), 0x02 * 0.1); +- } ++} + } + + // Use the previous value if there is no value at the current timestamp +@@ -188,24 +190,24 @@ + SG_ MSG1Sig2 : 23|16@0+ (0.1,0) [0|6553.5] "V" Vector__XXX + SG_ MSG1Sig3 : 55|16@0- (0.1,0) [0|0] "" Vector__XXX + SG_ MSG1Sig4 : 7|16@0+ (0.1,0) [0|6553.5] "V" Vector__XXX +-BO_ 565 MSG2: 8 Vector__XXX ++ BO_ 565 MSG2: 8 Vector__XXX + SG_ MSG2Sig1 : 55|16@0- (0.1,0) [0|0] "" Vector__XXX +-)"; +- createDBCFile(dbcFile.fileName(), dbcContent); ++ )"; ++createDBCFile(dbcFile.fileName(), dbcContent); + +- // Start Test ++// Start Test + +- VectorBLFFilter filter; +- filter.setTimeHandlingMode(CANFilter::TimeHandling::ConcatPrevious); +- QCOMPARE(filter.isValid(blfFileName.fileName()), true); +- +- // Valid blf and valid dbc +- filter.setDBCFile(dbcFile.fileName()); +- Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); +- filter.readDataFromFile(blfFileName.fileName(), &s); +- QCOMPARE(s.columnCount(), 6); // time + Msg1Sig1 + Msg1Sig2 + Msg1Sig3 + Msg1Sig4 + Msg2Sig1 ++VectorBLFFilter filter; ++filter.setTimeHandlingMode(CANFilter::TimeHandling::ConcatPrevious); ++QCOMPARE(filter.isValid(blfFileName.fileName()), true); ++ ++// Valid blf and valid dbc ++filter.setDBCFile(dbcFile.fileName()); ++Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); ++filter.readDataFromFile(blfFileName.fileName(), &s); ++QCOMPARE(s.columnCount(), 6); // time + Msg1Sig1 + Msg1Sig2 + Msg1Sig3 + Msg1Sig4 + Msg2Sig1 + +- { ++{ + const auto* c = s.column(0); + QCOMPARE(c->name(), QStringLiteral("Time_s")); + QCOMPARE(c->rowCount(), 6); +@@ -215,9 +217,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + const auto* c = s.column(1); + QCOMPARE(c->name(), QStringLiteral("MSG1Sig1_%")); + QCOMPARE(c->rowCount(), 6); +@@ -227,9 +229,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + const auto* c = s.column(2); + QCOMPARE(c->name(), QStringLiteral("MSG1Sig2_V")); + QCOMPARE(c->rowCount(), 6); +@@ -239,9 +241,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + const auto* c = s.column(3); + QCOMPARE(c->name(), QStringLiteral("MSG1Sig3_")); + QCOMPARE(c->rowCount(), 6); +@@ -251,9 +253,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + const auto* c = s.column(4); + QCOMPARE(c->name(), QStringLiteral("MSG1Sig4_V")); + QCOMPARE(c->rowCount(), 6); +@@ -263,9 +265,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + const auto* c = s.column(5); + QCOMPARE(c->name(), QStringLiteral("MSG2Sig1_")); + QCOMPARE(c->rowCount(), 6); +@@ -275,7 +277,7 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + } + + // Use NAN if the current message does not contain no value for the signal +@@ -298,26 +300,26 @@ + const auto dbcContent = R"(BO_ 234 MSG1: 8 Vector__XXX + SG_ Msg1Sig1 : 7|8@0+ (1,0) [-3276.8|-3276.7] "C" Vector__XXX + SG_ Msg1Sig2 : 15|8@0+ (1,0) [-3276.8|-3276.7] "km/h" Vector__XXX +-BO_ 123 MSG2: 8 Vector__XXX ++ BO_ 123 MSG2: 8 Vector__XXX + SG_ Msg2Sig1 : 7|8@0+ (1,0) [-3276.8|-3276.7] "mm" Vector__XXX + SG_ Msg2Sig2 : 15|8@0+ (1,0) [-3276.8|-3276.7] "m" Vector__XXX +-)"; +- createDBCFile(dbcFile.fileName(), dbcContent); ++ )"; ++createDBCFile(dbcFile.fileName(), dbcContent); + +- // Start Test ++// Start Test + +- VectorBLFFilter filter; +- filter.setConvertTimeToSeconds(true); +- filter.setTimeHandlingMode(CANFilter::TimeHandling::ConcatNAN); +- QCOMPARE(filter.isValid(blfFileName.fileName()), true); +- +- // Valid blf and valid dbc +- filter.setDBCFile(dbcFile.fileName()); +- Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); +- filter.readDataFromFile(blfFileName.fileName(), &s); +- QCOMPARE(s.columnCount(), 5); // time + Msg1Sig1 + Msg1Sig2 + Msg2Sig1 + Msg2Sig2 ++VectorBLFFilter filter; ++filter.setConvertTimeToSeconds(true); ++filter.setTimeHandlingMode(CANFilter::TimeHandling::ConcatNAN); ++QCOMPARE(filter.isValid(blfFileName.fileName()), true); ++ ++// Valid blf and valid dbc ++filter.setDBCFile(dbcFile.fileName()); ++Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); ++filter.readDataFromFile(blfFileName.fileName(), &s); ++QCOMPARE(s.columnCount(), 5); // time + Msg1Sig1 + Msg1Sig2 + Msg2Sig1 + Msg2Sig2 + +- { ++{ + // Time + const auto* c = s.column(0); + QCOMPARE(c->name(), QStringLiteral("Time_s")); +@@ -328,9 +330,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig1 + const auto* c = s.column(1); + QCOMPARE(c->name(), QStringLiteral("Msg1Sig1_C")); +@@ -341,9 +343,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig2 + const auto* c = s.column(2); + QCOMPARE(c->name(), QStringLiteral("Msg1Sig2_km/h")); +@@ -354,9 +356,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg2Sig1 + const auto* c = s.column(3); + QCOMPARE(c->name(), QStringLiteral("Msg2Sig1_mm")); +@@ -367,9 +369,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg2Sig2 + const auto* c = s.column(4); + QCOMPARE(c->name(), QStringLiteral("Msg2Sig2_m")); +@@ -380,7 +382,7 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + } + + void BLFFilterTest::testTimeNative() { +@@ -402,26 +404,26 @@ + const auto dbcContent = R"(BO_ 234 MSG1: 8 Vector__XXX + SG_ Msg1Sig1 : 0|8@0+ (1,0) [-3276.8|-3276.7] "C" Vector__XXX + SG_ Msg1Sig2 : 8|8@0+ (1,0) [-3276.8|-3276.7] "km/h" Vector__XXX +-BO_ 123 MSG2: 8 Vector__XXX ++ BO_ 123 MSG2: 8 Vector__XXX + SG_ Msg2Sig1 : 0|8@0+ (1,0) [-3276.8|-3276.7] "mm" Vector__XXX + SG_ Msg2Sig2 : 8|8@0+ (1,0) [-3276.8|-3276.7] "m" Vector__XXX +-)"; +- createDBCFile(dbcFile.fileName(), dbcContent); ++ )"; ++createDBCFile(dbcFile.fileName(), dbcContent); + +- // Start Test ++// Start Test + +- VectorBLFFilter filter; +- filter.setConvertTimeToSeconds(false); +- filter.setTimeHandlingMode(CANFilter::TimeHandling::ConcatNAN); +- QCOMPARE(filter.isValid(blfFileName.fileName()), true); +- +- // Valid blf and valid dbc +- filter.setDBCFile(dbcFile.fileName()); +- Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); +- filter.readDataFromFile(blfFileName.fileName(), &s); +- QCOMPARE(s.columnCount(), 5); // time + Msg1Sig1 + Msg1Sig2 + Msg2Sig1 + Msg2Sig2 ++VectorBLFFilter filter; ++filter.setConvertTimeToSeconds(false); ++filter.setTimeHandlingMode(CANFilter::TimeHandling::ConcatNAN); ++QCOMPARE(filter.isValid(blfFileName.fileName()), true); ++ ++// Valid blf and valid dbc ++filter.setDBCFile(dbcFile.fileName()); ++Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); ++filter.readDataFromFile(blfFileName.fileName(), &s); ++QCOMPARE(s.columnCount(), 5); // time + Msg1Sig1 + Msg1Sig2 + Msg2Sig1 + Msg2Sig2 + +- { ++{ + // Time + const auto* c = s.column(0); + QCOMPARE(c->name(), QStringLiteral("Time_ns")); +@@ -432,7 +434,7 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + } + + // Value5 is a value larger than one byte, but not exactly a multiple +@@ -457,92 +459,92 @@ + SG_ Value7 : 30|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ Value4 : 11|4@1+ (1,0) [0|3] "" Vector__XXX + SG_ Value1 : 0|8@1+ (1,0) [0|204] "Km/h" Vector__XXX +-)"; +- createDBCFile(dbcFile.fileName(), dbcContent); ++ )"; ++createDBCFile(dbcFile.fileName(), dbcContent); + +- // Start Test ++// Start Test + +- VectorBLFFilter filter; +- filter.setConvertTimeToSeconds(true); +- filter.setTimeHandlingMode(CANFilter::TimeHandling::ConcatNAN); +- QCOMPARE(filter.isValid(blfFileName.fileName()), true); +- +- // Valid blf and valid dbc +- filter.setDBCFile(dbcFile.fileName()); +- QCOMPARE(filter.d->readDataFromFile(blfFileName.fileName(), 4), 3); +- const auto dc = filter.dataContainer(); +- QCOMPARE(dc.size(), 8); // Time + 7 signals +- { ++VectorBLFFilter filter; ++filter.setConvertTimeToSeconds(true); ++filter.setTimeHandlingMode(CANFilter::TimeHandling::ConcatNAN); ++QCOMPARE(filter.isValid(blfFileName.fileName()), true); ++ ++// Valid blf and valid dbc ++filter.setDBCFile(dbcFile.fileName()); ++QCOMPARE(filter.d->readDataFromFile(blfFileName.fileName(), 4), 3); ++const auto dc = filter.dataContainer(); ++QCOMPARE(dc.size(), 8); // Time + 7 signals ++{ + // Time + const auto* v = static_cast<QVector<double>*>(dc.at(0)); + QCOMPARE(v->length(), 3); + QCOMPARE(v->at(0), 5e-9); + QCOMPARE(v->at(1), 10e-9); + QCOMPARE(v->at(2), 15e-9); +- } ++} + +- { ++{ + // Value6 + const auto* v = static_cast<QVector<double>*>(dc.at(1)); + QCOMPARE(v->length(), 3); + QCOMPARE(v->at(0), 2.); + QCOMPARE(v->at(1), 3.); + QCOMPARE(v->at(2), 3.); +- } ++} + +- { ++{ + // Value5 + const auto* v = static_cast<QVector<double>*>(dc.at(2)); + QCOMPARE(v->length(), 3); + QCOMPARE(v->at(0), 0.); + QCOMPARE(v->at(1), 32.); + QCOMPARE(v->at(2), 51.); +- } ++} + +- { ++{ + // Value2 + const auto* v = static_cast<QVector<double>*>(dc.at(3)); + QCOMPARE(v->length(), 3); + QCOMPARE(v->at(0), 0.); + QCOMPARE(v->at(1), 0.); + QCOMPARE(v->at(2), 0.); +- } ++} + +- { ++{ + // Value3 + const auto* v = static_cast<QVector<double>*>(dc.at(4)); + QCOMPARE(v->length(), 3); + QCOMPARE(v->at(0), 1.); + QCOMPARE(v->at(1), 1.); + QCOMPARE(v->at(2), 1.); +- } ++} + +- { ++{ + // Value7 + const auto* v = static_cast<QVector<double>*>(dc.at(5)); + QCOMPARE(v->length(), 3); + QCOMPARE(v->at(0), 0.); + QCOMPARE(v->at(1), 0.); + QCOMPARE(v->at(2), 0.); +- } ++} + +- { ++{ + // Value4 + const auto* v = static_cast<QVector<double>*>(dc.at(6)); + QCOMPARE(v->length(), 3); + QCOMPARE(v->at(0), 0.); + QCOMPARE(v->at(1), 0.); + QCOMPARE(v->at(2), 0.); +- } ++} + +- { ++{ + // Value1 + const auto* v = static_cast<QVector<double>*>(dc.at(7)); + QCOMPARE(v->length(), 3); + QCOMPARE(v->at(0), 0.); + QCOMPARE(v->at(1), 47.); + QCOMPARE(v->at(2), 57.); +- } ++} + } + + // Use NAN if the current message does not contain no value for the signal +@@ -568,28 +570,28 @@ + SG_ Value7 : 30|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ Value4 : 11|4@1+ (1,0) [0|3] "" Vector__XXX + SG_ Value1 : 0|8@1+ (1,0) [0|204] "Km/h" Vector__XXX" +-BO_ 541 MSG2: 8 Vector__XXX ++ BO_ 541 MSG2: 8 Vector__XXX + SG_ MSG2Value4 : 48|16@1+ (0.01,-40) [-40|125] "C" Vector__XXX + SG_ MSG2Value1 : 0|16@1+ (0.01,0) [0|100] "%" Vector__XXX + SG_ MSG2Value3 : 32|16@1+ (0.01,0) [0|100] "%" Vector__XXX + SG_ MSG2Value2 : 16|16@1+ (0.01,0) [0|100] "%" Vector__XXX +-)"; +- createDBCFile(dbcFile.fileName(), dbcContent); ++ )"; ++createDBCFile(dbcFile.fileName(), dbcContent); + +- // Start Test ++// Start Test + +- VectorBLFFilter filter; +- filter.setConvertTimeToSeconds(true); +- filter.setTimeHandlingMode(CANFilter::TimeHandling::ConcatNAN); +- QCOMPARE(filter.isValid(blfFileName.fileName()), true); +- +- // Valid blf and valid dbc +- filter.setDBCFile(dbcFile.fileName()); +- Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); +- filter.readDataFromFile(blfFileName.fileName(), &s); +- QCOMPARE(s.columnCount(), 12); // time + 7 * Msg1 + 4* Msg2 ++VectorBLFFilter filter; ++filter.setConvertTimeToSeconds(true); ++filter.setTimeHandlingMode(CANFilter::TimeHandling::ConcatNAN); ++QCOMPARE(filter.isValid(blfFileName.fileName()), true); ++ ++// Valid blf and valid dbc ++filter.setDBCFile(dbcFile.fileName()); ++Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); ++filter.readDataFromFile(blfFileName.fileName(), &s); ++QCOMPARE(s.columnCount(), 12); // time + 7 * Msg1 + 4* Msg2 + +- { ++{ + // Time + const auto* c = s.column(0); + QCOMPARE(c->name(), QStringLiteral("Time_s")); +@@ -600,9 +602,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig6 + const auto* c = s.column(1); + QCOMPARE(c->name(), QStringLiteral("Value6_")); +@@ -613,9 +615,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig5 + const auto* c = s.column(2); + QCOMPARE(c->name(), QStringLiteral("Value5_%")); +@@ -626,9 +628,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig2 + const auto* c = s.column(3); + QCOMPARE(c->name(), QStringLiteral("Value2_")); +@@ -639,9 +641,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig3 + const auto* c = s.column(4); + QCOMPARE(c->name(), QStringLiteral("Value3_")); +@@ -652,9 +654,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig7 + const auto* c = s.column(5); + QCOMPARE(c->name(), QStringLiteral("Value7_")); +@@ -665,9 +667,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg12Sig4 + const auto* c = s.column(6); + QCOMPARE(c->name(), QStringLiteral("Value4_")); +@@ -678,9 +680,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig1 + const auto* c = s.column(7); + QCOMPARE(c->name(), QStringLiteral("Value1_Km/h")); +@@ -691,9 +693,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg2Sig4 + const auto* c = s.column(8); + QCOMPARE(c->name(), QStringLiteral("MSG2Value4_C")); +@@ -704,9 +706,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + VALUES_EQUAL(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg2Sig1 + const auto* c = s.column(9); + QCOMPARE(c->name(), QStringLiteral("MSG2Value1_%")); +@@ -717,9 +719,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + VALUES_EQUAL(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg2Sig3 + const auto* c = s.column(10); + QCOMPARE(c->name(), QStringLiteral("MSG2Value3_%")); +@@ -730,9 +732,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + VALUES_EQUAL(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg2Sig2 + const auto* c = s.column(11); + QCOMPARE(c->name(), QStringLiteral("MSG2Value2_%")); +@@ -743,7 +745,7 @@ + for (int i = 0; i < c->rowCount(); i++) { + VALUES_EQUAL(c->valueAt(i), refData.at(i)); + } +- } ++} + } + + // Use previous value if the current message does not contain no value for the signal +@@ -769,28 +771,28 @@ + SG_ Value7 : 30|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ Value4 : 11|4@1+ (1,0) [0|3] "" Vector__XXX + SG_ Value1 : 0|8@1+ (1,0) [0|204] "Km/h" Vector__XXX" +-BO_ 541 MSG2: 8 Vector__XXX ++ BO_ 541 MSG2: 8 Vector__XXX + SG_ MSG2Value4 : 48|16@1+ (0.01,-40) [-40|125] "C" Vector__XXX + SG_ MSG2Value1 : 0|16@1+ (0.01,0) [0|100] "%" Vector__XXX + SG_ MSG2Value3 : 32|16@1+ (0.01,0) [0|100] "%" Vector__XXX + SG_ MSG2Value2 : 16|16@1+ (0.01,0) [0|100] "%" Vector__XXX +-)"; +- createDBCFile(dbcFile.fileName(), dbcContent); ++ )"; ++createDBCFile(dbcFile.fileName(), dbcContent); + +- // Start Test ++// Start Test + +- VectorBLFFilter filter; +- filter.setConvertTimeToSeconds(true); +- filter.setTimeHandlingMode(CANFilter::TimeHandling::ConcatPrevious); +- QCOMPARE(filter.isValid(blfFileName.fileName()), true); +- +- // Valid blf and valid dbc +- filter.setDBCFile(dbcFile.fileName()); +- Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); +- filter.readDataFromFile(blfFileName.fileName(), &s); +- QCOMPARE(s.columnCount(), 12); // time + 7 * Msg1 + 4* Msg2 ++VectorBLFFilter filter; ++filter.setConvertTimeToSeconds(true); ++filter.setTimeHandlingMode(CANFilter::TimeHandling::ConcatPrevious); ++QCOMPARE(filter.isValid(blfFileName.fileName()), true); ++ ++// Valid blf and valid dbc ++filter.setDBCFile(dbcFile.fileName()); ++Spreadsheet s(QStringLiteral("TestSpreadsheet"), false); ++filter.readDataFromFile(blfFileName.fileName(), &s); ++QCOMPARE(s.columnCount(), 12); // time + 7 * Msg1 + 4* Msg2 + +- { ++{ + // Time + const auto* c = s.column(0); + QCOMPARE(c->name(), QStringLiteral("Time_s")); +@@ -801,9 +803,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig6 + const auto* c = s.column(1); + QCOMPARE(c->name(), QStringLiteral("Value6_")); +@@ -814,9 +816,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig5 + const auto* c = s.column(2); + QCOMPARE(c->name(), QStringLiteral("Value5_%")); +@@ -827,9 +829,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig2 + const auto* c = s.column(3); + QCOMPARE(c->name(), QStringLiteral("Value2_")); +@@ -840,9 +842,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig3 + const auto* c = s.column(4); + QCOMPARE(c->name(), QStringLiteral("Value3_")); +@@ -853,9 +855,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig7 + const auto* c = s.column(5); + QCOMPARE(c->name(), QStringLiteral("Value7_")); +@@ -866,9 +868,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg12Sig4 + const auto* c = s.column(6); + QCOMPARE(c->name(), QStringLiteral("Value4_")); +@@ -879,9 +881,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg1Sig1 + const auto* c = s.column(7); + QCOMPARE(c->name(), QStringLiteral("Value1_Km/h")); +@@ -892,9 +894,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + QCOMPARE(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg2Sig4 + const auto* c = s.column(8); + QCOMPARE(c->name(), QStringLiteral("MSG2Value4_C")); +@@ -905,9 +907,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + VALUES_EQUAL(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg2Sig1 + const auto* c = s.column(9); + QCOMPARE(c->name(), QStringLiteral("MSG2Value1_%")); +@@ -918,9 +920,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + VALUES_EQUAL(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg2Sig3 + const auto* c = s.column(10); + QCOMPARE(c->name(), QStringLiteral("MSG2Value3_%")); +@@ -931,9 +933,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + VALUES_EQUAL(c->valueAt(i), refData.at(i)); + } +- } ++} + +- { ++{ + // Msg2Sig2 + const auto* c = s.column(11); + QCOMPARE(c->name(), QStringLiteral("MSG2Value2_%")); +@@ -944,7 +946,9 @@ + for (int i = 0; i < c->rowCount(); i++) { + VALUES_EQUAL(c->valueAt(i), refData.at(i)); + } +- } + } ++} ++ ++#endif + + QTEST_MAIN(BLFFilterTest) |