diff --git a/tests/z_msgcodec_test.c b/tests/z_msgcodec_test.c index dcf051d41..b56b40a9f 100644 --- a/tests/z_msgcodec_test.c +++ b/tests/z_msgcodec_test.c @@ -184,7 +184,9 @@ _z_bytes_t gen_bytes(size_t len) { if (len == 0) return arr; arr.start = (uint8_t *)z_malloc(sizeof(uint8_t) * len); - for (_z_zint_t i = 0; i < len; i++) ((uint8_t *)arr.start)[i] = gen_uint8(); + for (_z_zint_t i = 0; i < len; i++) { + ((uint8_t *)arr.start)[i] = gen_uint8() & 0b01111111; + } return arr; }