1- #include " pch.h "
1+ #include < Windows.h >
22#include " catch.hpp"
3- #include < array>
3+
4+ import std;
5+ import Windows.Foundation;
6+ import Windows.Storage.Streams;
7+ import Windows.Data.Json;
48
59using namespace winrt ;
610using namespace Windows ::Foundation;
@@ -10,7 +14,7 @@ using namespace Windows::Data::Json;
1014//
1115// This is a helper to create a data reader for use in testing arrays.
1216//
13- static IAsyncOperation<IDataReader> CreateDataReader (std::initializer_list<byte > /* values*/ )
17+ static IAsyncOperation<IDataReader> CreateDataReader (std::initializer_list<std:: uint8_t > /* values*/ )
1418{
1519 InMemoryRandomAccessStream stream;
1620 DataWriter writer (stream);
@@ -32,8 +36,8 @@ TEST_CASE("array,DataReader,std::span")
3236{
3337 auto reader = CreateDataReader ({ 1 , 2 , 3 }).get ();
3438
35- std::array<byte , 3 > a{};
36- std::span<byte > sp (a);
39+ std::array<std:: uint8_t , 3 > a{};
40+ std::span<std:: uint8_t > sp (a);
3741 reader.ReadBytes (sp); // FillArray pattern
3842
3943 REQUIRE (a.size () == 3 );
@@ -49,7 +53,7 @@ TEST_CASE("array,DataReader,std::span,direct")
4953{
5054 auto reader = CreateDataReader ({ 1 , 2 , 3 }).get ();
5155
52- std::array<byte , 3 > a{};
56+ std::array<std:: uint8_t , 3 > a{};
5357 reader.ReadBytes (a); // FillArray pattern
5458
5559 REQUIRE (a.size () == 3 );
@@ -154,7 +158,7 @@ TEST_CASE("array_view,span,ctad")
154158#define REQUIRE_DEDUCED_AS (T, ...) \
155159 static_assert (std::is_same_v<array_view<T>, decltype (array_view (__VA_ARGS__))>)
156160
157- std::uint8_t a[] = {1 , 2 , 3 };
161+ std::uint8_t a[] = { 1 , 2 , 3 };
158162 std::span<std::uint8_t , 3 > sp{ a };
159163
160164 REQUIRE_DEDUCED_AS (std::uint8_t , sp);
0 commit comments