mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 13:11:36 +00:00
- Replace TestExceptions, TestErrorState, TestSignals and TestWaitFor with one StateAction device; the id selects the action and the state - Run the device tests through test::RunDevices() instead of EXPECT_EXIT() and check the exit code and the expected log line Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
122 lines
2.5 KiB
C++
122 lines
2.5 KiB
C++
/********************************************************************************
|
|
* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
|
* *
|
|
* This software is distributed under the terms of the *
|
|
* GNU Lesser General Public Licence (LGPL) version 3, *
|
|
* copied verbatim in the file "LICENSE" *
|
|
********************************************************************************/
|
|
|
|
#include <helper/Devices.h>
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
#include <string>
|
|
|
|
namespace
|
|
{
|
|
|
|
using namespace std;
|
|
using namespace fair::mq::test;
|
|
|
|
void RunExceptionIn(string const& state, string const& control, string const& input = "")
|
|
{
|
|
RunOptions options;
|
|
options.control = control;
|
|
options.input = input;
|
|
auto const results = RunDevices({{"exceptions_" + state + "_"}}, options);
|
|
|
|
EXPECT_TRUE(ExitedWith(results.at(0), 1, "exception in " + state + "()"));
|
|
}
|
|
|
|
TEST(Exceptions, static_InInit)
|
|
{
|
|
RunExceptionIn("Init", "static");
|
|
}
|
|
|
|
TEST(Exceptions, static_InBind)
|
|
{
|
|
RunExceptionIn("Bind", "static");
|
|
}
|
|
|
|
TEST(Exceptions, static_InConnect)
|
|
{
|
|
RunExceptionIn("Connect", "static");
|
|
}
|
|
|
|
TEST(Exceptions, static_InInitTask)
|
|
{
|
|
RunExceptionIn("InitTask", "static");
|
|
}
|
|
|
|
TEST(Exceptions, static_InPreRun)
|
|
{
|
|
RunExceptionIn("PreRun", "static");
|
|
}
|
|
|
|
TEST(Exceptions, static_InRun)
|
|
{
|
|
RunExceptionIn("Run", "static");
|
|
}
|
|
|
|
TEST(Exceptions, static_InPostRun)
|
|
{
|
|
RunExceptionIn("PostRun", "static");
|
|
}
|
|
|
|
TEST(Exceptions, static_InResetTask)
|
|
{
|
|
RunExceptionIn("ResetTask", "static");
|
|
}
|
|
|
|
TEST(Exceptions, static_InReset)
|
|
{
|
|
RunExceptionIn("Reset", "static");
|
|
}
|
|
|
|
TEST(Exceptions, interactive_InInit)
|
|
{
|
|
RunExceptionIn("Init", "interactive");
|
|
}
|
|
|
|
TEST(Exceptions, interactive_InBind)
|
|
{
|
|
RunExceptionIn("Bind", "interactive");
|
|
}
|
|
|
|
TEST(Exceptions, interactive_InConnect)
|
|
{
|
|
RunExceptionIn("Connect", "interactive");
|
|
}
|
|
|
|
TEST(Exceptions, interactive_InInitTask)
|
|
{
|
|
RunExceptionIn("InitTask", "interactive");
|
|
}
|
|
|
|
TEST(Exceptions, interactive_InPreRun)
|
|
{
|
|
RunExceptionIn("PreRun", "interactive");
|
|
}
|
|
|
|
TEST(Exceptions, interactive_InRun)
|
|
{
|
|
RunExceptionIn("Run", "interactive");
|
|
}
|
|
|
|
TEST(Exceptions, interactive_InPostRun)
|
|
{
|
|
RunExceptionIn("PostRun", "interactive");
|
|
}
|
|
|
|
TEST(Exceptions, interactive_InResetTask)
|
|
{
|
|
RunExceptionIn("ResetTask", "interactive", "q");
|
|
}
|
|
|
|
TEST(Exceptions, interactive_InReset)
|
|
{
|
|
RunExceptionIn("Reset", "interactive", "q");
|
|
}
|
|
|
|
} // namespace
|