(t *testing.T)
| 24 | ) |
| 25 | |
| 26 | func TestReadUTF16LE_EvenByteCount(t *testing.T) { |
| 27 | // Test normal case: even byte count (valid UTF-16) |
| 28 | // "Hi" in UTF-16LE: 'H'=0x0048, 'i'=0x0069 |
| 29 | // Little-endian bytes: 48 00 69 00 |
| 30 | data := []byte{0x48, 0x00, 0x69, 0x00} |
| 31 | buf := NewByteBuffer(data) |
| 32 | err := &Error{} |
| 33 | |
| 34 | result := readUTF16LE(buf, 4, err) |
| 35 | |
| 36 | require.False(t, err.HasError()) |
| 37 | require.Equal(t, "Hi", result) |
| 38 | } |
| 39 | |
| 40 | func TestReadUTF16LE_OddByteCount(t *testing.T) { |
| 41 | // Test edge case: odd byte count (malformed UTF-16 data). |
nothing calls this directly
no test coverage detected