| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| // This is intended to ensure that the GIDL-generated test code produces the |
| // correct syntax for C++ bindings, which needs to distinguish between e.g. |
| // using "Foo foo;" vs "std::unique_ptr<Foo> foo;" for optional (nullable) |
| // fields, "object.foo()" vs "object->foo()" vs "object.set_foo()", etc. |
| |
| library test.conformance; |
| |
| type StructWithInt = struct { |
| x int32; |
| }; |
| |
| type StructWithArrays = struct { |
| arr_int array<int32, 2>; |
| arr_string array<string, 2>; |
| arr_nullable_string array<string:optional, 2>; |
| arr_struct array<StructWithInt, 2>; |
| arr_nullable_struct array<box<StructWithInt>, 2>; |
| arr_arr_int array<array<int32, 3>, 2>; |
| }; |
| |
| type StructWithVectors = struct { |
| vec_empty vector<int32>; |
| vec_int vector<int32>; |
| vec_string vector<string>; |
| vec_nullable_string vector<string:optional>; |
| vec_struct vector<StructWithInt>; |
| vec_nullable_struct vector<box<StructWithInt>>; |
| vec_vec_int vector<vector<int32>>; |
| }; |
| |
| type LargeArrays = struct { |
| a33 array<string:optional, 33>; |
| a100 array<uint8, 100>; |
| nested vector<array<array<string, 100>, 200>>; |
| }; |