Commit 5b347f96 authored by Jan Kiene's avatar Jan Kiene
Browse files

binary comparison for MASA metadata

parent dd14eb48
Loading
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -845,12 +845,21 @@ class MLDConformance:
                if not ref_exist:
                    continue

                _, ref_suffix = os.path.splitext(refMDfile)
                _, dut_suffix = os.path.splitext(dutMDfile)
                assert ref_suffix == dut_suffix

                BE_flag = 0
                if ref_suffix == ".csv":
                    with open(refMDfile, "r") as f_ref:
                        with open(dutMDfile, "r") as f_dut:
                            ref_content = f_ref.read()
                            dut_content = f_dut.read()
                            BE_flag = int(not (ref_content == dut_content))
                elif ref_suffix == ".met":
                    BE_flag = int(not filecmp.cmp(refMDfile, dutMDfile))
                else:
                    assert False, f"MD file has unknown suffix {ref_suffix}"

                with open(self.BEcsv[tag], "a") as f:
                    f.write(