diff --git a/Makefile b/Makefile index e93eaf3..084e91d 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ ifneq (,$(wildcard /proc/sys/fs/binfmt_misc/WSLInterop)) else JAR_PATH = /usr/share/kaitai-struct-compiler/lib/* endif -KSY := animal fake index_option numpy pixie4e records +KSY := animal fake index_option numpy pixie4e records scdms LIBS := $(foreach ksy,$(KSY),test_artifacts/lib$(ksy).so) test_artifacts/lib%.so: test_artifacts/%.cpp $(BUILD) diff --git a/tests/scdms.json.gz b/tests/scdms.json.gz new file mode 100644 index 0000000..20afc90 Binary files /dev/null and b/tests/scdms.json.gz differ diff --git a/tests/test_scdms.py b/tests/test_scdms.py new file mode 100644 index 0000000..dbdc398 --- /dev/null +++ b/tests/test_scdms.py @@ -0,0 +1,21 @@ +from __future__ import annotations + +import sys + +import numpy as np + +sys.path.append("local") +import awkward_kaitai + +import json +import gzip + + +def test_scdms(): + reader = awkward_kaitai.Reader("test_artifacts/libscdms.so") + awkward_array = reader.load("example_data/data/scdms_v_two_trigger.bin") + + with gzip.open("tests/scdms.json.gz", "rb") as f: + expected_content = json.load(f) + + assert awkward_array.to_list() == expected_content