Skip to content
Snippets Groups Projects
Commit 38896a52 authored by Josh Brooks's avatar Josh Brooks
Browse files

Fix tests and formatting

parent 2670a149
No related branches found
No related tags found
2 merge requests!53Release,!46fixed more bugs
...@@ -89,7 +89,6 @@ var singleCmd = &cobra.Command{ ...@@ -89,7 +89,6 @@ var singleCmd = &cobra.Command{
jww.FATAL.Panicf("Could not add single use process: %+v", err) jww.FATAL.Panicf("Could not add single use process: %+v", err)
} }
for numReg, total := 1, 100; numReg < total; { for numReg, total := 1, 100; numReg < total; {
time.Sleep(1 * time.Second) time.Sleep(1 * time.Second)
numReg, total, err = client.GetNodeRegistrationStatus() numReg, total, err = client.GetNodeRegistrationStatus()
...@@ -100,7 +99,6 @@ var singleCmd = &cobra.Command{ ...@@ -100,7 +99,6 @@ var singleCmd = &cobra.Command{
numReg, total) numReg, total)
} }
timeout := viper.GetDuration("timeout") timeout := viper.GetDuration("timeout")
// If the send flag is set, then send a message // If the send flag is set, then send a message
......
...@@ -120,8 +120,6 @@ func handleTrigger(sess *storage.Session, net interfaces.NetworkManager, ...@@ -120,8 +120,6 @@ func handleTrigger(sess *storage.Session, net interfaces.NetworkManager,
MessageType: message.KeyExchangeConfirm, MessageType: message.KeyExchangeConfirm,
} }
//send the message under the key exchange //send the message under the key exchange
e2eParams := params.GetDefaultE2E() e2eParams := params.GetDefaultE2E()
......
...@@ -111,7 +111,6 @@ func TestStateVector_Next(t *testing.T) { ...@@ -111,7 +111,6 @@ func TestStateVector_Next(t *testing.T) {
} }
} }
// Shows that Next mutates vector state as expected // Shows that Next mutates vector state as expected
// Shows that Next can find key indexes all throughout the bitfield // Shows that Next can find key indexes all throughout the bitfield
// A bug was found when the next avalible was in the first index of a word, this tests that case // A bug was found when the next avalible was in the first index of a word, this tests that case
......
...@@ -55,7 +55,6 @@ func newCheckedRounds(maxRounds int, store *utility.BlockStore) *CheckedRounds { ...@@ -55,7 +55,6 @@ func newCheckedRounds(maxRounds int, store *utility.BlockStore) *CheckedRounds {
recent: make([]id.Round, 0, maxRounds), recent: make([]id.Round, 0, maxRounds),
store: store, store: store,
maxRounds: maxRounds, maxRounds: maxRounds,
} }
} }
......
...@@ -177,7 +177,7 @@ func makeTestE2EMessages(n int, t *testing.T) ([]e2eMessage, []message.Send) { ...@@ -177,7 +177,7 @@ func makeTestE2EMessages(n int, t *testing.T) ([]e2eMessage, []message.Send) {
} }
func TestE2EParamMarshalUnmarshal(t *testing.T) { func TestE2EParamMarshalUnmarshal(t *testing.T) {
msg := e2eMessage{ msg := &e2eMessage{
Recipient: id.DummyUser[:], Recipient: id.DummyUser[:],
Payload: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9}, Payload: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9},
MessageType: 42, MessageType: 42,
...@@ -192,13 +192,15 @@ func TestE2EParamMarshalUnmarshal(t *testing.T) { ...@@ -192,13 +192,15 @@ func TestE2EParamMarshalUnmarshal(t *testing.T) {
}, },
} }
fmt.Printf("msg1: %#v\n", msg)
b, err := json.Marshal(&msg) b, err := json.Marshal(&msg)
if err != nil { if err != nil {
t.Errorf("Failed to Marshal E2eMessage") t.Errorf("Failed to Marshal E2eMessage")
} }
fmt.Printf("%s\n", string(b)) fmt.Printf("json: %s\n", string(b))
msg2 := &e2eMessage{} msg2 := &e2eMessage{}
...@@ -208,7 +210,7 @@ func TestE2EParamMarshalUnmarshal(t *testing.T) { ...@@ -208,7 +210,7 @@ func TestE2EParamMarshalUnmarshal(t *testing.T) {
t.Errorf("Failed to Unmarshal E2eMessage") t.Errorf("Failed to Unmarshal E2eMessage")
} }
fmt.Printf("%#v\n", msg2) fmt.Printf("msg2: %#v\n", msg2)
if !reflect.DeepEqual(msg, msg2) { if !reflect.DeepEqual(msg, msg2) {
t.Errorf("Unmarshaled message is not the same") t.Errorf("Unmarshaled message is not the same")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment