Skip to content

Commit

Permalink
Tests: Workaround for Swig 4.2.1 != None erorrs
Browse files Browse the repository at this point in the history
Works around the swig 4.2.1 x != None errors in the pyflamegpu test suite by using the more idiomatic is not None.

The underlying issue within Swig is resolved in 4.3.0.
  • Loading branch information
ptheywood committed Oct 28, 2024
1 parent f3f6b0d commit 7e8b4d4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions swig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ message(STATUS "Python found at " ${Python3_EXECUTABLE})

# Define the minimum version of cmake we support.
# Swig 4.0+ is required for c++14 (and c++11 std::unordered_map).
set(SWIG_MINIMUM_SUPPORTED_VERSION 4.0.2)
set(SWIG_MINIMUM_SUPPORTED_VERSION 4.2.1)
# Define the version of SWIG to be downloaded (to simplify upgrading / output.)
set(SWIG_DOWNLOAD_VERSION 4.0.2)
set(SWIG_DOWNLOAD_VERSION 4.2.1)

# Look for user-installed SWIG in expectd locations.
# Users can set -DSWIG_EXECUTABLE pointed at their version of SWIG if it cannot be found (@todo - document this)
Expand Down
2 changes: 1 addition & 1 deletion tests/python/simulation/test_RunPlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_constructor(self):
model = pyflamegpu.ModelDescription("test")
plan = None
plan = pyflamegpu.RunPlan(model)
assert plan != None
assert plan is not None
plan = None

def test_setRandomSimulationSeed(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/python/simulation/test_RunPlanVector.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_constructor(self):
# Use New
initialLength = 4
plans = pyflamegpu.RunPlanVector(model, initialLength)
assert plans != None
assert plans is not None
assert plans.size() == initialLength
# Run the destructor
plans = None
Expand Down
2 changes: 1 addition & 1 deletion tests/python/simulation/test_cuda_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_constructor(self):
# Use the ctor
# explicit CUDAEnsemble(const ModelDescription& model, int argc = 0, const char** argv = None)
ensemble = pyflamegpu.CUDAEnsemble(model, [])
assert ensemble != None
assert ensemble is not None
# Check a property
assert ensemble.Config().timing == False
# Run the destructor ~CUDAEnsemble
Expand Down

0 comments on commit 7e8b4d4

Please sign in to comment.