Closes #14
This commit is contained in:
1 parent
51fcdb88ac
commit
0708316a37
155 files changed
+5190
-2691
No files matched your search
@@ -270,7 +270,7 @@ void DbcParserTest::diagnosticUnsupportedStatements() {
|
||||
CHECK(decoded.signals[0].GetValueDescription() &&
|
||||
*decoded.signals[0].GetValueDescription() == "On",
|
||||
"Warnings preserve VAL_ descriptions");
|
||||
QCOMPARE(runtime.frames[0].signals[0].comment, std::string("Signal comment"));
|
||||
QCOMPARE(runtime.GetFrames()[0].signals[0].comment, std::string("Signal comment"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -588,7 +588,7 @@ void DbcParserTest::multiplexingBoundaries() {
|
||||
"SG_ Mode M : 7|64@0+ (0,5) [0|1] \"\" ECU\n");
|
||||
const DbcDatabase parsed = DbcParser().ParseFile(fixture.path.string());
|
||||
DecodeDatabase runtime = DbcDecodeBuilder().Build(parsed);
|
||||
CHECK(runtime.frames[0].signals[0].multiplexing.value == std::numeric_limits<std::uint64_t>::max(),
|
||||
CHECK(runtime.GetFrames()[0].signals[0].multiplexing.value == std::numeric_limits<std::uint64_t>::max(),
|
||||
"Exact uint64 branch metadata");
|
||||
RawCanFrame raw;
|
||||
raw.canId = 1U;
|
||||
@@ -601,12 +601,15 @@ void DbcParserTest::multiplexingBoundaries() {
|
||||
result = DbcDecoder().Decode(runtime, raw);
|
||||
CHECK(result.signals[0].status == SignalDecodeStatus::Inactive,
|
||||
"Adjacent large integers remain distinct");
|
||||
runtime.frames[0].signals[1].length = 0U;
|
||||
std::vector<DecodeFrame> definitions = runtime.GetFrames();
|
||||
definitions[0].signals[1].length = 0U;
|
||||
runtime = DecodeDatabase(definitions);
|
||||
result = DbcDecoder().Decode(runtime, raw);
|
||||
CHECK(result.signals[0].status == SignalDecodeStatus::InvalidDefinition &&
|
||||
result.signals[1].status == SignalDecodeStatus::InvalidDefinition,
|
||||
"Malformed runtime selector distinguished from payload errors");
|
||||
runtime.frames[0].signals.pop_back();
|
||||
definitions[0].signals.pop_back();
|
||||
runtime = DecodeDatabase(definitions);
|
||||
result = DbcDecoder().Decode(runtime, raw);
|
||||
CHECK(result.signals[0].status == SignalDecodeStatus::InvalidDefinition,
|
||||
"Missing runtime selector");
|
||||
@@ -788,12 +791,12 @@ void DbcParserTest::valueDescriptions() {
|
||||
for (std::size_t index = 0; index < parsed.frames.size(); ++index) {
|
||||
CHECK(tree->GetChild(index)->GetChild(0)->GetSignal()->valueDescriptions ==
|
||||
parsed.frames[index].signals[0].valueDescriptions &&
|
||||
runtime.frames[index].signals[0].valueDescriptions ==
|
||||
runtime.GetFrames()[index].signals[0].valueDescriptions ==
|
||||
parsed.frames[index].signals[0].valueDescriptions,
|
||||
"All mappings survive both builders");
|
||||
}
|
||||
CHECK(tree->GetChild(0)->GetChild(0)->GetSignal()->valueDescriptions ==
|
||||
runtime.frames[0].signals[0].valueDescriptions,
|
||||
runtime.GetFrames()[0].signals[0].valueDescriptions,
|
||||
"Both builders preserve descriptions");
|
||||
RawCanFrame frame;
|
||||
frame.canId = 256;
|
||||
@@ -830,7 +833,7 @@ void DbcParserTest::valueDescriptions() {
|
||||
CHECK(decoded.GetValueDescription() && *decoded.GetValueDescription() == test.description,
|
||||
"Unsigned boundaries");
|
||||
}
|
||||
CHECK(FindValueDescription(runtime.frames[0].signals[0].valueDescriptions, std::int64_t(1)) != nullptr,
|
||||
CHECK(FindValueDescription(runtime.GetFrames()[0].signals[0].valueDescriptions, std::int64_t(1)) != nullptr,
|
||||
"Nonnegative signed lookup matches unsigned key");
|
||||
frame.data.clear();
|
||||
CHECK(!DbcDecoder().Decode(runtime, frame).signals[0].GetValueDescription(), "Invalid decode has no description");
|
||||
|
||||
Reference in new issue
Block a user