Skip to content

Commit 8da4b0f

Browse files
committed
fix unit tests for smartSimFunctionObject
1 parent 0ce4ac2 commit 8da4b0f

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

.github/workflows/smartsim.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
env:
3030
CATCH_TIMEOUT: 20
3131
FOAM_FOAMUT: "/tmp/foamUT"
32-
SSBD: "redis:6379"
32+
SSDB: "redis:6379"
3333

3434
services:
3535
redis:
@@ -58,4 +58,3 @@ jobs:
5858
cd $FOAM_FOAMUT || exit 1
5959
rm -rf tests/exampleTests
6060
./Alltest "$@"
61-
if [ -f $FOAM_FOAMUT/tests/adaptiveFvMeshTests/log.wmake ]; then cat $FOAM_FOAMUT/tests/adaptiveFvMeshTests/log.wmake; fi

2023-01/smartsim/smartsim_function_object/tests/smartSimFOTest.C

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,39 @@
55
#include "fvCFD.H"
66
#include "fvMesh.H"
77

8-
#include <csetjmp>
9-
#include <csignal>
10-
#include <cstdlib>
11-
#include <functional>
8+
#include "smartSimFunctionObject.H"
9+
#include "functionObjectList.H"
1210

1311
using namespace Foam;
1412
extern Time* timePtr;
1513
extern argList* argsPtr;
1614

1715
TEST_CASE("Shared SmartRedis client", "[cavity][serial][parallel]")
1816
{
19-
dictionary dict;
20-
dict.set("type", "smartSimFunctionObject");
21-
dict.set("fieldNames", wordList());
22-
dict.set("fieldDimensions", labelList());
23-
functionObjects::smartSimFunctionObject fo1("smartSimFo1", *timePtr, dict);
24-
functionObjects::smartSimFunctionObject fo2("smartSimFo2", *timePtr, dict);
25-
REQUIRE(&fo1.redisDB == &fo2.redisDB);
17+
Time& runTime = *timePtr;
18+
FatalError.dontThrowExceptions();
19+
fvMesh mesh
20+
(
21+
IOobject
22+
(
23+
polyMesh::defaultRegion,
24+
runTime.constant(),
25+
runTime,
26+
IOobject::MUST_READ,
27+
IOobject::NO_WRITE
28+
)
29+
);
30+
dictionary dict0;
31+
dict0.set("region", polyMesh::defaultRegion);
32+
dict0.set("type", "smartSimFunctionObject");
33+
dict0.set("fieldNames", wordList());
34+
dict0.set("fieldDimensions", labelList());
35+
dictionary dict1;
36+
dict1.set("region", polyMesh::defaultRegion);
37+
dict1.set("type", "smartSimFunctionObject");
38+
dict1.set("fieldNames", wordList());
39+
dict1.set("fieldDimensions", labelList());
40+
functionObjects::smartSimFunctionObject o0("smartSim0", runTime, dict0);
41+
functionObjects::smartSimFunctionObject o1("smartSim1", runTime, dict1);
42+
REQUIRE(&(o0.redisDB) == &(o1.redisDB));
2643
}

0 commit comments

Comments
 (0)