From 1187351144783b649d6c2d12159ca02d8ac9531e Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 9 Nov 2021 01:47:07 +0800 Subject: [PATCH] testing/fstest: Compare the file name directly and remove crc of file name Signed-off-by: Xiang Xiao --- testing/fstest/fstest_main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/testing/fstest/fstest_main.c b/testing/fstest/fstest_main.c index 215be830a..c8d7cc6ab 100644 --- a/testing/fstest/fstest_main.c +++ b/testing/fstest/fstest_main.c @@ -91,7 +91,6 @@ struct fstest_filedesc_s bool failed; size_t len; uint32_t crc; - uint32_t hash; }; /**************************************************************************** @@ -201,9 +200,8 @@ static bool fstest_checkexist(FAR struct fstest_filedesc_s *file) for (i = 0; i < CONFIG_TESTING_FSTEST_MAXOPEN; i++) { - if (!g_files[i].deleted && - &g_files[i] != file && - g_files[i].hash == file->hash) + if (!g_files[i].deleted && &g_files[i] != file && + strcmp(g_files[i].name, file->name) == 0) { ret = true; break; @@ -251,8 +249,6 @@ static inline void fstest_randname(FAR struct fstest_filedesc_s *file) } file->name[alloclen] = '\0'; - file->hash = crc32((const uint8_t *)file->name + dirlen, - alloclen - dirlen); } while (fstest_checkexist(file)); }