From 114a683d3ccafa8d384c22db4390a45f1a143bd3 Mon Sep 17 00:00:00 2001 From: "Vorobiov Mihail (XC-AS/EDS3-RO)" Date: Tue, 27 Feb 2024 10:36:13 +0200 Subject: [PATCH] fix failing tests --- src/asammdf/blocks/mdf_v4.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/asammdf/blocks/mdf_v4.py b/src/asammdf/blocks/mdf_v4.py index b5308e611..8f004a3eb 100644 --- a/src/asammdf/blocks/mdf_v4.py +++ b/src/asammdf/blocks/mdf_v4.py @@ -1030,7 +1030,7 @@ def _read_channels( ) first_dep = ca_block = ChannelArrayBlock(address=component_addr, stream=stream, mapped=mapped) - ca_list = [first_dep] + dependencies[index] = [first_dep] while ca_block.composition_addr: stream.seek(ca_block.composition_addr) @@ -1041,11 +1041,10 @@ def _read_channels( stream=stream, mapped=mapped, ) - ca_list.append(ca_block) + dependencies[index].append(ca_block) elif channel.data_type == v4c.DATA_TYPE_BYTEARRAY: # read CA-CN nested structure - dependencies[index] = ca_list[:] ( ch_cntr, ret_composition, @@ -1060,6 +1059,7 @@ def _read_channels( mapped=mapped, ) + ca_cnt = len(dependencies[index]) if ret_composition: dependencies[index].extend(ret_composition) @@ -1068,7 +1068,7 @@ def _read_channels( dimensions = [] total_elem = 1 - for ca_blck in ca_list: + for ca_blck in dependencies[index][:ca_cnt]: # only consider CN templates if ca_blck.ca_type != v4c.CA_STORAGE_TYPE_CN_TEMPLATE: logger.warning("Only CN template arrays are supported")