diff --git a/tests/failing_tests/assign/retype.py b/tests/failing_tests/assign/retype.py index b4fc04e..0cd99fb 100644 --- a/tests/failing_tests/assign/retype.py +++ b/tests/failing_tests/assign/retype.py @@ -11,6 +11,7 @@ from pythonbpf.maps import HashMap # We can allow bitcasts in cases where the width of the types is the same in # the future. But for now, we do not allow any re-interpretation of variables. + @bpf @map def last() -> HashMap: diff --git a/tests/passing_tests/assign/comprehensive.py b/tests/passing_tests/assign/comprehensive.py index 6e53a3f..aeb6898 100644 --- a/tests/passing_tests/assign/comprehensive.py +++ b/tests/passing_tests/assign/comprehensive.py @@ -9,6 +9,7 @@ from pythonbpf.helper import ktime # the compiler, it is recommended to use named variables to reduce the amount of # scratch space that needs to be allocated. + @bpf @struct class data_t: @@ -48,8 +49,12 @@ def hello_world(ctx: c_void_p) -> c_int64: a = last.lookup(0) print(f"a is {a}") last.update(9, 9) - last.update(0, last.lookup(last.lookup(0)) + - last.lookup(last.lookup(0)) + last.lookup(last.lookup(0))) + last.update( + 0, + last.lookup(last.lookup(0)) + + last.lookup(last.lookup(0)) + + last.lookup(last.lookup(0)), + ) z = last.lookup(0) print(f"new map val at index 0 is {z}") else: