File: 0008-Use-time_t-for-timespec-saturation-tests.patch

package info (click to toggle)
iceoryx 2.0.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 11,260 kB
  • sloc: cpp: 94,127; ansic: 1,443; sh: 1,436; python: 1,377; xml: 80; makefile: 61
file content (48 lines) | stat: -rw-r--r-- 2,802 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
Date: Sat, 10 Sep 2022 21:51:50 +0200
Subject: Use time_t for timespec saturation tests

---
 iceoryx_hoofs/test/moduletests/test_unit_duration.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/iceoryx_hoofs/test/moduletests/test_unit_duration.cpp b/iceoryx_hoofs/test/moduletests/test_unit_duration.cpp
index 215ba14..78a4080 100644
--- a/iceoryx_hoofs/test/moduletests/test_unit_duration.cpp
+++ b/iceoryx_hoofs/test/moduletests/test_unit_duration.cpp
@@ -1168,7 +1168,7 @@ TEST(Duration_test, ConvertTimespecWithNoneReferenceFromDurationMoreThanOneSecon
 TEST(Duration_test, ConvertTimespecWithNoneReferenceFromDurationResultsNotYetInSaturation)
 {
     ::testing::Test::RecordProperty("TEST_ID", "70f11b99-78ec-442a-aefe-4dd9152b7903");
-    constexpr int64_t SECONDS{std::numeric_limits<int64_t>::max()};
+    constexpr int64_t SECONDS{std::numeric_limits<time_t>::max()};
     constexpr int64_t NANOSECONDS{NANOSECS_PER_SECOND - 1U};
 
     auto duration = createDuration(SECONDS, NANOSECONDS);
@@ -1182,7 +1182,7 @@ TEST(Duration_test, ConvertTimespecWithNoneReferenceFromDurationResultsNotYetInS
 TEST(Duration_test, ConvertTimespecWithNoneReferenceFromMaxDurationResultsInSaturation)
 {
     ::testing::Test::RecordProperty("TEST_ID", "3bf4bb34-46f3-4889-84f5-9220b32fff73");
-    constexpr int64_t SECONDS{std::numeric_limits<int64_t>::max()};
+    constexpr int64_t SECONDS{std::numeric_limits<time_t>::max()};
     constexpr int64_t NANOSECONDS{NANOSECS_PER_SECOND - 1U};
 
     struct timespec sut = DurationAccessor::max().timespec(iox::units::TimeSpecReference::None);
@@ -1212,7 +1212,7 @@ TEST(Duration_test, ConvertTimespecWithMonotonicReference)
 TEST(Duration_test, ConvertTimespecWithMonotonicReferenceFromMaxDurationResultsInSaturation)
 {
     ::testing::Test::RecordProperty("TEST_ID", "ff5a1fe2-65c8-490a-b31d-4d8ea615c91a");
-    constexpr int64_t SECONDS{std::numeric_limits<int64_t>::max()};
+    constexpr int64_t SECONDS{std::numeric_limits<time_t>::max()};
     constexpr int64_t NANOSECONDS{NANOSECS_PER_SECOND - 1U};
 
     struct timespec sut = DurationAccessor::max().timespec(iox::units::TimeSpecReference::Monotonic);
@@ -1240,7 +1240,7 @@ TEST(Duration_test, ConvertTimespecWithEpochReference)
 TEST(Duration_test, ConvertTimespecWithEpochReferenceFromMaxDurationResultsInSaturation)
 {
     ::testing::Test::RecordProperty("TEST_ID", "97ff4204-a7f7-43ef-b81e-0e359d1dce93");
-    constexpr int64_t SECONDS{std::numeric_limits<int64_t>::max()};
+    constexpr int64_t SECONDS{std::numeric_limits<time_t>::max()};
     constexpr int64_t NANOSECONDS{NANOSECS_PER_SECOND - 1U};
 
     struct timespec sut = DurationAccessor::max().timespec(iox::units::TimeSpecReference::Epoch);