Tests/Utils: Resolve SVACE issues 282842, 282843, and 282844
authorWook Song <wook16.song@samsung.com>
Wed, 26 Mar 2025 04:07:25 +0000 (13:07 +0900)
committerWook Song <wook16.song@samsung.com>
Wed, 26 Mar 2025 10:41:52 +0000 (19:41 +0900)
This patch fixes the SVACE issues 282842, 282843, and 282844, which are
reported by the NO_CAST.INTEGER_OVERFLOW checker.

Change-Id: Iabb2bde27fd34c439f607a9248b1a7d0cb6947ef
Signed-off-by: Wook Song <wook16.song@samsung.com>
tests/utils/ne_test_utils.cc

index bd8c9d4be17303a32191ac4de82860dd14bf75cf..79a264504ca004ce81ca4f96fae5727c2b4306c1 100644 (file)
@@ -491,7 +491,7 @@ UtilTrinity::wait () {
   uint32_t result;
   std::unique_lock<std::mutex> lock (m_);
 
-  cv_.wait (lock, [this]() { return done_ == total_; });
+  cv_.wait (lock, [this] () { return done_ == total_; });
   result = success_;
 
   total_ = 0;
@@ -1001,9 +1001,9 @@ UtilTestEnv::set_info () {
   model_ = std::string ("/testdata/TRIV") + major + minor + extra + "/CONV_2D_000";
   version_ = 0;
   version_ |= std::stoi (major);
-  version_ |= std::stoi (minor) << 8;
-  version_ |= std::stoi (extra) << 16;
-  version_ |= tops_ << 24;
+  version_ |= static_cast<uint64_t> (std::stoi (minor)) << 8;
+  version_ |= static_cast<uint64_t> (std::stoi (extra)) << 16;
+  version_ |= static_cast<uint64_t> (tops_) << 24;
 
   return 0;
 }