Commit 65c43208 authored by Matthieu Dorier's avatar Matthieu Dorier

added EventTest

parent 77d0f5d2
......@@ -22,8 +22,12 @@ target_link_libraries(RunTest cppunit hepnos hepnos-service)
add_executable(SubRunTest SubRunTest.cpp HEPnOSTestMain.cpp)
target_link_libraries(SubRunTest cppunit hepnos hepnos-service)
add_executable(EventTest EventTest.cpp HEPnOSTestMain.cpp)
target_link_libraries(EventTest cppunit hepnos hepnos-service)
add_test(NAME DataStoreTest COMMAND run-test.sh ./DataStoreTest)
add_test(NAME DataSetTest COMMAND run-test.sh ./DataSetTest)
add_test(NAME RunSetTest COMMAND run-test.sh ./RunSetTest)
add_test(NAME RunTest COMMAND run-test.sh ./RunTest)
add_test(NAME SubRunTest COMMAND run-test.sh ./SubRunTest)
add_test(NAME EventTest COMMAND run-test.sh ./EventTest)
#include "EventTest.hpp"
#include "CppUnitAdditionalMacros.hpp"
CPPUNIT_TEST_SUITE_REGISTRATION( EventTest );
using namespace hepnos;
void EventTest::setUp() {}
void EventTest::tearDown() {}
void EventTest::testFillDataStore() {
auto mds = datastore->createDataSet("matthieu");
CPPUNIT_ASSERT(mds.valid());
Run r1 = mds.createRun(42);
CPPUNIT_ASSERT(r1.valid());
SubRun sr1 = r1.createSubRun(3);
CPPUNIT_ASSERT(sr1.valid());
Event ev1 = sr1.createEvent(22);
CPPUNIT_ASSERT(ev1.valid());
}
#ifndef __HEPNOS_TEST_EVENT_H
#define __HEPNOS_TEST_EVENT_H
#include <cppunit/extensions/HelperMacros.h>
#include <hepnos.hpp>
extern hepnos::DataStore* datastore;
class EventTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( EventTest );
CPPUNIT_TEST( testFillDataStore );
CPPUNIT_TEST_SUITE_END();
public:
void setUp();
void tearDown();
void testFillDataStore();
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment