Change-Id: I52e4fc9ebf2f59da57d8cf8f3e37cc79598c2f5f Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Andreas Hansson <andreas.hansson@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-on: https://gem5-review.googlesource.com/2229 Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
25 lines
699 B
Python
25 lines
699 B
Python
|
|
|
|
def test_constants():
|
|
from pybind11_tests import some_constant
|
|
|
|
assert some_constant == 14
|
|
|
|
|
|
def test_function_overloading():
|
|
from pybind11_tests import MyEnum, test_function
|
|
|
|
assert test_function() == "test_function()"
|
|
assert test_function(7) == "test_function(7)"
|
|
assert test_function(MyEnum.EFirstEntry) == "test_function(enum=1)"
|
|
assert test_function(MyEnum.ESecondEntry) == "test_function(enum=2)"
|
|
|
|
assert test_function(1, 1.0) == "test_function(int, float)"
|
|
assert test_function(2.0, 2) == "test_function(float, int)"
|
|
|
|
|
|
def test_bytes():
|
|
from pybind11_tests import return_bytes, print_bytes
|
|
|
|
assert print_bytes(return_bytes()) == "bytes[1 0 2 0]"
|