Skip to content
Snippets Groups Projects
Commit 8e39fe5c authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Update deps and re-enable test

parent e968b2f4
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ require (
gitlab.com/elixxir/comms v0.0.0-20201006010513-3353fb46569a
gitlab.com/elixxir/crypto v0.0.0-20201006010428-67a8782d097e
gitlab.com/elixxir/ekv v0.1.3
gitlab.com/elixxir/primitives v0.0.0-20201006010327-c2f93eb587e3
gitlab.com/elixxir/primitives v0.0.0-20201007182231-b9aef2de8219
gitlab.com/xx_network/comms v0.0.0-20200924225518-0c867207b1e6
gitlab.com/xx_network/crypto v0.0.0-20200812183430-c77a5281c686
gitlab.com/xx_network/primitives v0.0.0-20200915204206-eb0287ed0031
......
......@@ -369,6 +369,8 @@ gitlab.com/elixxir/primitives v0.0.0-20201005231810-020916f67bd6 h1:ZE7ee4VIr7j4
gitlab.com/elixxir/primitives v0.0.0-20201005231810-020916f67bd6/go.mod h1:kNp47yPqja2lHSiS4DddTvFpB/4D9dB2YKnw5c+LJCE=
gitlab.com/elixxir/primitives v0.0.0-20201006010327-c2f93eb587e3 h1:nQG+LWzYfXiDT+4xPQ2U9sHUM6J51zmL220aSjIEvx4=
gitlab.com/elixxir/primitives v0.0.0-20201006010327-c2f93eb587e3/go.mod h1:kNp47yPqja2lHSiS4DddTvFpB/4D9dB2YKnw5c+LJCE=
gitlab.com/elixxir/primitives v0.0.0-20201007182231-b9aef2de8219 h1:/5r1oFeLCv3XohMoHOflZjZdoGQC82v/rjeSkK7a/PU=
gitlab.com/elixxir/primitives v0.0.0-20201007182231-b9aef2de8219/go.mod h1:kNp47yPqja2lHSiS4DddTvFpB/4D9dB2YKnw5c+LJCE=
gitlab.com/xx_network/comms v0.0.0-20200805174823-841427dd5023/go.mod h1:owEcxTRl7gsoM8c3RQ5KAm5GstxrJp5tn+6JfQ4z5Hw=
gitlab.com/xx_network/comms v0.0.0-20200806235452-3a82720833ba h1:7nozLSNBX0CfP53DDiDNLJx9obhYGfGf5na0/c9rMso=
gitlab.com/xx_network/comms v0.0.0-20200806235452-3a82720833ba/go.mod h1:idLzPGYig57XE7xuU93OlIF9s6NgSJj7OArQvsd5DjY=
......
......@@ -33,46 +33,42 @@ func TestNewKnownRounds(t *testing.T) {
}
}
// // Tests happy path of LoadKnownRounds.
// func TestLoadKnownRounds(t *testing.T) {
// // Set up expected value
// size := 10
// rootKv := versioned.NewKV(make(ekv.Memstore))
// expectedKR := &KnownRounds{
// rounds: knownRounds.NewKnownRound(size),
// kv: rootKv.Prefix(knownRoundsPrefix),
// key: "testKey",
// }
// Tests happy path of LoadKnownRounds.
func TestLoadKnownRounds(t *testing.T) {
// Set up expected value
size := 10
rootKv := versioned.NewKV(make(ekv.Memstore))
expectedKR := &KnownRounds{
rounds: knownRounds.NewKnownRound(size),
kv: rootKv.Prefix(knownRoundsPrefix),
key: "testKey",
}
// // Check rounds in the buffer and save the key value store
// expectedKR.rounds.Check(id.Round(0))
// for i := 0; i < (size * 64); i++ {
// if i%7 == 0 {
// t.Errorf("%+v",
// expectedKR.rounds)
// expectedKR.rounds.Check(id.Round(i))
// }
// }
// err := expectedKR.save()
// if err != nil {
// t.Fatalf("Error saving KnownRounds: %v", err)
// }
// Check rounds in the buffer and save the key value store
expectedKR.rounds.Check(id.Round(0))
for i := 0; i < (size * 64); i++ {
if i%7 == 0 {
expectedKR.rounds.Check(id.Round(i))
}
}
err := expectedKR.save()
if err != nil {
t.Fatalf("Error saving KnownRounds: %v", err)
}
// // *63 here instead of *64 because the calculation on the initializer
// // in primitives is weird, and we need the exact size for DeepEqual
// kr, err := LoadKnownRounds(rootKv, expectedKR.key, size*63)
// if err != nil {
// t.Errorf("LoadKnownRounds() returned an error."+
// "\n\texpected: %v\n\treceived: %+v", nil, err)
// }
kr, err := LoadKnownRounds(rootKv, expectedKR.key, size)
if err != nil {
t.Errorf("LoadKnownRounds() returned an error."+
"\n\texpected: %v\n\treceived: %+v", nil, err)
}
// if !reflect.DeepEqual(expectedKR, kr) {
// t.Errorf("LoadKnownRounds() returned an incorrect KnownRounds."+
// "\n\texpected: %+v\n\treceived: %+v", expectedKR, kr)
// t.Errorf("%+v != \n%+v",
// expectedKR.rounds, kr.rounds)
// }
// }
if !reflect.DeepEqual(expectedKR, kr) {
t.Errorf("LoadKnownRounds() returned an incorrect KnownRounds."+
"\n\texpected: %+v\n\treceived: %+v", expectedKR, kr)
t.Errorf("%+v != \n%+v",
expectedKR.rounds, kr.rounds)
}
}
// Tests happy path of KnownRounds.save().
func TestKnownRounds_save(t *testing.T) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment