From 671bc6274037c2b64a61f31e1931382e2b788231 Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Wed, 15 Sep 2021 09:25:36 +0200 Subject: [PATCH] additional tests --- slsDetectorSoftware/tests/test-CmdParser.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/slsDetectorSoftware/tests/test-CmdParser.cpp b/slsDetectorSoftware/tests/test-CmdParser.cpp index d489a6e44..c7e2cb916 100644 --- a/slsDetectorSoftware/tests/test-CmdParser.cpp +++ b/slsDetectorSoftware/tests/test-CmdParser.cpp @@ -393,4 +393,20 @@ TEST_CASE("Parse a command that has -h in it"){ REQUIRE(p.arguments().size() == 1); REQUIRE(p.arguments()[0]== "somepc"); +} + +TEST_CASE("Parse a command in the form 0-1 command"){ + CmdParser p; + p.Parse("3-5 exptime"); + REQUIRE(p.multi_id() == 3); + REQUIRE(p.detector_id() == 5); + REQUIRE(p.command() == "exptime"); +} + +TEST_CASE("Parse a command in the form 0-1:command"){ + CmdParser p; + p.Parse("3-5:exptime"); + REQUIRE(p.multi_id() == 3); + REQUIRE(p.detector_id() == 5); + REQUIRE(p.command() == "exptime"); } \ No newline at end of file