|
|
|
@ -21,7 +21,7 @@ func TestBEUint16(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for i := 0; i < len(vector); i++ {
|
|
|
|
|
assert.Equal(t, vector[i].output, BEUint16(vector[i].input), "fxxk.")
|
|
|
|
|
assert.Equal(t, vector[i].output, BEUint16(vector[i].input))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -38,7 +38,7 @@ func TestBEUint24(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for i := 0; i < len(vector); i++ {
|
|
|
|
|
assert.Equal(t, vector[i].output, BEUint24(vector[i].input), "fxxk.")
|
|
|
|
|
assert.Equal(t, vector[i].output, BEUint24(vector[i].input))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -55,7 +55,7 @@ func TestBEUint32(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for i := 0; i < len(vector); i++ {
|
|
|
|
|
assert.Equal(t, vector[i].output, BEUint32(vector[i].input), "fxxk.")
|
|
|
|
|
assert.Equal(t, vector[i].output, BEUint32(vector[i].input))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -69,8 +69,8 @@ func TestBEFloat64(t *testing.T) {
|
|
|
|
|
for i := 0; i < len(vector); i++ {
|
|
|
|
|
b := &bytes.Buffer{}
|
|
|
|
|
err := binary.Write(b, binary.BigEndian, float64(vector[i]))
|
|
|
|
|
assert.Equal(t, nil, err, "fxxk.")
|
|
|
|
|
assert.Equal(t, vector[i], int(BEFloat64(b.Bytes())), "fxxk.")
|
|
|
|
|
assert.Equal(t, nil, err)
|
|
|
|
|
assert.Equal(t, vector[i], int(BEFloat64(b.Bytes())))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -87,7 +87,7 @@ func TestLEUint32(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for i := 0; i < len(vector); i++ {
|
|
|
|
|
assert.Equal(t, vector[i].output, LEUint32(vector[i].input), "fxxk.")
|
|
|
|
|
assert.Equal(t, vector[i].output, LEUint32(vector[i].input))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -106,7 +106,7 @@ func TestBEPutUint24(t *testing.T) {
|
|
|
|
|
out := make([]byte, 3)
|
|
|
|
|
for i := 0; i < len(vector); i++ {
|
|
|
|
|
BEPutUint24(out, vector[i].input)
|
|
|
|
|
assert.Equal(t, vector[i].output, out, "fxxk.")
|
|
|
|
|
assert.Equal(t, vector[i].output, out)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -125,7 +125,7 @@ func TestBEPutUint32(t *testing.T) {
|
|
|
|
|
out := make([]byte, 4)
|
|
|
|
|
for i := 0; i < len(vector); i++ {
|
|
|
|
|
BEPutUint32(out, vector[i].input)
|
|
|
|
|
assert.Equal(t, vector[i].output, out, "fxxk.")
|
|
|
|
|
assert.Equal(t, vector[i].output, out)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -144,7 +144,7 @@ func TestLEPutUint32(t *testing.T) {
|
|
|
|
|
out := make([]byte, 4)
|
|
|
|
|
for i := 0; i < len(vector); i++ {
|
|
|
|
|
LEPutUint32(out, vector[i].input)
|
|
|
|
|
assert.Equal(t, vector[i].output, out, "fxxk.")
|
|
|
|
|
assert.Equal(t, vector[i].output, out)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -163,8 +163,8 @@ func TestWriteBEUint24(t *testing.T) {
|
|
|
|
|
for i := 0; i < len(vector); i++ {
|
|
|
|
|
out := &bytes.Buffer{}
|
|
|
|
|
err := WriteBEUint24(out, vector[i].input)
|
|
|
|
|
assert.Equal(t, nil, err, "fxxk.")
|
|
|
|
|
assert.Equal(t, vector[i].output, out.Bytes(), "fxxk.")
|
|
|
|
|
assert.Equal(t, nil, err)
|
|
|
|
|
assert.Equal(t, vector[i].output, out.Bytes())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -179,8 +179,8 @@ func TestWriteBE(t *testing.T) {
|
|
|
|
|
for i := 0; i < len(vector); i++ {
|
|
|
|
|
out := &bytes.Buffer{}
|
|
|
|
|
err := WriteBE(out, vector[i].input)
|
|
|
|
|
assert.Equal(t, nil, err, "fxxk.")
|
|
|
|
|
assert.Equal(t, vector[i].output, out.Bytes(), "fxxk.")
|
|
|
|
|
assert.Equal(t, nil, err)
|
|
|
|
|
assert.Equal(t, vector[i].output, out.Bytes())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -195,8 +195,8 @@ func TestWriteLE(t *testing.T) {
|
|
|
|
|
for i := 0; i < len(vector); i++ {
|
|
|
|
|
out := &bytes.Buffer{}
|
|
|
|
|
err := WriteLE(out, vector[i].input)
|
|
|
|
|
assert.Equal(t, nil, err, "fxxk.")
|
|
|
|
|
assert.Equal(t, vector[i].output, out.Bytes(), "fxxk.")
|
|
|
|
|
assert.Equal(t, nil, err)
|
|
|
|
|
assert.Equal(t, vector[i].output, out.Bytes())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|