mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 03:10:02 +02:00
ToString of runStatus
This commit is contained in:
parent
ffa9bbe8d2
commit
aaade64e0b
@ -11,6 +11,7 @@
|
|||||||
#include "TypeTraits.h"
|
#include "TypeTraits.h"
|
||||||
#include "sls_detector_exceptions.h"
|
#include "sls_detector_exceptions.h"
|
||||||
#include "string_utils.h"
|
#include "string_utils.h"
|
||||||
|
#include "sls_detector_defs.h"
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -174,9 +175,13 @@ ToString(const T &obj) {
|
|||||||
* Call ToString with a string, causes copy but might be needed
|
* Call ToString with a string, causes copy but might be needed
|
||||||
* in generic code.
|
* in generic code.
|
||||||
*/
|
*/
|
||||||
template <>
|
inline std::string ToString(const std::string& s){
|
||||||
inline std::string ToString<std::string>(const std::string& s){
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline std::string ToString(slsDetectorDefs::runStatus s){
|
||||||
|
return slsDetectorDefs::runStatusType(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace sls
|
} // namespace sls
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "TimeHelper.h"
|
#include "TimeHelper.h"
|
||||||
#include "ToString.h"
|
#include "ToString.h"
|
||||||
#include "network_utils.h"
|
#include "network_utils.h"
|
||||||
|
#include "sls_detector_defs.h"
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -111,5 +112,15 @@ TEST_CASE("vector of strings"){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("run status"){
|
||||||
|
using defs = slsDetectorDefs;
|
||||||
|
REQUIRE(ToString(defs::runStatus::ERROR) == "error");
|
||||||
|
REQUIRE(ToString(defs::runStatus::WAITING) == "waiting");
|
||||||
|
REQUIRE(ToString(defs::runStatus::TRANSMITTING) == "data"); //??
|
||||||
|
REQUIRE(ToString(defs::runStatus::RUN_FINISHED) == "finished");
|
||||||
|
REQUIRE(ToString(defs::runStatus::STOPPED) == "stopped");
|
||||||
|
REQUIRE(ToString(defs::runStatus::IDLE) == "idle");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user