blob: ac4b625967108e1a4c80bbea86b8c881f24e3353 [file] [log] [blame]
// 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;
enum MyError : int32 {
BAD_ERROR = 1;
REALLY_BAD_ERROR = 2;
};
struct HandleStruct {
handle<event> h;
};
struct VectorStruct {
vector<HandleStruct> v;
};
union HandleUnion {
1: handle<event> h;
};
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);
};