MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestIncCounterSimpleArgs

Function TestIncCounterSimpleArgs

rpc/mux/server_test.go:155–186  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

153}
154
155func TestIncCounterSimpleArgs(t *testing.T) {
156 log.SetLevel(log.FatalLevel)
157 addr := "127.0.0.1:0"
158 l, err := net.Listen("tcp", addr)
159 if err != nil {
160 log.Fatal(err)
161 }
162
163 server, err := NewServerWithService(ServiceMap{"Test": NewTestService()})
164 server.SetListener(l)
165 go server.WithAcceptConnFunc(rpc.AcceptRawConn).Serve()
166
167 conn, err := net.Dial("tcp", l.Addr().String())
168 if err != nil {
169 log.Fatal(err)
170 }
171 stream, err := NewOneOffMuxConn(conn)
172 if err != nil {
173 log.Fatal(err)
174 }
175 client := rpc.NewClient(stream)
176
177 repSimple := new(int32)
178 err = client.Call("Test.IncCounterSimpleArgs", 10, repSimple)
179 if err != nil {
180 log.Fatal(err)
181 }
182 CheckNum(*repSimple, 10, t)
183
184 _ = client.Close()
185 server.Stop()
186}
187
188func TestEncryptIncCounterSimpleArgs(t *testing.T) {
189 defer utils.RemoveAll(PubKeyStorePath + "*")

Callers

nothing calls this directly

Calls 15

CallMethod · 0.95
CloseMethod · 0.95
SetLevelFunction · 0.92
FatalFunction · 0.92
NewClientFunction · 0.92
NewOneOffMuxConnFunction · 0.85
SetListenerMethod · 0.80
AddrMethod · 0.80
NewServerWithServiceFunction · 0.70
NewTestServiceFunction · 0.70
CheckNumFunction · 0.70
ServeMethod · 0.45

Tested by

no test coverage detected