(t *testing.T)
| 231 | } |
| 232 | |
| 233 | func TestComplexRPC(t *testing.T) { |
| 234 | l := serverComplex() |
| 235 | Convey("get addr", t, func() { |
| 236 | addr := l.Addr().String() |
| 237 | So(addr, ShouldEqual, serviceComplex) |
| 238 | }) |
| 239 | Convey("server client OK", t, func() { |
| 240 | argsComplex := &QueryComplex{ |
| 241 | DataS: struct{ Strs []string }{Strs: []string{"aaa", "bbbbbbb"}}, |
| 242 | } |
| 243 | ret, err := clientComplex(pass, argsComplex) |
| 244 | So(ret.Count, ShouldEqual, len(argsComplex.DataS.Strs)) |
| 245 | So(ret.Hash.Str, ShouldResemble, qHash(argsComplex)) |
| 246 | So(err, ShouldBeNil) |
| 247 | }) |
| 248 | Convey("server client pass error", t, func() { |
| 249 | argsComplex := &QueryComplex{ |
| 250 | DataS: struct{ Strs []string }{Strs: []string{"aaa", "bbbbbbb"}}, |
| 251 | } |
| 252 | ret, err := clientComplex(pass+"1", argsComplex) |
| 253 | So(ret, ShouldBeNil) |
| 254 | So(err, ShouldNotBeNil) |
| 255 | }) |
| 256 | |
| 257 | Convey("server client pass error", t, func() { |
| 258 | argsComplex := &QueryComplex{ |
| 259 | DataS: struct{ Strs []string }{Strs: []string{"aaa", "bbbbbbb"}}, |
| 260 | } |
| 261 | ret, err := clientComplex(strings.Repeat(pass, 100), argsComplex) |
| 262 | So(ret, ShouldBeNil) |
| 263 | So(err, ShouldNotBeNil) |
| 264 | }) |
| 265 | |
| 266 | Convey("server close", t, func() { |
| 267 | err := l.Close() |
| 268 | So(err, ShouldBeNil) |
| 269 | }) |
| 270 | } |
| 271 | |
| 272 | func TestCryptoConn_RW(t *testing.T) { |
| 273 | cipher := NewCipher([]byte(pass)) |
nothing calls this directly
no test coverage detected