mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 01:21:32 +01:00
Integration tests for the command line (#26)
* WIP * first test * format * test frames * also 0:
This commit is contained in:
committed by
Dhanya Thattil
parent
0eec57f8a2
commit
4b1a9bea32
@@ -2,4 +2,5 @@ target_sources(tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test-SharedMemory.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test-slsDetector.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test-multiSlsDetector.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test-multiSlsDetectorClient.cpp
|
||||
)
|
||||
40
slsDetectorSoftware/tests/test-multiSlsDetectorClient.cpp
Normal file
40
slsDetectorSoftware/tests/test-multiSlsDetectorClient.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "catch.hpp"
|
||||
#include "multiSlsDetectorClient.h"
|
||||
#include "sls_detector_defs.h"
|
||||
#include <sstream>
|
||||
|
||||
auto GET = slsDetectorDefs::GET_ACTION;
|
||||
auto PUT = slsDetectorDefs::PUT_ACTION;
|
||||
|
||||
TEST_CASE("rx_fifodepth", "[.cmd]") {
|
||||
auto oss = std::ostringstream{};
|
||||
multiSlsDetectorClient("rx_fifodepth 10", PUT, nullptr, oss);
|
||||
REQUIRE(oss.str() == "rx_fifodepth 10\n");
|
||||
|
||||
oss = std::ostringstream{};
|
||||
multiSlsDetectorClient("rx_fifodepth 100", PUT, nullptr, oss);
|
||||
REQUIRE(oss.str() == "rx_fifodepth 100\n");
|
||||
|
||||
oss = std::ostringstream{};
|
||||
multiSlsDetectorClient("rx_fifodepth", GET, nullptr, oss);
|
||||
REQUIRE(oss.str() == "rx_fifodepth 100\n");
|
||||
|
||||
oss = std::ostringstream{};
|
||||
multiSlsDetectorClient("0:rx_fifodepth", GET, nullptr, oss);
|
||||
REQUIRE(oss.str() == "0:rx_fifodepth 100\n");
|
||||
}
|
||||
|
||||
TEST_CASE("frames", "[.cmd]"){
|
||||
auto oss = std::ostringstream{};
|
||||
multiSlsDetectorClient("frames 1000", PUT, nullptr, oss);
|
||||
REQUIRE(oss.str() == "frames 1000\n");
|
||||
|
||||
oss = std::ostringstream{};
|
||||
multiSlsDetectorClient("frames", GET, nullptr, oss);
|
||||
REQUIRE(oss.str() == "frames 1000\n");
|
||||
|
||||
oss = std::ostringstream{};
|
||||
multiSlsDetectorClient("frames 1", PUT, nullptr, oss);
|
||||
REQUIRE(oss.str() == "frames 1\n");
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user