| // 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. |
| |
| library llcpptest.protocol.test; |
| |
| using zx; |
| |
| enum MyError : int32 { |
| BAD_ERROR = 1; |
| REALLY_BAD_ERROR = 2; |
| }; |
| |
| resource struct HandleStruct { |
| zx.handle:EVENT h; |
| }; |
| |
| resource struct VectorStruct { |
| vector<HandleStruct> v; |
| }; |
| |
| resource union HandleUnion { |
| 1: zx.handle:EVENT h; |
| }; |
| |
| resource struct HandleUnionStruct { |
| HandleUnion u; |
| }; |
| |
| /// Protocol for testing methods with error types. |
| /// In the implementation, each method is hardcoded to return either the |
| /// success or the error case. This should follow the naming of the method, |
| /// e.g. ReturnPrimitiveError will always return the error case. |
| protocol ErrorMethods { |
| NoArgsPrimitiveError(bool should_error) -> () error int32; |
| ManyArgsCustomError(bool should_error) -> (int32 a, int32 b, int32 c) error MyError; |
| }; |
| |
| protocol Frobinator { |
| Frob(string value); |
| Grob(string value) -> (string value); |
| -> Hrob(string value); |
| }; |
| |
| protocol HandleProvider { |
| GetHandle() -> (HandleStruct value); |
| GetHandleVector(uint32 count) -> (vector<HandleStruct> value); |
| GetHandleUnion() -> (HandleUnionStruct value); |
| }; |
| |
| protocol Empty { |
| }; |