本文整理汇总了Golang中gen/thrifttest.ThriftTestClient.TestInsanity方法的典型用法代码示例。如果您正苦于以下问题:Golang ThriftTestClient.TestInsanity方法的具体用法?Golang ThriftTestClient.TestInsanity怎么用?Golang ThriftTestClient.TestInsanity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gen/thrifttest.ThriftTestClient
的用法示例。
在下文中一共展示了ThriftTestClient.TestInsanity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: callEverything
//.........这里部分代码省略.........
t.Fatalf("Unexpected error in TestTypedef() call: ", err)
}
if tret != thrifttest.UserId(42) {
t.Fatalf("Unexpected TestTypedef() result expected %#v, got %#v ", thrifttest.UserId(42), tret)
}
mapmap, err := client.TestMapMap(42)
if err != nil {
t.Fatalf("Unexpected error in TestMapMap() call: ", err)
}
if !reflect.DeepEqual(mapmap, rmapmap) {
t.Fatalf("Unexpected TestMapMap() result expected %#v, got %#v ", rmapmap, mapmap)
}
crazy := thrifttest.NewInsanity()
crazy.UserMap = map[thrifttest.Numberz]thrifttest.UserId{
thrifttest.Numberz_FIVE: 5,
thrifttest.Numberz_EIGHT: 8,
}
truck1 := thrifttest.NewXtruct()
truck1.StringThing = "Goodbye4"
truck1.ByteThing = 4
truck1.I32Thing = 4
truck1.I64Thing = 4
truck2 := thrifttest.NewXtruct()
truck2.StringThing = "Hello2"
truck2.ByteThing = 2
truck2.I32Thing = 2
truck2.I64Thing = 2
crazy.Xtructs = []*thrifttest.Xtruct{
truck1,
truck2,
}
insanity, err := client.TestInsanity(crazy)
if err != nil {
t.Fatalf("Unexpected error in TestInsanity() call: ", err)
}
if !reflect.DeepEqual(crazy, insanity[1][2]) {
t.Fatalf("Unexpected TestInsanity() first result expected %#v, got %#v ",
crazy,
insanity[1][2])
}
if !reflect.DeepEqual(crazy, insanity[1][3]) {
t.Fatalf("Unexpected TestInsanity() second result expected %#v, got %#v ",
crazy,
insanity[1][3])
}
if len(insanity[2][6].UserMap) > 0 || len(insanity[2][6].Xtructs) > 0 {
t.Fatalf("Unexpected TestInsanity() non-empty result got %#v ",
insanity[2][6])
}
xxsret, err := client.TestMulti(42, 4242, 424242, map[int16]string{1: "blah", 2: "thing"}, thrifttest.Numberz_EIGHT, thrifttest.UserId(24))
if err != nil {
t.Fatalf("Unexpected error in TestMulti() call: ", err)
}
if !reflect.DeepEqual(xxs, xxsret) {
t.Fatalf("Unexpected TestMulti() result expected %#v, got %#v ", xxs, xxsret)
}
err = client.TestException("Xception")
if err == nil {
t.Fatalf("Expecting exception in TestException() call")
}
if !reflect.DeepEqual(err, xcept) {
t.Fatalf("Unexpected TestException() result expected %#v, got %#v ", xcept, err)