From a83a99812e2313440d210f05839bc0c59c7aeec8 Mon Sep 17 00:00:00 2001 From: harjas Date: Sun, 24 Oct 2021 16:31:16 +0530 Subject: [PATCH] Refactor the test file --- eth/{rpc_test.go => rpcCmpTest.go} | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) rename eth/{rpc_test.go => rpcCmpTest.go} (99%) diff --git a/eth/rpc_test.go b/eth/rpcCmpTest.go similarity index 99% rename from eth/rpc_test.go rename to eth/rpcCmpTest.go index bae5fea40..015fec40f 100644 --- a/eth/rpc_test.go +++ b/eth/rpcCmpTest.go @@ -1,15 +1,14 @@ -package eth +package main import ( "bytes" "fmt" "io/ioutil" "net/http" - "testing" "time" ) -func Test10KB(t *testing.T) { +func Test10KB() { url := "http://127.0.0.1:9500" var method = "624fbfdc" var loc = "0000000000000000000000000000000000000000000000000000000000000020" @@ -40,7 +39,7 @@ func Test10KB(t *testing.T) { fmt.Println("Average time taken(in Ns) over 10 iterations: ", avgTimeNS/10) } -func Test100KB(t *testing.T) { +func Test100KB() { url := "http://127.0.0.1:9500" var method = "624fbfdc" var loc = "0000000000000000000000000000000000000000000000000000000000000020" @@ -71,7 +70,7 @@ func Test100KB(t *testing.T) { fmt.Println("Average time taken(in Ns) over 10 iterations: ", avgTimeNS/10) } -func Test1MB(t *testing.T) { +func Test1MB() { url := "http://127.0.0.1:9500" var method = "624fbfdc" var loc = "0000000000000000000000000000000000000000000000000000000000000020" @@ -101,3 +100,9 @@ func Test1MB(t *testing.T) { } fmt.Println("Average time taken(in Ns) over 10 iterations: ", avgTimeNS/10) } + +func main() { + Test10KB() + Test100KB() + Test1MB() +}