add failing tests

This commit is contained in:
2025-09-30 23:50:11 +05:30
parent 44b95b69ca
commit 7d91f88c4d
6 changed files with 68 additions and 6 deletions

View File

@ -0,0 +1,15 @@
from pythonbpf import compile, bpf, section, bpfglobal
from ctypes import c_void_p, c_int64
@bpf
@section("sometag1")
def sometag(ctx: c_void_p) -> c_int64:
a = 1 + 2 + 1
return c_int64(0)
@bpf
@bpfglobal
def LICENSE() -> str:
return "GPL"
compile()

16
tests/failing_tests/if.py Normal file
View File

@ -0,0 +1,16 @@
from pythonbpf import compile, bpf, section, bpfglobal
from ctypes import c_void_p, c_int64
@bpf
@section("sometag1")
def sometag(ctx: c_void_p) -> c_int64:
if 3 + 2 == 5:
return c_int64(5)
return c_int64(0)
@bpf
@bpfglobal
def LICENSE() -> str:
return "GPL"
compile()

View File

@ -0,0 +1,11 @@
from pythonbpf import compile, bpf, section, bpfglobal
from ctypes import c_void_p, c_int64
# FAILS WHEN THERE IS NO LICENSE. which is wrong.
@bpf
@section("sometag1")
def sometag(ctx: c_void_p) -> c_int64:
a = 1 + 2
return c_int64(0)
compile()

View File

@ -0,0 +1,14 @@
from pythonbpf import compile, bpf, section, bpfglobal
from ctypes import c_void_p, c_int64
@bpf
@section("sometag1")
def sometag(ctx: c_void_p) -> c_int64:
return c_int64(1 - 1)
@bpf
@bpfglobal
def LICENSE() -> str:
return "GPL"
compile()