Fix test
parent
0992da120a
commit
fc0239afc8
|
@ -197,10 +197,12 @@ void test_voxel_data_map_copy() {
|
|||
|
||||
void test_encode_weights_packed_u16() {
|
||||
FixedArray<uint8_t, 4> weights;
|
||||
weights[0] = 1;
|
||||
weights[1] = 5;
|
||||
weights[2] = 10;
|
||||
weights[3] = 15;
|
||||
// There is data loss of the 4 smaller bits in this encoding,
|
||||
// so to test this we may use values greater than 16
|
||||
weights[0] = 1 << 4;
|
||||
weights[1] = 5 << 4;
|
||||
weights[2] = 10 << 4;
|
||||
weights[3] = 15 << 4;
|
||||
const uint16_t encoded_weights = encode_weights_to_packed_u16(weights[0], weights[1], weights[2], weights[3]);
|
||||
FixedArray<uint8_t, 4> decoded_weights = decode_weights_from_packed_u16(encoded_weights);
|
||||
ERR_FAIL_COND(weights != decoded_weights);
|
||||
|
|
Loading…
Reference in New Issue