Skip to content

Commit 2b9656e

Browse files
fix: typos when using Cpp::Evaluate (#124)
* fix: typos when using `Cpp::Evaluate` * update tests tags
1 parent f18794a commit 2b9656e

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

python/cppyy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def sizeof(tt):
389389
try:
390390
sz = ctypes.sizeof(tt)
391391
except TypeError:
392-
sz = gbl.Cpp.Evaluate("sizeof(%s);" % (_get_name(tt),))
392+
sz = gbl.Cpp.Evaluate("sizeof(%s)" % (_get_name(tt),))
393393
_sizes[tt] = sz
394394
return sz
395395

test/test_cpp11features.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def test09_lambda_calls(self):
320320
assert cppyy.gbl.gMyLambda(2) == 42
321321
assert cppyy.gbl.gMyLambda(40) == 80
322322

323-
if cppyy.gbl.Cpp.Evaluate("__cplusplus;") >= 201402:
323+
if cppyy.gbl.Cpp.Evaluate("__cplusplus") >= 201402:
324324
cppyy.cppdef("auto gime_a_lambda1() { return []() { return 42; }; }")
325325
l1 = cppyy.gbl.gime_a_lambda1()
326326
assert l1
@@ -336,12 +336,13 @@ def test09_lambda_calls(self):
336336
assert l3
337337
assert l3(2) == 48
338338

339+
@mark.xfail
339340
def test10_optional(self):
340341
"""Use of optional and nullopt"""
341342

342343
import cppyy
343344

344-
if 201703 <= cppyy.gbl.Cpp.Evaluate("__cplusplus;"):
345+
if 201703 <= cppyy.gbl.Cpp.Evaluate("__cplusplus"):
345346
assert cppyy.gbl.std.optional
346347
assert cppyy.gbl.std.nullopt
347348

test/test_datatypes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def setup_class(cls):
1717
import cppyy
1818
cls.datatypes = cppyy.load_reflection_info(cls.test_dct)
1919
cls.N = 5 #cppyy.gbl.N
20-
at_least_17 = 201402 < cppyy.gbl.Cpp.Evaluate("__cplusplus;")
20+
at_least_17 = 201402 < cppyy.gbl.Cpp.Evaluate("__cplusplus")
2121
cls.has_byte = at_least_17
2222
cls.has_optional = at_least_17
2323

@@ -193,7 +193,7 @@ def test01_instance_data_read_access(self):
193193

194194
c.__destruct__()
195195

196-
@mark.xfail(condition=not IS_CLANG_REPL, reason="fails with Cling")
196+
@mark.xfail
197197
def test02_instance_data_write_access(self):
198198
"""Test write access to instance public data and verify values"""
199199

@@ -378,7 +378,7 @@ def test03_array_passing(self):
378378

379379
c.__destruct__()
380380

381-
@mark.xfail(condition= not(IS_CLANG_REPL), reason="Fails on with Cling")
381+
@mark.xfail
382382
def test04_class_read_access(self):
383383
"""Test read access to class public data and verify values"""
384384

@@ -442,7 +442,7 @@ def test04_class_read_access(self):
442442

443443
c.__destruct__()
444444

445-
@mark.xfail(condition = not(IS_CLANG_REPL), reason="Fails on Cling")
445+
@mark.xfail
446446
def test05_class_data_write_access(self):
447447
"""Test write access to class public data and verify values"""
448448

test/test_fragile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ def test01_abortive_signals(self):
669669
class TestSTDNOTINGLOBAL:
670670
def setup_class(cls):
671671
import cppyy
672-
cls.has_byte = 201402 < cppyy.gbl.Cpp.Evaluate("__cplusplus;")
672+
cls.has_byte = 201402 < cppyy.gbl.Cpp.Evaluate("__cplusplus")
673673

674674
def test01_stl_in_std(self):
675675
"""STL classes should live in std:: only"""

test/test_regression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ def test34_print_empty_collection(self):
10151015
v = cppyy.gbl.std.vector[int]()
10161016
str(v)
10171017

1018-
@mark.skipif(not IS_CLANG_REPL, reason="Crashes on Cling")
1018+
@mark.xfail(run=IS_CLANG_REPL, reason="Crashes on Cling")
10191019
def test35_filesytem(self):
10201020
"""Static path object used to crash on destruction"""
10211021

@@ -1025,7 +1025,7 @@ def test35_filesytem(self):
10251025

10261026
import cppyy
10271027

1028-
if cppyy.gbl.Cpp.Evaluate("__cplusplus;") > 201402:
1028+
if cppyy.gbl.Cpp.Evaluate("__cplusplus") > 201402:
10291029
cppyy.cppdef("""\
10301030
#include <filesystem>
10311031
std::string stack_std_path() {

test/test_stltypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,12 +1599,12 @@ def setup_class(cls):
15991599
import cppyy
16001600
cls.stltypes = cppyy.load_reflection_info(cls.test_dct)
16011601

1602-
@mark.xfail(condition=not IS_CLANG_REPL, reason="xfail on Cling")
1602+
@mark.xfail
16031603
def test01_string_through_string_view(self):
16041604
"""Usage of std::string_view as formal argument"""
16051605

16061606
import cppyy
1607-
if cppyy.gbl.Cpp.Evaluate("__cplusplus;") <= 201402:
1607+
if cppyy.gbl.Cpp.Evaluate("__cplusplus") <= 201402:
16081608
# string_view exists as of C++17
16091609
return
16101610
countit = cppyy.gbl.StringViewTest.count

test/test_templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def test12_template_aliases(self):
306306
assert iavec[5] == 5
307307

308308
# with variadic template
309-
if cppyy.gbl.Cpp.Evaluate("__cplusplus;") > 201402:
309+
if cppyy.gbl.Cpp.Evaluate("__cplusplus") > 201402:
310310
assert nsup.matryoshka[int, 3].type
311311
assert nsup.matryoshka[int, 3, 4].type
312312
assert nsup.make_vector[int , 3]

0 commit comments

Comments
 (0)