veyron/tools/vrpc: name unnamed array
Change-Id: I77b5085c10b594dd783920e3baa8a924078af894
diff --git a/tools/vrpc/test_base/test_base.vdl b/tools/vrpc/test_base/test_base.vdl
index e0406da..70e3b85 100644
--- a/tools/vrpc/test_base/test_base.vdl
+++ b/tools/vrpc/test_base/test_base.vdl
@@ -4,6 +4,8 @@
X,Y int32
}
+type Array2Int [2]int32
+
// TypeTester methods are listed in alphabetical order, to make it easier to
// test Signature output, which sorts methods alphabetically.
type TypeTester interface {
@@ -19,7 +21,7 @@
EchoUint64(I1 uint64) (O1 uint64 | error)
// Methods to test support for composite types.
- XEchoArray(I1 [2]int32) (O1 [2]int32 | error)
+ XEchoArray(I1 Array2Int) (O1 Array2Int | error)
XEchoMap(I1 map[int32]string) (O1 map[int32]string | error)
XEchoSet(I1 set[int32]) (O1 set[int32] | error)
XEchoSlice(I1 []int32) (O1 []int32 | error)
diff --git a/tools/vrpc/test_base/test_base.vdl.go b/tools/vrpc/test_base/test_base.vdl.go
index af0e095..11d7c40 100644
--- a/tools/vrpc/test_base/test_base.vdl.go
+++ b/tools/vrpc/test_base/test_base.vdl.go
@@ -22,8 +22,16 @@
}) {
}
+type Array2Int [2]int32
+
+func (Array2Int) __VDLReflect(struct {
+ Name string "v.io/core/veyron/tools/vrpc/test_base.Array2Int"
+}) {
+}
+
func init() {
__vdl.Register(Struct{})
+ __vdl.Register(Array2Int{})
}
// TypeTesterClientMethods is the client interface
@@ -43,7 +51,7 @@
EchoUint32(ctx *__context.T, I1 uint32, opts ...__ipc.CallOpt) (O1 uint32, err error)
EchoUint64(ctx *__context.T, I1 uint64, opts ...__ipc.CallOpt) (O1 uint64, err error)
// Methods to test support for composite types.
- XEchoArray(ctx *__context.T, I1 [2]int32, opts ...__ipc.CallOpt) (O1 [2]int32, err error)
+ XEchoArray(ctx *__context.T, I1 Array2Int, opts ...__ipc.CallOpt) (O1 Array2Int, err error)
XEchoMap(ctx *__context.T, I1 map[int32]string, opts ...__ipc.CallOpt) (O1 map[int32]string, err error)
XEchoSet(ctx *__context.T, I1 map[int32]struct{}, opts ...__ipc.CallOpt) (O1 map[int32]struct{}, err error)
XEchoSlice(ctx *__context.T, I1 []int32, opts ...__ipc.CallOpt) (O1 []int32, err error)
@@ -183,7 +191,7 @@
return
}
-func (c implTypeTesterClientStub) XEchoArray(ctx *__context.T, i0 [2]int32, opts ...__ipc.CallOpt) (o0 [2]int32, err error) {
+func (c implTypeTesterClientStub) XEchoArray(ctx *__context.T, i0 Array2Int, opts ...__ipc.CallOpt) (o0 Array2Int, err error) {
var call __ipc.Call
if call, err = c.c(ctx).StartCall(ctx, c.name, "XEchoArray", []interface{}{i0}, opts...); err != nil {
return
@@ -356,7 +364,7 @@
EchoUint32(ctx __ipc.ServerContext, I1 uint32) (O1 uint32, err error)
EchoUint64(ctx __ipc.ServerContext, I1 uint64) (O1 uint64, err error)
// Methods to test support for composite types.
- XEchoArray(ctx __ipc.ServerContext, I1 [2]int32) (O1 [2]int32, err error)
+ XEchoArray(ctx __ipc.ServerContext, I1 Array2Int) (O1 Array2Int, err error)
XEchoMap(ctx __ipc.ServerContext, I1 map[int32]string) (O1 map[int32]string, err error)
XEchoSet(ctx __ipc.ServerContext, I1 map[int32]struct{}) (O1 map[int32]struct{}, err error)
XEchoSlice(ctx __ipc.ServerContext, I1 []int32) (O1 []int32, err error)
@@ -384,7 +392,7 @@
EchoUint32(ctx __ipc.ServerContext, I1 uint32) (O1 uint32, err error)
EchoUint64(ctx __ipc.ServerContext, I1 uint64) (O1 uint64, err error)
// Methods to test support for composite types.
- XEchoArray(ctx __ipc.ServerContext, I1 [2]int32) (O1 [2]int32, err error)
+ XEchoArray(ctx __ipc.ServerContext, I1 Array2Int) (O1 Array2Int, err error)
XEchoMap(ctx __ipc.ServerContext, I1 map[int32]string) (O1 map[int32]string, err error)
XEchoSet(ctx __ipc.ServerContext, I1 map[int32]struct{}) (O1 map[int32]struct{}, err error)
XEchoSlice(ctx __ipc.ServerContext, I1 []int32) (O1 []int32, err error)
@@ -461,7 +469,7 @@
return s.impl.EchoUint64(ctx, i0)
}
-func (s implTypeTesterServerStub) XEchoArray(ctx __ipc.ServerContext, i0 [2]int32) ([2]int32, error) {
+func (s implTypeTesterServerStub) XEchoArray(ctx __ipc.ServerContext, i0 Array2Int) (Array2Int, error) {
return s.impl.XEchoArray(ctx, i0)
}
@@ -605,10 +613,10 @@
Name: "XEchoArray",
Doc: "// Methods to test support for composite types.",
InArgs: []__ipc.ArgDesc{
- {"I1", ``}, // [2]int32
+ {"I1", ``}, // Array2Int
},
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // [2]int32
+ {"O1", ``}, // Array2Int
{"err", ``}, // error
},
},
diff --git a/tools/vrpc/vrpc_test.go b/tools/vrpc/vrpc_test.go
index 429552f..05906ff 100644
--- a/tools/vrpc/vrpc_test.go
+++ b/tools/vrpc/vrpc_test.go
@@ -63,7 +63,7 @@
return i1, nil
}
-func (*server) XEchoArray(call ipc.ServerContext, i1 [2]int32) ([2]int32, error) {
+func (*server) XEchoArray(call ipc.ServerContext, i1 test_base.Array2Int) (test_base.Array2Int, error) {
vlog.VI(2).Info("XEchoArray(%v) was called.", i1)
return i1, nil
}
@@ -154,7 +154,7 @@
EchoUint32(I1 uint32) (O1 uint32 | error)
EchoUint64(I1 uint64) (O1 uint64 | error)
// Methods to test support for composite types.
- XEchoArray(I1 [2]int32) (O1 [2]int32 | error)
+ XEchoArray(I1 "v.io/core/veyron/tools/vrpc/test_base".Array2Int) (O1 "v.io/core/veyron/tools/vrpc/test_base".Array2Int | error)
XEchoMap(I1 map[int32]string) (O1 map[int32]string | error)
XEchoSet(I1 set[int32]) (O1 set[int32] | error)
XEchoSlice(I1 []int32) (O1 []int32 | error)
@@ -206,6 +206,8 @@
Tags []any
}
+type "v.io/core/veyron/tools/vrpc/test_base".Array2Int [2]int32
+
type "v.io/core/veyron/tools/vrpc/test_base".Struct struct {
X int32
Y int32
@@ -271,7 +273,7 @@
{"EchoByte", `33`, `byte(33)`},
{"EchoUint32", `44`, `uint32(44)`},
{"EchoUint64", `55`, `uint64(55)`},
- {"XEchoArray", `{1,2}`, `[2]int32{1, 2}`},
+ {"XEchoArray", `{1,2}`, `"v.io/core/veyron/tools/vrpc/test_base".Array2Int{1, 2}`},
{"XEchoMap", `{1:"a"}`, `map[int32]string{1: "a"}`},
{"XEchoSet", `{1}`, `set[int32]{1}`},
{"XEchoSlice", `{1,2}`, `[]int32{1, 2}`},