File: 0007-Fix-wrong-alignment-test-to-actually-provoke-wrong-a.patch

package info (click to toggle)
stdgpu-contrib 1.3.0%2Bgit20220507.32e0517-3
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid, trixie
  • size: 2,524 kB
  • sloc: cpp: 7,818; pascal: 1,893; xml: 214; sh: 181; makefile: 16
file content (50 lines) | stat: -rw-r--r-- 1,814 bytes parent folder | download
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
49
50
From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
Date: Sat, 1 Jul 2023 23:13:05 +0200
Subject: Fix wrong alignment test to actually provoke wrong alignment

Forwarded: https://github.com/stotko/stdgpu/pull/455
---
 test/stdgpu/iterator.cpp | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/test/stdgpu/iterator.cpp b/test/stdgpu/iterator.cpp
index a4c8e3d..a1db53c 100644
--- a/test/stdgpu/iterator.cpp
+++ b/test/stdgpu/iterator.cpp
@@ -16,6 +16,7 @@
 #include <gtest/gtest.h>
 
 #include <algorithm>
+#include <cstdint>
 #include <numeric>
 #include <vector>
 
@@ -228,22 +229,22 @@ TEST_F(stdgpu_iterator, size_host_shifted)
 
 TEST_F(stdgpu_iterator, size_device_wrong_alignment)
 {
-    int* array = createDeviceArray<int>(1);
+    std::int32_t* array = createDeviceArray<std::int32_t>(1);
 
     // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
-    EXPECT_EQ(stdgpu::size(reinterpret_cast<std::size_t*>(array)), static_cast<stdgpu::index64_t>(0));
+    EXPECT_EQ(stdgpu::size(reinterpret_cast<std::int64_t*>(array)), static_cast<stdgpu::index64_t>(0));
 
-    destroyDeviceArray<int>(array);
+    destroyDeviceArray<std::int32_t>(array);
 }
 
 TEST_F(stdgpu_iterator, size_host_wrong_alignment)
 {
-    int* array_result = createHostArray<int>(1);
+    std::int32_t* array_result = createHostArray<std::int32_t>(1);
 
     // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
-    EXPECT_EQ(stdgpu::size(reinterpret_cast<std::size_t*>(array_result)), static_cast<stdgpu::index64_t>(0));
+    EXPECT_EQ(stdgpu::size(reinterpret_cast<std::int64_t*>(array_result)), static_cast<stdgpu::index64_t>(0));
 
-    destroyHostArray<int>(array_result);
+    destroyHostArray<std::int32_t>(array_result);
 }
 
 TEST_F(stdgpu_iterator, device_begin_end)