Updated *gob integration tests

This commit is contained in:
Trial97
2020-04-27 16:19:15 +03:00
committed by Dan Christian Bogos
parent 6c9bb70138
commit c3cea2d52d
29 changed files with 172 additions and 229 deletions

View File

@@ -67,9 +67,6 @@ func TestSessionsData(t *testing.T) {
default:
t.Fatal("Unknown Database type")
}
if *encoding == utils.MetaGOB {
dataCfgDIR += "_gob"
}
for _, stest := range SessionsDataTests {
t.Run(dataCfgDIR, stest)
}
@@ -673,7 +670,7 @@ func testSessionsDataTTLExpMultiUpdates(t *testing.T) {
var initRpl *V1InitSessionReply
if err := sDataRPC.Call(utils.SessionSv1InitiateSession,
initArgs, &initRpl); err != nil {
t.Error(err)
t.Fatal(err)
}
time.Sleep(10 * time.Millisecond) // give some time to allow the session to be created
if initRpl.MaxUsage.Nanoseconds() != usage {
@@ -801,7 +798,7 @@ func testSessionsDataMultipleDataNoUsage(t *testing.T) {
var initRpl *V1InitSessionReply
if err := sDataRPC.Call(utils.SessionSv1InitiateSession,
initArgs, &initRpl); err != nil {
t.Error(err)
t.Fatal(err)
}
if initRpl.MaxUsage.Nanoseconds() != usage {
t.Errorf("Expecting : %+v, received: %+v", usage, initRpl.MaxUsage.Nanoseconds())
@@ -899,10 +896,16 @@ func testSessionsDataMultipleDataNoUsage(t *testing.T) {
updateRpl = new(V1UpdateSessionReply) // because gob doesn't overwrite 0 value fields
if err := sDataRPC.Call(utils.SessionSv1UpdateSession, updateArgs, &updateRpl); err != nil {
t.Error(err)
t.Fatal(err)
}
if updateRpl.MaxUsage.Nanoseconds() != usage {
t.Errorf("Expected: %+v, received: %+v", usage, updateRpl.MaxUsage.Nanoseconds())
if *encoding != utils.MetaGOB {
if updateRpl.MaxUsage.Nanoseconds() != usage {
t.Errorf("Expected: %+v, received: %+v", usage, updateRpl.MaxUsage.Nanoseconds())
}
} else {
if updateRpl.MaxUsage != nil { // gob returns 0 values as nil
t.Errorf("Expected: nil, received: %+v", updateRpl.MaxUsage)
}
}
eAcntVal = 100352.000000

View File

@@ -65,9 +65,6 @@ func TestSessionsIt(t *testing.T) {
default:
t.Fatal("Unknown Database type")
}
if *encoding == utils.MetaGOB {
sItCfgDIR += "_gob"
}
for _, stest := range sessionsITtests {
t.Run(sItCfgDIR, stest)
}

View File

@@ -70,9 +70,6 @@ func TestSessionsVoice(t *testing.T) {
default:
t.Fatal("Unknown Database type")
}
if *encoding == utils.MetaGOB {
voiceCfgDIR += "_gob"
}
for _, stest := range sessionsVoiceTests {
t.Run(voiceCfgDIR, stest)
}