@ -40,11 +40,11 @@ func TestClientRequest(t *testing.T) {
client := DialInProc ( server )
client := DialInProc ( server )
defer client . Close ( )
defer client . Close ( )
var resp Result
var resp echo Result
if err := client . Call ( & resp , "test_echo" , "hello" , 10 , & Args { "world" } ) ; err != nil {
if err := client . Call ( & resp , "test_echo" , "hello" , 10 , & echo Args{ "world" } ) ; err != nil {
t . Fatal ( err )
t . Fatal ( err )
}
}
if ! reflect . DeepEqual ( resp , Result { "hello" , 10 , & Args { "world" } } ) {
if ! reflect . DeepEqual ( resp , echo Result{ "hello" , 10 , & echo Args{ "world" } } ) {
t . Errorf ( "incorrect result %#v" , resp )
t . Errorf ( "incorrect result %#v" , resp )
}
}
}
}
@ -58,13 +58,13 @@ func TestClientBatchRequest(t *testing.T) {
batch := [ ] BatchElem {
batch := [ ] BatchElem {
{
{
Method : "test_echo" ,
Method : "test_echo" ,
Args : [ ] interface { } { "hello" , 10 , & Args { "world" } } ,
Args : [ ] interface { } { "hello" , 10 , & echo Args{ "world" } } ,
Result : new ( Result ) ,
Result : new ( echo Result) ,
} ,
} ,
{
{
Method : "test_echo" ,
Method : "test_echo" ,
Args : [ ] interface { } { "hello2" , 11 , & Args { "world" } } ,
Args : [ ] interface { } { "hello2" , 11 , & echo Args{ "world" } } ,
Result : new ( Result ) ,
Result : new ( echo Result) ,
} ,
} ,
{
{
Method : "no_such_method" ,
Method : "no_such_method" ,
@ -78,13 +78,13 @@ func TestClientBatchRequest(t *testing.T) {
wantResult := [ ] BatchElem {
wantResult := [ ] BatchElem {
{
{
Method : "test_echo" ,
Method : "test_echo" ,
Args : [ ] interface { } { "hello" , 10 , & Args { "world" } } ,
Args : [ ] interface { } { "hello" , 10 , & echo Args{ "world" } } ,
Result : & Result { "hello" , 10 , & Args { "world" } } ,
Result : & echo Result{ "hello" , 10 , & echo Args{ "world" } } ,
} ,
} ,
{
{
Method : "test_echo" ,
Method : "test_echo" ,
Args : [ ] interface { } { "hello2" , 11 , & Args { "world" } } ,
Args : [ ] interface { } { "hello2" , 11 , & echo Args{ "world" } } ,
Result : & Result { "hello2" , 11 , & Args { "world" } } ,
Result : & echo Result{ "hello2" , 11 , & echo Args{ "world" } } ,
} ,
} ,
{
{
Method : "no_such_method" ,
Method : "no_such_method" ,
@ -104,7 +104,7 @@ func TestClientNotify(t *testing.T) {
client := DialInProc ( server )
client := DialInProc ( server )
defer client . Close ( )
defer client . Close ( )
if err := client . Notify ( context . Background ( ) , "test_echo" , "hello" , 10 , & Args { "world" } ) ; err != nil {
if err := client . Notify ( context . Background ( ) , "test_echo" , "hello" , 10 , & echo Args{ "world" } ) ; err != nil {
t . Fatal ( err )
t . Fatal ( err )
}
}
}
}
@ -393,9 +393,9 @@ func TestClientHTTP(t *testing.T) {
// Launch concurrent requests.
// Launch concurrent requests.
var (
var (
results = make ( [ ] Result , 100 )
results = make ( [ ] echo Result, 100 )
errc = make ( chan error )
errc = make ( chan error )
wantResult = Result { "a" , 1 , new ( Args ) }
wantResult = echo Result{ "a" , 1 , new ( echo Args) }
)
)
defer client . Close ( )
defer client . Close ( )
for i := range results {
for i := range results {
@ -450,7 +450,7 @@ func TestClientReconnect(t *testing.T) {
}
}
// Perform a call. This should work because the server is up.
// Perform a call. This should work because the server is up.
var resp Result
var resp echo Result
if err := client . CallContext ( ctx , & resp , "test_echo" , "" , 1 , nil ) ; err != nil {
if err := client . CallContext ( ctx , & resp , "test_echo" , "" , 1 , nil ) ; err != nil {
t . Fatal ( err )
t . Fatal ( err )
}
}
@ -478,7 +478,7 @@ func TestClientReconnect(t *testing.T) {
for i := 0 ; i < cap ( errors ) ; i ++ {
for i := 0 ; i < cap ( errors ) ; i ++ {
go func ( ) {
go func ( ) {
<- start
<- start
var resp Result
var resp echo Result
errors <- client . CallContext ( ctx , & resp , "test_echo" , "" , 3 , nil )
errors <- client . CallContext ( ctx , & resp , "test_echo" , "" , 3 , nil )
} ( )
} ( )
}
}