summaryrefslogtreecommitdiff
path: root/test/utils/test_env.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/utils/test_env.hpp')
-rw-r--r--test/utils/test_env.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/utils/test_env.hpp b/test/utils/test_env.hpp
index fc6ac739..ec03a9ee 100644
--- a/test/utils/test_env.hpp
+++ b/test/utils/test_env.hpp
@@ -40,10 +40,12 @@
return properties;
}
-static inline void ReadCompatibilityFromEnv() {
- auto* compatible = std::getenv("COMPATIBLE");
- if (compatible != nullptr) {
- ProtocolTraits::Instance().SetCompatible();
+[[nodiscard]] static inline auto ReadCompatibilityFromEnv() noexcept
+ -> std::optional<bool> {
+ try {
+ return std::getenv("COMPATIBLE") != nullptr;
+ } catch (...) {
+ return std::nullopt;
}
}