Skip to content
Snippets Groups Projects
Commit 95b2ae18 authored by Shaun Roe's avatar Shaun Roe
Browse files

Introduce geoGraphNode test

parent f3a5364c
No related branches found
No related tags found
1 merge request!429Introduce geoGraphNode test
Pipeline #11790976 passed
...@@ -65,4 +65,5 @@ foreach(_exeFile ${files}) ...@@ -65,4 +65,5 @@ foreach(_exeFile ${files})
endforeach() endforeach()
include(GoogleTest) include(GoogleTest)
gtest_discover_tests(testRCBase) gtest_discover_tests(testRCBase)
gtest_discover_tests(testGeoGraphNode)
/* /*
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
*/ */
/** /**
......
/*
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
*/
#include "GeoModelKernel/GeoGraphNode.h"
#include "GeoModelKernel/GeoNodeAction.h"
#include <gtest/gtest.h>
#include <limits>
#include <memory>
class GeoNodeActionStub:public GeoNodeAction{
private:
bool m_called{};
public:
virtual void handleNode (const GeoGraphNode *) override{
m_called = true;
}
bool called() const { return m_called; }
};
TEST(GeoGraphNode, CanBeConstructedOnHeap) {
GeoGraphNode * pG{};
EXPECT_NO_THROW(pG = new GeoGraphNode);
pG->ref();
pG->unref(); //should be destroyed here
}
TEST(GeoGraphNode, ExecExecutesHandleNodeAction){
GeoGraphNode * pG = new GeoGraphNode;
pG->ref();
GeoNodeActionStub * myAction = new GeoNodeActionStub;
EXPECT_EQ(myAction->called(), false);
pG->exec(myAction);
EXPECT_EQ(myAction->called(), true);
pG->unref();
delete myAction;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment