1616#include <flashdb.h>
1717#include <stdio.h>
1818#include <stdlib.h>
19+ #include <unistd.h>
1920
2021#define TEST_TS_PART_NAME "fdb_kvdb1"
2122#define TEST_KV_BLOB_NAME "kv_blob_test"
@@ -36,6 +37,8 @@ struct test_kv{
3637
3738static struct fdb_kvdb test_kvdb ;
3839
40+ static void test_fdb_kvdb_deinit (void );
41+
3942static void test_fdb_kvdb_init (void )
4043{
4144 if (access (TEST_TS_PART_NAME , 0 ) < 0 )
@@ -184,7 +187,6 @@ static void test_fdb_del_kv(void)
184187
185188 {
186189 /* check the oldest address is already right when kvdb reinit */
187- extern void test_fdb_kvdb_deinit (void );
188190 test_fdb_kvdb_deinit ();
189191 test_fdb_kvdb_init ();
190192
@@ -227,7 +229,7 @@ static void test_fdb_by_kvs(struct test_kv *kv_tbl, size_t len)
227229 struct fdb_blob blob_obj , * blob = & blob_obj ;
228230 static struct test_kv saved_kv_tbl [TEST_KV_NUM ] = { 0 };
229231
230- for (int i = 0 ; i < len ; i ++ )
232+ for (size_t i = 0 ; i < len ; i ++ )
231233 {
232234 if (kv_tbl [i ].is_changed )
233235 {
@@ -237,7 +239,7 @@ static void test_fdb_by_kvs(struct test_kv *kv_tbl, size_t len)
237239
238240 iter_all_kv (& test_kvdb , saved_kv_tbl );
239241
240- for (int i = 0 ; i < len ; i ++ )
242+ for (size_t i = 0 ; i < len ; i ++ )
241243 {
242244 uassert_str_equal (saved_kv_tbl [i ].name , kv_tbl [i ].name );
243245 uassert_str_equal (saved_kv_tbl [i ].value , kv_tbl [i ].value );
0 commit comments