Skip to content

Commit 1d4a2e8

Browse files
57300anangl
authored andcommitted
Revert "[nrf fromlist] tests: zms: Add test coverage for ZMS_ID_64BIT"
This reverts commit fb385d5. Signed-off-by: Grzegorz Swiderski <[email protected]>
1 parent e88ccb0 commit 1d4a2e8

File tree

2 files changed

+6
-56
lines changed

2 files changed

+6
-56
lines changed

tests/subsys/fs/zms/src/main.c

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -578,18 +578,17 @@ ZTEST_F(zms, test_zms_gc_corrupt_close_ate)
578578
int err;
579579

580580
Z_TEST_SKIP_IFNDEF(CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES);
581-
memset(&close_ate, 0xff, sizeof(struct zms_ate));
582-
close_ate.id = ZMS_HEAD_ID;
581+
close_ate.id = 0xffffffff;
583582
close_ate.offset = fixture->fs.sector_size - sizeof(struct zms_ate) * 5;
584583
close_ate.len = 0;
584+
close_ate.metadata = 0xffffffff;
585585
close_ate.cycle_cnt = 1;
586586
close_ate.crc8 = 0xff; /* Incorrect crc8 */
587587

588-
memset(&empty_ate, 0, sizeof(struct zms_ate));
589-
empty_ate.id = ZMS_HEAD_ID;
588+
empty_ate.id = 0xffffffff;
589+
empty_ate.offset = 0;
590590
empty_ate.len = 0xffff;
591-
empty_ate.metadata =
592-
FIELD_PREP(ZMS_MAGIC_NUMBER_MASK, ZMS_MAGIC_NUMBER) | ZMS_DEFAULT_VERSION;
591+
empty_ate.metadata = 0x4201;
593592
empty_ate.cycle_cnt = 1;
594593
empty_ate.crc8 =
595594
crc8_ccitt(0xff, (uint8_t *)&empty_ate + SIZEOF_FIELD(struct zms_ate, crc8),
@@ -650,7 +649,7 @@ ZTEST_F(zms, test_zms_gc_corrupt_ate)
650649
struct zms_ate close_ate;
651650
int err;
652651

653-
close_ate.id = ZMS_HEAD_ID;
652+
close_ate.id = 0xffffffff;
654653
close_ate.offset = fixture->fs.sector_size / 2;
655654
close_ate.len = 0;
656655
close_ate.crc8 =
@@ -897,45 +896,3 @@ ZTEST_F(zms, test_zms_cache_hash_quality)
897896
ztest_test_skip();
898897
#endif
899898
}
900-
901-
/*
902-
* Test 64 bit ZMS ID support.
903-
*/
904-
ZTEST_F(zms, test_zms_id_64bit)
905-
{
906-
int err;
907-
ssize_t len;
908-
uint64_t data;
909-
uint64_t filling_id = 0xdeadbeefULL;
910-
911-
Z_TEST_SKIP_IFNDEF(CONFIG_ZMS_ID_64BIT);
912-
913-
err = zms_mount(&fixture->fs);
914-
zassert_true(err == 0, "zms_mount call failure: %d", err);
915-
916-
/* Fill the first sector with writes of different IDs */
917-
918-
while (fixture->fs.data_wra + sizeof(data) + sizeof(struct zms_ate) <=
919-
fixture->fs.ate_wra) {
920-
data = filling_id;
921-
len = zms_write(&fixture->fs, (zms_id_t)filling_id, &data, sizeof(data));
922-
zassert_true(len == sizeof(data), "zms_write failed: %d", len);
923-
924-
/* Choose the next ID so that its lower 32 bits stay invariant.
925-
* The purpose is to test that ZMS doesn't mistakenly cast the
926-
* 64 bit ID to a 32 bit one somewhere.
927-
*/
928-
filling_id += BIT64(32);
929-
}
930-
931-
/* Read back the written entries and check that they're all unique */
932-
933-
for (uint64_t id = 0xdeadbeefULL; id < filling_id; id += BIT64(32)) {
934-
len = zms_read_hist(&fixture->fs, (zms_id_t)id, &data, sizeof(data), 0);
935-
zassert_true(len == sizeof(data), "zms_read_hist unexpected failure: %d", len);
936-
zassert_equal(data, id, "read unexpected data: %llx instead of %llx", data, id);
937-
938-
len = zms_read_hist(&fixture->fs, (zms_id_t)id, &data, sizeof(data), 1);
939-
zassert_true(len == -ENOENT, "zms_read_hist unexpected failure: %d", len);
940-
}
941-
}

tests/subsys/fs/zms/testcase.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,3 @@ tests:
2727
platform_allow:
2828
- native_sim
2929
- qemu_x86
30-
filesystem.zms.id_64bit:
31-
extra_configs:
32-
- CONFIG_ZMS_ID_64BIT=y
33-
- CONFIG_ZMS_LOOKUP_CACHE=y
34-
- CONFIG_ZMS_LOOKUP_CACHE_SIZE=64
35-
- CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
36-
platform_allow: qemu_x86

0 commit comments

Comments
 (0)