From b1feac16f955f5cfa645fbef2375449f23aff359 Mon Sep 17 00:00:00 2001 From: keremsahn Date: Sun, 30 Aug 2026 21:31:48 +0300 Subject: [PATCH] Changed definition of a function to the test it is actually used, and added a missing import --- test/test_doc_features.py | 12 ++++++++---- test/test_lowlevel.py | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/test/test_doc_features.py b/test/test_doc_features.py index 9822605..70fa02e 100644 --- a/test/test_doc_features.py +++ b/test/test_doc_features.py @@ -142,10 +142,6 @@ class Abstract2 { return f(i1, i2); } -template -C multiply(A a, B b) { - return static_cast(a * b); -} //----- namespace Namespace { @@ -714,6 +710,14 @@ def test09_templated_function(self): import cppjit + cppjit.cppdef(""" + +template +C multiply(A a, B b) { +return static_cast(a * b); +} + +""") mul = cppjit.gbl.multiply assert "multiply" in cppjit.gbl.__dict__ diff --git a/test/test_lowlevel.py b/test/test_lowlevel.py index 0208a5f..bcc7ac3 100644 --- a/test/test_lowlevel.py +++ b/test/test_lowlevel.py @@ -61,13 +61,14 @@ def test03_memory(self): """Memory allocation and free-ing""" import cppjit + from cppjit import ll # regular C malloc/free mem = cppjit.gbl.malloc(16) cppjit.gbl.free(mem) # typed styles - mem = cppjit.ll.malloc[int](self.N) + mem = ll.malloc[int](self.N) assert len(mem) == self.N assert not mem.__cpp_array__ for i in range(self.N):