Skip to content

Commit a610b9e

Browse files
committed
added in TestUsingType use case of #67
1 parent a27847a commit a610b9e

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,6 @@ install(TARGETS wrapit DESTINATION bin)
155155
include(CTest)
156156
add_test(NAME ex001-HelloWorld WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/examples/ex001-HelloWorld COMMAND julia --project=. runtests.jl)
157157
add_test(NAME unittests WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test COMMAND julia --project=. runtests.jl)
158+
159+
add_subdirectory(test)
160+
add_subdirectory(examples)

test/TestUsingType/A.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,15 @@ class G4VMPLData
2121
G4PhysConstVectorData* physicsVector = nullptr;
2222
};
2323

24+
using std::string;
25+
class MyString {
26+
public:
27+
MyString(const string& str) : m_str(str) {}
28+
string str() const { return m_str; }
29+
private:
30+
string m_str;
31+
};
32+
33+
2434
#endif //A_H not defined
2535

test/TestUsingType/runTestUsingType.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ function runtest()
1414
@test physicsVector(data) != C_NULL
1515
pv = physicsVector(data)
1616
@test physicsVector(data) |> length == 0
17+
s = MyString("Hello")
18+
@test str(s) == "Hello"
1719
end
1820
end
1921

0 commit comments

Comments
 (0)