Skip to content

Commit

Permalink
extend tests
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Lehner <[email protected]>
  • Loading branch information
florianl committed Jan 18, 2025
1 parent 71a58c4 commit af8137b
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 0 deletions.
6 changes: 6 additions & 0 deletions f_bpf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,10 @@ func TestBpf(t *testing.T) {
t.Fatalf("unexpected error: %v", err)
}
})
t.Run("unmarshalBpf()", func(t *testing.T) {
err := unmarshalBpf([]byte{0x0}, nil)
if err == nil {
t.Fatalf("expected error but got none")
}
})
}
6 changes: 6 additions & 0 deletions f_flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,10 @@ func TestFlow(t *testing.T) {
t.Fatalf("unexpected error: %v", err)
}
})
t.Run("unmarshalFlow()", func(t *testing.T) {
err := unmarshalFlow([]byte{0x0}, nil)
if err == nil {
t.Fatalf("expected error but got none")
}
})
}
7 changes: 7 additions & 0 deletions f_flower_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,11 @@ func TestFlower(t *testing.T) {
t.Fatalf("unexpected error: %v", err)
}
})

t.Run("unmarshalFlower()", func(t *testing.T) {
err := unmarshalFlower([]byte{0x0}, nil)
if err == nil {
t.Fatalf("expected error but got none")
}
})
}
7 changes: 7 additions & 0 deletions f_fw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,11 @@ func TestFw(t *testing.T) {
t.Fatalf("unexpected error: %v", err)
}
})

t.Run("unmarshalFw()", func(t *testing.T) {
err := unmarshalFw([]byte{0x0}, nil)
if err == nil {
t.Fatalf("expected error but got none")
}
})
}
7 changes: 7 additions & 0 deletions f_matchall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,11 @@ func TestMatchall(t *testing.T) {
t.Fatalf("unexpected error: %v", err)
}
})

t.Run("unmarshalMatchall()", func(t *testing.T) {
err := unmarshalMatchall([]byte{0x0}, nil)
if err == nil {
t.Fatalf("expected error but got none")
}
})
}
7 changes: 7 additions & 0 deletions f_route4_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,11 @@ func TestRoute4(t *testing.T) {
t.Fatalf("unexpected error: %v", err)
}
})

t.Run("unmarshalRoute4()", func(t *testing.T) {
err := unmarshalRoute4([]byte{0x0}, nil)
if err == nil {
t.Fatalf("expected error but got none")
}
})
}
7 changes: 7 additions & 0 deletions f_rsvp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,11 @@ func TestRsvp(t *testing.T) {
t.Fatalf("unexpected error: %v", err)
}
})

t.Run("unmarshalRsvp()", func(t *testing.T) {
err := unmarshalRsvp([]byte{0x0}, nil)
if err == nil {
t.Fatalf("expected error but got none")
}
})
}
7 changes: 7 additions & 0 deletions f_tcindex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,11 @@ func TestTcIndex(t *testing.T) {
t.Fatalf("unexpected error: %v", err)
}
})

t.Run("unmarshalTcIndex()", func(t *testing.T) {
err := unmarshalTcIndex([]byte{0x0}, nil)
if err == nil {
t.Fatalf("expected error but got none")
}
})
}
7 changes: 7 additions & 0 deletions f_u32_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,11 @@ func TestU32(t *testing.T) {
t.Fatalf("unexpected error: %v", err)
}
})

t.Run("unmarshalU32()", func(t *testing.T) {
err := unmarshalU32([]byte{0x0}, nil)
if err == nil {
t.Fatalf("expected error but got none")
}
})
}
7 changes: 7 additions & 0 deletions m_bpf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,11 @@ func TestActBpft(t *testing.T) {
t.Fatalf("unexpected error: %v", err)
}
})

t.Run("unmarshalActBpf()", func(t *testing.T) {
err := unmarshalActBpf([]byte{0x0}, nil)
if err == nil {
t.Fatalf("expected error but got none")
}
})
}

0 comments on commit af8137b

Please sign in to comment.