Commit 26f4aef6 authored by Stefan Doehla's avatar Stefan Doehla
Browse files

add debug functionality in case of invalid JSON - needed hat as the JSON is...

add debug functionality in case of invalid JSON - needed hat as the JSON is created manually and I had an error that was hard to find for me. Could be reverted if not desired.
parent f11e9d29
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -629,8 +629,17 @@ def run_rtp_bitstream_tests(
        else:
            assert rmsdB < -96.0, "Bitdiff in the RTP unpacked and G192 streams"

        try:
            with open(piDataOutJson, "r") as fd:
                decodedPiData = json.load(fd)
        except json.decoder.JSONDecodeError as e:
            print(f"JSONDecodeError loading PI data JSON at {piDataOutJson}: {e}")
            with open(piDataOutJson, "r") as _f:
                for _i, _l in enumerate(_f, start=1):
                    #if _i > 30:
                    #    break
                    print(f"{_i:3}: {_l.rstrip()}")
            raise
            assert (
                decodedPiData.keys() == generatedPIData.keys()
            ), f"Timestamp of PI data {generatedPIData.keys()} not found in Decoded PI Data {decodedPiData.keys()}"