From 38a1196b7165fb8817998ef8ac05967c2bf35fab Mon Sep 17 00:00:00 2001 From: Jakub Mazurkiewicz Date: Wed, 10 May 2023 12:18:38 +0200 Subject: [PATCH 1/3] Add modules test --- tests/std/include/test_header_units_and_modules.hpp | 12 ++++++++++++ tests/std/tests/include_each_header_alone_matrix.lst | 1 + 2 files changed, 13 insertions(+) diff --git a/tests/std/include/test_header_units_and_modules.hpp b/tests/std/include/test_header_units_and_modules.hpp index 33fc4115a7..e3c0b19ff9 100644 --- a/tests/std/include/test_header_units_and_modules.hpp +++ b/tests/std/include/test_header_units_and_modules.hpp @@ -389,6 +389,18 @@ void test_map() { assert(m[30] == 33); } +void test_mdspan() { + using namespace std; + puts("Testing ."); + int arr[] = {1, 0, 0, 0, 1, 0, 0, 0, 1}; + + // TRANSITION, check std::mdspan class too (currently constructors and deduction guides does not work with modules) + layout_right::mapping> mp; + assert(arr[mp(0, 0)] == 1); + assert(arr[mp(1, 1)] == 1); + assert(arr[mp(2, 2)] == 1); +} + void test_memory() { using namespace std; puts("Testing ."); diff --git a/tests/std/tests/include_each_header_alone_matrix.lst b/tests/std/tests/include_each_header_alone_matrix.lst index 9b041e051e..4d07f7d8bb 100644 --- a/tests/std/tests/include_each_header_alone_matrix.lst +++ b/tests/std/tests/include_each_header_alone_matrix.lst @@ -44,6 +44,7 @@ PM_CL="/DMEOW_HEADER=limits" PM_CL="/DMEOW_HEADER=list" PM_CL="/DMEOW_HEADER=locale" PM_CL="/DMEOW_HEADER=map" +PM_CL="/DMEOW_HEADER=mdspan" PM_CL="/DMEOW_HEADER=memory" PM_CL="/DMEOW_HEADER=memory_resource" PM_CL="/DMEOW_HEADER=mutex" From 5e256cecf2594b730eecc0295f649e31beba12e4 Mon Sep 17 00:00:00 2001 From: Jakub Mazurkiewicz Date: Wed, 10 May 2023 17:14:44 +0200 Subject: [PATCH 2/3] Add DevCom issue comment --- tests/std/include/test_header_units_and_modules.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/std/include/test_header_units_and_modules.hpp b/tests/std/include/test_header_units_and_modules.hpp index e3c0b19ff9..315fdb1284 100644 --- a/tests/std/include/test_header_units_and_modules.hpp +++ b/tests/std/include/test_header_units_and_modules.hpp @@ -393,12 +393,11 @@ void test_mdspan() { using namespace std; puts("Testing ."); int arr[] = {1, 0, 0, 0, 1, 0, 0, 0, 1}; - - // TRANSITION, check std::mdspan class too (currently constructors and deduction guides does not work with modules) layout_right::mapping> mp; assert(arr[mp(0, 0)] == 1); assert(arr[mp(1, 1)] == 1); assert(arr[mp(2, 2)] == 1); + // TRANSITION, test std::mdspan too (DevCom-10359857) } void test_memory() { From ea2cc6291b5c695ffee208c58ede686b9be7e210 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 10 May 2023 18:19:09 -0700 Subject: [PATCH 3/3] Code review feedback. --- tests/std/include/test_header_units_and_modules.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/std/include/test_header_units_and_modules.hpp b/tests/std/include/test_header_units_and_modules.hpp index 315fdb1284..8e00ddd90b 100644 --- a/tests/std/include/test_header_units_and_modules.hpp +++ b/tests/std/include/test_header_units_and_modules.hpp @@ -392,11 +392,11 @@ void test_map() { void test_mdspan() { using namespace std; puts("Testing ."); - int arr[] = {1, 0, 0, 0, 1, 0, 0, 0, 1}; + int arr[] = {10, 0, 0, 0, 20, 0, 0, 0, 30}; layout_right::mapping> mp; - assert(arr[mp(0, 0)] == 1); - assert(arr[mp(1, 1)] == 1); - assert(arr[mp(2, 2)] == 1); + assert(arr[mp(0, 0)] == 10); + assert(arr[mp(1, 1)] == 20); + assert(arr[mp(2, 2)] == 30); // TRANSITION, test std::mdspan too (DevCom-10359857) } @@ -1108,6 +1108,7 @@ void all_cpp_header_tests() { test_list(); test_locale(); test_map(); + test_mdspan(); test_memory(); test_memory_resource(); test_mutex();