diff --git a/rtmp/rtmp_test.go b/rtmp/rtmp_test.go index 2cc7dff6..f3252ce3 100644 --- a/rtmp/rtmp_test.go +++ b/rtmp/rtmp_test.go @@ -81,7 +81,7 @@ func TestMemset(t *testing.T) { if i > setNum-1 { testVal = byte(0) } - if *indxBytePtr(mem, i) != testVal { + if (*[_Gi]byte)(unsafe.Pointer(mem))[i] != testVal { t.Errorf("mem doesn't match expected values at: %v", i) } } @@ -94,7 +94,7 @@ func TestGoStrToCStr(t *testing.T) { testData := []byte{'s', 't', 'r', 'i', 'n', 'g', '\000'} for i := 0; i < len(goStr); i++ { - val := *indxBytePtr(unsafe.Pointer(bStr), i) + val := (*[_Gi]byte)(unsafe.Pointer(bStr))[i] testVal := testData[i] if val != testVal { t.Errorf("Wanted: %v, but got: %v", testVal, val) @@ -111,7 +111,7 @@ func TestStrdup(t *testing.T) { newStr := strdup(bStr) for i := 0; i < len(goStr); i++ { - val := *indxBytePtr(unsafe.Pointer(newStr), i) + val := (*[_Gi]byte)(unsafe.Pointer(newStr))[i] testVal := testData[i] if val != testVal { t.Errorf("Wanted: %v, but got: %v", testVal, val) @@ -191,12 +191,3 @@ func TestDecPtr(t *testing.T) { t.Errorf(errMsg, valueInt64, int64Arr[inc]) } } - -func TestIndxBytePtr(t *testing.T) { - // Test how it deals with bytes - bytePtr := unsafe.Pointer(&byteArr[arrStart]) - valueByte := indxBytePtr(bytePtr, inc) - if *valueByte != byteArr[inc] { - t.Errorf(errMsg, valueByte, byteArr[inc]) - } -}