Skip to content

Commit

Permalink
Fixes unit tests which failed through new validity checks of physical…
Browse files Browse the repository at this point in the history
… and group addresses.
  • Loading branch information
chr-fritz committed Jul 2, 2023
1 parent 01db65c commit 5fb05a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/knx/group-address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func TestGroupAddress_UnmarshalJSON(t *testing.T) {
want GroupAddress
wantErr bool
}{
{"0/0/0", []byte("0/0/0"), GroupAddress(0), false},
{"0/0/0", []byte("0/0/0"), GroupAddress(0), true},
{"0/0/1", []byte("0/0/1"), GroupAddress(1), false},
{"0/1/0", []byte("0/1/0"), GroupAddress(0x100), false},
{"31/7/0", []byte("31/7/0"), GroupAddress(0xFF00), false},
Expand All @@ -119,7 +119,7 @@ func TestGroupAddress_UnmarshalText(t *testing.T) {
want GroupAddress
wantErr bool
}{
{"0/0/0", []byte("0/0/0"), GroupAddress(0), false},
{"0/0/0", []byte("0/0/0"), GroupAddress(0), true},
{"0/0/1", []byte("0/0/1"), GroupAddress(1), false},
{"0/1/0", []byte("0/1/0"), GroupAddress(0x100), false},
{"31/7/0", []byte("31/7/0"), GroupAddress(0xFF00), false},
Expand All @@ -143,7 +143,7 @@ func TestNewGroupAddress(t *testing.T) {
want GroupAddress
wantErr bool
}{
{"0/0/0", GroupAddress(0), false},
{"0/0/0", GroupAddress(0), true},
{"0/0/1", GroupAddress(1), false},
{"0/0/1", GroupAddress(1), false},
{"0/1/0", GroupAddress(0x100), false},
Expand Down
6 changes: 3 additions & 3 deletions pkg/knx/physical-address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func TestPhysicalAddress_UnmarshalJSON(t *testing.T) {
want PhysicalAddress
wantErr bool
}{
{"0.0.0", []byte("0.0.0"), PhysicalAddress(0), false},
{"0.0.0", []byte("0.0.0"), PhysicalAddress(0), true},
{"0.0.1", []byte("0.0.1"), PhysicalAddress(1), false},
{"0.1.0", []byte("0.1.0"), PhysicalAddress(0x100), false},
{"15.15.0", []byte("15.15.0"), PhysicalAddress(0xFF00), false},
Expand All @@ -119,7 +119,7 @@ func TestPhysicalAddress_UnmarshalText(t *testing.T) {
want PhysicalAddress
wantErr bool
}{
{"0.0.0", []byte("0.0.0"), PhysicalAddress(0), false},
{"0.0.0", []byte("0.0.0"), PhysicalAddress(0), true},
{"0.0.1", []byte("0.0.1"), PhysicalAddress(1), false},
{"0.1.0", []byte("0.1.0"), PhysicalAddress(0x100), false},
{"15.15.0", []byte("15.15.0"), PhysicalAddress(0xFF00), false},
Expand All @@ -143,7 +143,7 @@ func TestNewPhysicalAddress(t *testing.T) {
want PhysicalAddress
wantErr bool
}{
{"0.0.0", PhysicalAddress(0), false},
{"0.0.0", PhysicalAddress(0), true},
{"0.0.1", PhysicalAddress(1), false},
{"0.0.1", PhysicalAddress(1), false},
{"0.1.0", PhysicalAddress(0x100), false},
Expand Down

0 comments on commit 5fb05a3

Please sign in to comment.