Skip to content

Commit

Permalink
test: test scdms.ksy
Browse files Browse the repository at this point in the history
  • Loading branch information
zonca committed Jan 9, 2024
1 parent d89009e commit 879a297
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Binary file added tests/scdms.json.gz
Binary file not shown.
21 changes: 21 additions & 0 deletions tests/test_scdms.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 879a297

Please sign in to comment.