Skip to content

Commit 7f2f236

Browse files
committed
adapt and simplify C++ example
1 parent b16fe39 commit 7f2f236

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
#include <assert.h>
22
#include <test_cpp.h>
3-
// #include <float.h>
4-
// #include <math.h>
53

6-
void exports::test::fixed_size_lists::to_test::ListParam(std::array<uint32_t, 4> a) {
4+
using namespace exports::test::fixed_size_lists;
5+
6+
void to_test::ListParam(std::array<uint32_t, 4> a) {
77
std::array<uint32_t, 4> b = std::array<uint32_t, 4>{1, 2, 3, 4};
88
assert(a == b);
99
}
10-
void exports::test::fixed_size_lists::to_test::ListParam2(std::array<std::array<uint32_t, 2>, 2> a) {
10+
void to_test::ListParam2(std::array<std::array<uint32_t, 2>, 2> a) {
1111
std::array<std::array<uint32_t, 2>, 2> b = std::array<std::array<uint32_t, 2>, 2>{std::array<uint32_t, 2>{1, 2}, std::array<uint32_t, 2>{3, 4}};
1212
assert(a == b);
1313
}
14-
void exports::test::fixed_size_lists::to_test::ListParam3(std::array<int32_t, 20> a) {
14+
void to_test::ListParam3(std::array<int32_t, 20> a) {
1515
std::array<int32_t, 20> b = std::array<int32_t, 20>{-1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15, 16, -17, 18, -19, 20};
1616
assert(a == b);
1717
}
18-
std::array<uint8_t, 8> exports::test::fixed_size_lists::to_test::ListResult() {
18+
std::array<uint8_t, 8> to_test::ListResult() {
1919
return std::array<uint8_t, 8>{'0', '1', 'A', 'B', 'a', 'b', 128, 255};
2020
}
2121
std::tuple<std::array<uint16_t, 4>, std::array<int16_t, 4>>
22-
exports::test::fixed_size_lists::to_test::ListMinmax16(std::array<uint16_t, 4> a, std::array<int16_t, 4> b) {
22+
to_test::ListMinmax16(std::array<uint16_t, 4> a, std::array<int16_t, 4> b) {
2323
return std::tuple<std::array<uint16_t, 4>, std::array<int16_t, 4>>(a, b);
2424
}
2525
std::tuple<std::array<float, 2>, std::array<double, 2>>
26-
exports::test::fixed_size_lists::to_test::ListMinmaxFloat(std::array<float, 2> a, std::array<double, 2> b) {
26+
to_test::ListMinmaxFloat(std::array<float, 2> a, std::array<double, 2> b) {
2727
return std::tuple<std::array<float, 2>, std::array<double, 2>>(a,b);
2828
}
29-
std::array<uint8_t, 12> exports::test::fixed_size_lists::to_test::ListRoundtrip(std::array<uint8_t, 12> a) {
29+
std::array<uint8_t, 12> to_test::ListRoundtrip(std::array<uint8_t, 12> a) {
3030
return a;
3131
}
3232

3333
std::tuple<std::array<std::array<uint32_t, 2>, 2>,
3434
std::array<std::array<int32_t, 2>, 2>>
35-
exports::test::fixed_size_lists::to_test::NestedRoundtrip(std::array<std::array<uint32_t, 2>, 2> a,
35+
to_test::NestedRoundtrip(std::array<std::array<uint32_t, 2>, 2> a,
3636
std::array<std::array<int32_t, 2>, 2> b) {
3737
return std::tuple<std::array<std::array<uint32_t, 2>, 2>,
3838
std::array<std::array<int32_t, 2>, 2>>(a, b);
3939
}
4040

4141
std::tuple<std::array<std::array<uint32_t, 2>, 2>,
4242
std::array<std::array<int32_t, 4>, 4>>
43-
exports::test::fixed_size_lists::to_test::LargeRoundtrip(std::array<std::array<uint32_t, 2>, 2> a,
43+
to_test::LargeRoundtrip(std::array<std::array<uint32_t, 2>, 2> a,
4444
std::array<std::array<int32_t, 4>, 4> b) {
4545
return std::tuple<std::array<std::array<uint32_t, 2>, 2>,
4646
std::array<std::array<int32_t, 4>, 4>>(a, b);
4747
}
48-
std::array<::test::fixed_size_lists::to_test::Nested, 2>
49-
exports::test::fixed_size_lists::to_test::NightmareOnCpp(std::array<::test::fixed_size_lists::to_test::Nested, 2> a) {
48+
std::array<to_test::Nested, 2>
49+
to_test::NightmareOnCpp(std::array<to_test::Nested, 2> a) {
5050
return a;
5151
}

0 commit comments

Comments
 (0)