Skip to content

Commit

Permalink
Fixed composite channel "CAN_RemoteFrame.DLC" missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ihedvall committed Mar 8, 2024
1 parent f0ded04 commit f538c20
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mdflib/src/mdfwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ void MdfWriter::CreateCanRemoteFrameChannel(IChannelGroup& group) const {
CreateBitChannel(*cn_remote_frame,"CAN_RemoteFrame.IDE", 8 + 3, 7);

auto* frame_dlc = cn_remote_frame->CreateChannelComposition(
"CAN_DataFrame.DLC");
"CAN_RemoteFrame.DLC");
if (frame_dlc != nullptr) {
frame_dlc->Type(ChannelType::FixedLength);
frame_dlc->Sync(ChannelSyncType::None);
Expand Down
11 changes: 11 additions & 0 deletions mdflib_test/src/testwrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <filesystem>
#include <string>
#include <thread>
#include <set>

#include "util/logconfig.h"
#include "util/logstream.h"
Expand Down Expand Up @@ -2419,9 +2420,19 @@ TEST_F(TestWrite, Mdf4MlsdCanConfig) {
}
reader.Close();

std::set<std::string> unique_list;

for (auto& observer : observer_list) {
ASSERT_TRUE(observer);
EXPECT_EQ(observer->NofSamples(), 100'000);

// Verify that the CAN_RemoteFrame.DLC exist
const auto name = observer->Name();
if (unique_list.find(name) == unique_list.cend()) {
unique_list.emplace(name);
} else if (name != "t") {
EXPECT_TRUE(false) << "Duplicate: " << name;
}
}

}
Expand Down

0 comments on commit f538c20

Please sign in to comment.