Lines Matching full:sizeof

114 	len = zms_read(fs, id, rd_buf, sizeof(rd_buf));  in execute_long_pattern_write()
117 BUILD_ASSERT((sizeof(wr_buf) % sizeof(pattern)) == 0); in execute_long_pattern_write()
118 for (int i = 0; i < sizeof(wr_buf); i += sizeof(pattern)) { in execute_long_pattern_write()
119 memcpy(wr_buf + i, pattern, sizeof(pattern)); in execute_long_pattern_write()
122 len = zms_write(fs, id, wr_buf, sizeof(wr_buf)); in execute_long_pattern_write()
123 zassert_true(len == sizeof(wr_buf), "zms_write failed: %d", len); in execute_long_pattern_write()
125 len = zms_read(fs, id, rd_buf, sizeof(rd_buf)); in execute_long_pattern_write()
126 zassert_true(len == sizeof(rd_buf), "zms_read unexpected failure: %d", len); in execute_long_pattern_write()
127 zassert_mem_equal(wr_buf, rd_buf, sizeof(rd_buf), "RD buff should be equal to the WR buff"); in execute_long_pattern_write()
177 err = zms_read(&fixture->fs, TEST_DATA_ID, rd_buf, sizeof(rd_buf)); in ZTEST_F()
180 BUILD_ASSERT((sizeof(wr_buf_1) % sizeof(pattern_1)) == 0); in ZTEST_F()
181 for (int i = 0; i < sizeof(wr_buf_1); i += sizeof(pattern_1)) { in ZTEST_F()
182 memcpy(wr_buf_1 + i, pattern_1, sizeof(pattern_1)); in ZTEST_F()
185 len = zms_write(&fixture->fs, TEST_DATA_ID, wr_buf_1, sizeof(wr_buf_1)); in ZTEST_F()
186 zassert_true(len == sizeof(wr_buf_1), "zms_write failed: %d", len); in ZTEST_F()
188 len = zms_read(&fixture->fs, TEST_DATA_ID, rd_buf, sizeof(rd_buf)); in ZTEST_F()
189 zassert_true(len == sizeof(rd_buf), "zms_read unexpected failure: %d", len); in ZTEST_F()
190 zassert_mem_equal(wr_buf_1, rd_buf, sizeof(rd_buf), in ZTEST_F()
193 BUILD_ASSERT((sizeof(wr_buf_2) % sizeof(pattern_2)) == 0); in ZTEST_F()
194 for (int i = 0; i < sizeof(wr_buf_2); i += sizeof(pattern_2)) { in ZTEST_F()
195 memcpy(wr_buf_2 + i, pattern_2, sizeof(pattern_2)); in ZTEST_F()
211 len = zms_write(&fixture->fs, TEST_DATA_ID, wr_buf_2, sizeof(wr_buf_2)); in ZTEST_F()
212 zassert_true(len == sizeof(wr_buf_2), "zms_write failed: %d", len); in ZTEST_F()
215 memset(&fixture->fs, 0, sizeof(fixture->fs)); in ZTEST_F()
220 len = zms_read(&fixture->fs, TEST_DATA_ID, rd_buf, sizeof(rd_buf)); in ZTEST_F()
221 zassert_true(len == sizeof(rd_buf), "zms_read unexpected failure: %d", len); in ZTEST_F()
222 zassert_true(memcmp(wr_buf_2, rd_buf, sizeof(rd_buf)) != 0, in ZTEST_F()
225 zassert_mem_equal(wr_buf_1, rd_buf, sizeof(rd_buf), in ZTEST_F()
249 memset(buf, id_data, sizeof(buf)); in ZTEST_F()
251 len = zms_write(&fixture->fs, id, buf, sizeof(buf)); in ZTEST_F()
252 zassert_true(len == sizeof(buf), "zms_write failed: %d", len); in ZTEST_F()
256 len = zms_read(&fixture->fs, id, rd_buf, sizeof(buf)); in ZTEST_F()
257 zassert_true(len == sizeof(rd_buf), "zms_read unexpected failure: %d", len); in ZTEST_F()
259 for (int i = 0; i < sizeof(rd_buf); i++) { in ZTEST_F()
263 zassert_mem_equal(buf, rd_buf, sizeof(rd_buf), in ZTEST_F()
271 len = zms_read(&fixture->fs, id, rd_buf, sizeof(buf)); in ZTEST_F()
272 zassert_true(len == sizeof(rd_buf), "zms_read unexpected failure: %d", len); in ZTEST_F()
274 for (int i = 0; i < sizeof(rd_buf); i++) { in ZTEST_F()
278 zassert_mem_equal(buf, rd_buf, sizeof(rd_buf), in ZTEST_F()
292 memset(buf, id_data, sizeof(buf)); in write_content()
294 len = zms_write(fs, id, buf, sizeof(buf)); in write_content()
295 zassert_true(len == sizeof(buf), "zms_write failed: %d", len); in write_content()
306 len = zms_read(fs, id, rd_buf, sizeof(buf)); in check_content()
307 zassert_true(len == sizeof(rd_buf), "zms_read unexpected failure: %d", len); in check_content()
313 zassert_mem_equal(buf, rd_buf, sizeof(rd_buf), in check_content()
427 memset(buf, id_data, sizeof(buf)); in ZTEST_F()
440 len = zms_write(&fixture->fs, id, buf, sizeof(buf)); in ZTEST_F()
441 zassert_true(len == sizeof(buf), "zms_write failed: %d", len); in ZTEST_F()
473 len = zms_write(&fixture->fs, filling_id, &filling_id, sizeof(filling_id)); in ZTEST_F()
477 zassert_true(len == sizeof(filling_id), "zms_write failed: %d", len); in ZTEST_F()
489 len = zms_write(&fixture->fs, filling_id, &filling_id, sizeof(filling_id)); in ZTEST_F()
490 zassert_true(len == sizeof(filling_id), "zms_write failed: %d", len); in ZTEST_F()
494 len = zms_read(&fixture->fs, i, &data_read, sizeof(data_read)); in ZTEST_F()
498 zassert_true(len == sizeof(data_read), in ZTEST_F()
500 sizeof(data_read)); in ZTEST_F()
522 len = zms_write(&fixture->fs, filling_id, &filling_id, sizeof(filling_id)); in ZTEST_F()
524 zassert_true(len == sizeof(filling_id), "zms_write failed: %d", len); in ZTEST_F()
534 len = zms_read(&fixture->fs, filling_id, &data_read, sizeof(data_read)); in ZTEST_F()
542 len = zms_read(&fixture->fs, 1, &data_read, sizeof(data_read)); in ZTEST_F()
583 close_ate.offset = fixture->fs.sector_size - sizeof(struct zms_ate) * 5; in ZTEST_F()
596 sizeof(struct zms_ate) - SIZEOF_FIELD(struct zms_ate, crc8)); in ZTEST_F()
598 memset(&ate, 0, sizeof(struct zms_ate)); in ZTEST_F()
600 ate.len = sizeof(data); in ZTEST_F()
603 memcpy(&ate.data, &data, sizeof(data)); in ZTEST_F()
605 sizeof(struct zms_ate) - SIZEOF_FIELD(struct zms_ate, crc8)); in ZTEST_F()
609 fixture->fs.offset + fixture->fs.sector_size - sizeof(struct zms_ate), in ZTEST_F()
610 &empty_ate, sizeof(empty_ate)); in ZTEST_F()
615 fixture->fs.offset + fixture->fs.sector_size - 2 * sizeof(struct zms_ate), in ZTEST_F()
616 &close_ate, sizeof(close_ate)); in ZTEST_F()
621 fixture->fs.offset + fixture->fs.sector_size - 6 * sizeof(struct zms_ate), in ZTEST_F()
622 &ate, sizeof(ate)); in ZTEST_F()
628 2 * sizeof(struct zms_ate), in ZTEST_F()
629 &close_ate, sizeof(close_ate)); in ZTEST_F()
638 len = zms_read(&fixture->fs, 1, &data, sizeof(data)); in ZTEST_F()
639 zassert_true(len == sizeof(data), "zms_read should have read %d bytes", sizeof(data)); in ZTEST_F()
657 sizeof(struct zms_ate) - SIZEOF_FIELD(struct zms_ate, crc8)); in ZTEST_F()
666 fixture->fs.offset + fixture->fs.sector_size - 2 * sizeof(struct zms_ate), in ZTEST_F()
667 &close_ate, sizeof(close_ate)); in ZTEST_F()
673 sizeof(corrupt_ate)); in ZTEST_F()
679 2 * sizeof(struct zms_ate), in ZTEST_F()
680 &close_ate, sizeof(close_ate)); in ZTEST_F()
735 err = zms_write(&fixture->fs, 1, &data, sizeof(data)); in ZTEST_F()
736 zassert_equal(err, sizeof(data), "zms_write call failure: %d", err); in ZTEST_F()
746 memset(fixture->fs.lookup_cache, 0xAA, sizeof(fixture->fs.lookup_cache)); in ZTEST_F()
774 err = zms_write(&fixture->fs, id, &data, sizeof(data)); in ZTEST_F()
775 zassert_equal(err, sizeof(data), "zms_write call failure: %d", err); in ZTEST_F()
779 err = zms_read(&fixture->fs, id, &data, sizeof(data)); in ZTEST_F()
780 zassert_equal(err, sizeof(data), "zms_read call failure: %d", err); in ZTEST_F()
802 while (fixture->fs.data_wra + sizeof(data) + sizeof(struct zms_ate) <= in ZTEST_F()
805 err = zms_write(&fixture->fs, 1, &data, sizeof(data)); in ZTEST_F()
806 zassert_equal(err, sizeof(data), "zms_write call failure: %d", err); in ZTEST_F()
818 err = zms_write(&fixture->fs, 2, &data, sizeof(data)); in ZTEST_F()
819 zassert_equal(err, sizeof(data), "zms_write call failure: %d", err); in ZTEST_F()
856 err = zms_write(&fixture->fs, id, &data, sizeof(data)); in ZTEST_F()
857 zassert_equal(err, sizeof(data), "zms_write call failure: %d", err); in ZTEST_F()
879 err = zms_write(&fixture->fs, id, &data, sizeof(data)); in ZTEST_F()
880 zassert_equal(err, sizeof(data), "zms_write call failure: %d", err); in ZTEST_F()