MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Hpp / main

Function main

tests/StridedArrayProxy/StridedArrayProxy.cpp:40–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40int main()
41{
42 try
43 {
44 // nullptr_t
45 fct( nullptr );
46 fctc( nullptr );
47
48 vk::StridedArrayProxy<int> ap0 = nullptr;
49 release_assert( ap0.size() == 0 );
50
51 // Type
52 // fct(2); // not supported: cannot convert argument 1 from 'int' to 'vk::StridedArrayProxy<int>'
53 fctc( 1 );
54
55 int i0 = 1;
56 fct( i0 );
57 fctc( i0 );
58
59 const int i1 = 2;
60 // fct(i1); // not supported: cannot convert argument 1 from 'const int' to 'vk::StridedArrayProxy<int>'
61 fctc( i1 );
62
63 vk::StridedArrayProxy<const int> ap1 = 1;
64 release_assert( ap1.size() == 1 );
65 vk::StridedArrayProxy<const int> ap2 = i0;
66 release_assert( ap2.size() == 1 );
67 vk::StridedArrayProxy<const int> ap3 = i1;
68 release_assert( ap3.size() == 1 );
69
70 // count, T *
71 int * i0p = &i0;
72 fct( { 1, i0p } );
73 fctc( { 1, i0p } );
74
75 // count, T const*
76 int const * i1p = &i1;
77 // fct({ 1, i1p }); // not supported: cannot convert argument 1 from 'initializer list' to 'vk::StridedArrayProxy<int>'
78 fctc( { 1, i1p } );
79
80 vk::StridedArrayProxy<const int> ap4 = { 1, i0p };
81 release_assert( ap4.size() == 1 );
82 vk::StridedArrayProxy<const int> ap5 = { 1, i1p };
83 release_assert( ap5.size() == 1 );
84
85 // T[count]
86 int ia0[2] = { 0, 1 };
87 fct( ia0 );
88 fctc( ia0 );
89
90 // const T[count]
91 const int ia1[2] = { 0, 1 };
92 // fct( ia1 ); // not supported: cannot convert argument 1 from 'const int [2]' to 'vk::StridedArrayProxy<int>'
93 fctc( ia1 );
94
95 vk::StridedArrayProxy<const int> ap6 = ia0;
96 release_assert( ap6.size() == 2 );
97 vk::StridedArrayProxy<const int> ap7 = ia1;

Callers

nothing calls this directly

Calls 2

fctFunction · 0.70
fctcFunction · 0.70

Tested by

no test coverage detected