X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/9cf66aeafbcbb9237fedc2efc97cc2856eb60f7f..1a37f0144d0fd777771c6d870e3c3298947e2712:/hotline/news_test.go?ds=sidebyside diff --git a/hotline/news_test.go b/hotline/news_test.go index 44776dd..3871ec2 100644 --- a/hotline/news_test.go +++ b/hotline/news_test.go @@ -1,7 +1,7 @@ package hotline import ( - "reflect" + "github.com/stretchr/testify/assert" "testing" ) @@ -12,9 +12,9 @@ func TestNewsCategoryListData15_MarshalBinary(t *testing.T) { Articles map[uint32]*NewsArtData SubCats map[string]NewsCategoryListData15 Count []byte - AddSN []byte - DeleteSN []byte - GUID []byte + AddSN [4]byte + DeleteSN [4]byte + GUID [16]byte } tests := []struct { name string @@ -60,8 +60,8 @@ func TestNewsCategoryListData15_MarshalBinary(t *testing.T) { 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x66, 0x6f, 0x6f, }, @@ -75,7 +75,6 @@ func TestNewsCategoryListData15_MarshalBinary(t *testing.T) { Name: tt.fields.Name, Articles: tt.fields.Articles, SubCats: tt.fields.SubCats, - Count: tt.fields.Count, AddSN: tt.fields.AddSN, DeleteSN: tt.fields.DeleteSN, GUID: tt.fields.GUID, @@ -91,7 +90,7 @@ func TestNewsCategoryListData15_MarshalBinary(t *testing.T) { t.Errorf("MarshalBinary() error = %v, wantErr %v", err, tt.wantErr) return } - if !reflect.DeepEqual(gotData, tt.wantData) { + if !assert.Equal(t, tt.wantData, gotData) { t.Errorf("MarshalBinary() gotData = %v, want %v", gotData, tt.wantData) } })