498b235461
Build and test / Build and test AMD64 Ubuntu 22.04 (push) Failing after 0s
Publish Builder / amazonlinux2023 (push) Failing after 1s
Build and test / UT for Cpp (push) Waiting to run
Build and test / UT for Go (push) Has been skipped
Publish KRTE Images / KRTE (push) Failing after 1s
Build and test / Integration Test (push) Has been skipped
Build and test / Upload Code Coverage (push) Has been skipped
Publish Builder / rockylinux9 (push) Failing after 1s
Publish Builder / ubuntu22.04 (push) Failing after 0s
Publish Builder / ubuntu24.04 (push) Failing after 0s
Publish Gpu Builder / publish-gpu-builder (push) Failing after 1s
Publish Test Images / PyTest (push) Failing after 0s
45 lines
698 B
Go
45 lines
698 B
Go
package common
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCloneByteSlice(t *testing.T) {
|
|
type args struct {
|
|
s ByteSlice
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
args args
|
|
want ByteSlice
|
|
}{
|
|
{
|
|
args: args{s: []byte{0x0}},
|
|
want: []byte{0x0},
|
|
},
|
|
{
|
|
args: args{s: []byte{0xff}},
|
|
want: []byte{0xff},
|
|
},
|
|
{
|
|
args: args{s: []byte{0x0f}},
|
|
want: []byte{0x0f},
|
|
},
|
|
{
|
|
args: args{s: []byte{0xf0}},
|
|
want: []byte{0xf0},
|
|
},
|
|
{
|
|
args: args{s: []byte{0x0, 0xff, 0x0f, 0xf0}},
|
|
want: []byte{0x0, 0xff, 0x0f, 0xf0},
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
assert.True(t, tt.want.Equal(tt.args.s))
|
|
})
|
|
}
|
|
}
|