[skip e2e]Remove useless event header check func (#13573)

Signed-off-by: godchen0212 <qingxiang.chen@zilliz.com>
pull/13662/head
godchen 2021-12-17 19:00:14 +08:00 committed by GitHub
parent 35ac5b313d
commit ecd3dc5830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 22 deletions

View File

@ -26,28 +26,6 @@ import (
"github.com/stretchr/testify/assert"
)
/* #nosec G103 */
func checkEventHeader(
t *testing.T,
buf []byte,
tc EventTypeCode,
svrID int32,
length int32) {
ts := UnsafeReadInt64(buf, 0)
assert.Greater(t, ts, int64(0))
curTs := time.Now().UnixNano() / int64(time.Millisecond)
curTs = int64(tsoutil.ComposeTS(curTs, 0))
assert.GreaterOrEqual(t, curTs, ts)
utc := UnsafeReadInt8(buf, int(unsafe.Sizeof(ts)))
assert.Equal(t, EventTypeCode(utc), tc)
usID := UnsafeReadInt32(buf, int(unsafe.Sizeof(ts)+unsafe.Sizeof(utc)))
assert.Equal(t, usID, svrID)
elen := UnsafeReadInt32(buf, int(unsafe.Sizeof(ts)+unsafe.Sizeof(utc)+unsafe.Sizeof(usID)))
assert.Equal(t, elen, length)
nPos := UnsafeReadInt32(buf, int(unsafe.Sizeof(ts)+unsafe.Sizeof(utc)+unsafe.Sizeof(usID)+unsafe.Sizeof(elen)))
assert.Equal(t, nPos, length)
}
/* #nosec G103 */
func TestDescriptorEvent(t *testing.T) {
desc := newDescriptorEvent()