mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-11-02 15:35:24 +01:00
tests for bool in ToString/StringTo (#1230)
- Added tests for ToString/StringTo<bool> - Added overload for ToString of bool (previously went through int)
This commit is contained in:
1 parent
c92830f854
commit
f84454fbc1
4 files changed
+20
-1
No files matched your search
@@ -16,6 +16,17 @@ namespace sls {
|
||||
|
||||
using namespace sls::time;
|
||||
|
||||
TEST_CASE("Convert bool to string", "[support]") {
|
||||
REQUIRE(ToString(true) == "1");
|
||||
REQUIRE(ToString(false) == "0");
|
||||
}
|
||||
|
||||
TEST_CASE("Convert string to bool", "[support]") {
|
||||
REQUIRE(StringTo<bool>("1") == true);
|
||||
REQUIRE(StringTo<bool>("0") == false);
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("Integer conversions", "[support]") {
|
||||
REQUIRE(ToString(0) == "0");
|
||||
REQUIRE(ToString(1) == "1");
|
||||
|
||||
Reference in new issue
Block a user