Skip to content
Snippets Groups Projects
Commit 384985a3 authored by Jonah Husson's avatar Jonah Husson
Browse files

Fix tests

parent f96ca463
No related branches found
No related tags found
2 merge requests!510Release,!240Integration update, allow client to use both broadcast methods
......@@ -56,11 +56,16 @@ func Test_asymmetricClient_Smoke(t *testing.T) {
cbChan <- payload
}
s, err := NewBroadcastChannel(channel, cb, newMockCmix(cMixHandler), rngGen, Param{Method: Asymmetric})
s, err := NewBroadcastChannel(channel, newMockCmix(cMixHandler), rngGen)
if err != nil {
t.Errorf("Failed to create broadcast channel: %+v", err)
}
err = s.RegisterListener(cb, Asymmetric)
if err != nil {
t.Errorf("Failed to register listener: %+v", err)
}
cbChans[i] = cbChan
clients[i] = s
......@@ -73,7 +78,7 @@ func Test_asymmetricClient_Smoke(t *testing.T) {
// Send broadcast from each client
for i := range clients {
payload := make([]byte, clients[i].MaxPayloadSize())
payload := make([]byte, clients[i].MaxAsymmetricPayloadSize())
copy(payload,
fmt.Sprintf("Hello from client %d of %d.", i, len(clients)))
......@@ -112,7 +117,7 @@ func Test_asymmetricClient_Smoke(t *testing.T) {
clients[i].Stop()
}
payload := make([]byte, clients[0].MaxPayloadSize())
payload := make([]byte, clients[0].MaxAsymmetricPayloadSize())
copy(payload, "This message should not get through.")
// Start waiting on channels and error if anything is received
......
......@@ -63,10 +63,16 @@ func Test_symmetricClient_Smoke(t *testing.T) {
cbChan <- payload
}
s, err := NewBroadcastChannel(channel, cb, newMockCmix(cMixHandler), rngGen, Param{Method: Symmetric})
s, err := NewBroadcastChannel(channel, newMockCmix(cMixHandler), rngGen)
if err != nil {
t.Errorf("Failed to create broadcast channel: %+v", err)
}
err = s.RegisterListener(cb, Symmetric)
if err != nil {
t.Errorf("Failed to register listener: %+v", err)
}
cbChans[i] = cbChan
clients[i] = s
......
......@@ -124,7 +124,7 @@ var broadcastCmd = &cobra.Command{
// Load key if needed
if pk == nil && keyPath != "" {
jww.DEBUG.Printf("Attempting to load private key at %s")
jww.DEBUG.Printf("Attempting to load private key at %s", keyPath)
if ep, err := utils.ExpandPath(keyPath); err == nil {
keyBytes, err := utils.ReadFile(ep)
if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment