From: SangYoun Kwak Date: Wed, 22 Jan 2025 08:40:40 +0000 (+0900) Subject: Fix to catch std::length_error in test code X-Git-Tag: accepted/tizen/unified/20250204.110440^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=582520bf9621bd6cc9e91a945a41d80a21c635b5;p=platform%2Fhal%2Fapi%2Fsensor.git Fix to catch std::length_error in test code A coverity issue was reported that RUN_ALL_TESTS() which runs all defined tests can invoke std::length_error. To fix this issue, a catch statement is added which catches std::length_error. Change-Id: I0e1ec4bfa323e637584f0cacff9422ed8c81d015 Signed-off-by: SangYoun Kwak --- diff --git a/haltest/main.cpp b/haltest/main.cpp index cc87664..afd64e4 100644 --- a/haltest/main.cpp +++ b/haltest/main.cpp @@ -58,6 +58,9 @@ int main(int argc, char **argv) } catch (const ::testing::internal::GoogleTestFailureException& e) { ret = -1; std::cout << "GoogleTestFailureException was thrown:" << e.what() << std::endl; + } catch (const std::length_error& e) { + ret = -1; + std::cout << "std::length_error was thrown:" << e.what() << std::endl; } return ret;