Adding offset to RegisterAddress (#1413)
All checks were successful
Build and Deploy on local RHEL9 / build (push) Successful in 2m3s
Build on RHEL9 docker image / build (push) Successful in 3m58s
Build and Deploy on local RHEL8 / build (push) Successful in 5m0s
Build on RHEL8 docker image / build (push) Successful in 5m7s
Run Simulator Tests on local RHEL9 / build (push) Successful in 14m40s
Run Simulator Tests on local RHEL8 / build (push) Successful in 17m4s

* implemented + and += for RegisterAddres and tests plus test cleanup
This commit is contained in:
Erik Fröjdh
2026-03-05 09:32:21 +01:00
committed by GitHub
parent 6e090dbba2
commit 9f72688b9c
5 changed files with 56 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
from slsdet.bits import clearbit, clearbit_arr, setbit, setbit_arr
from slsdet import RegisterAddress
import numpy as np
@@ -47,4 +48,13 @@ def test_setbit_arr():
def test_clearbit_arr():
arr = np.array((5, 5, 5), dtype=np.int8)
clearbit_arr(0, arr)
assert all(arr == (4, 4, 4))
assert all(arr == (4, 4, 4))
def test_RegisterAddress_addition():
r = RegisterAddress(0x10)
r2 = r + 0x5
assert r2.value() == 0x15
r3 = 0x5 + r
assert r3.value() == 0x15
r += 0x5
assert r.value() == 0x15