test: Modify index variable type of 'for'statement 78/317378/1 accepted/tizen_unified accepted/tizen_unified_x accepted/tizen_unified_x_asan tizen accepted/tizen/unified/20250102.161033 accepted/tizen/unified/x/20250102.211300 accepted/tizen/unified/x/asan/20250113.002030
authorSangYoun Kwak <sy.kwak@samsung.com>
Tue, 31 Dec 2024 07:46:02 +0000 (16:46 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Tue, 31 Dec 2024 07:46:02 +0000 (16:46 +0900)
In the for statement, index variable is compared with 'n' and its type
is size_t. Thus, to make this comparison properly, the type of index is
modified as size_t.

Change-Id: I01b7cc1ac533dd215a21bc954a589b582e45356d
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
test/peripheral-io-test.c

index f70293098cdde3886ba0637788ffe08715c88dc6..2c7298923fb5eb016e7721547596d6dadffb340d 100644 (file)
@@ -102,14 +102,14 @@ static int __get_feature(const char *key, bool *feature)
 static bool __skip_check(char *name)
 {
        size_t n = sizeof(skip_test_list) / sizeof(skip_test_list[0]);
-       for (unsigned int u = 0; u < n; ++u)
-               if (!strcmp(skip_test_list[u].model_name, model_name) && !strcmp(skip_test_list[u].test_name, name))
+       for (size_t i = 0; i < n; ++i)
+               if (!strcmp(skip_test_list[i].model_name, model_name) && !strcmp(skip_test_list[i].test_name, name))
                        return true;
 
        if (i2c_no_stub_driver) {
                n = sizeof(skip_test_list_i2c_no_stub_driver) / sizeof(skip_test_list_i2c_no_stub_driver[0]);
-               for (unsigned int u = 0; u < n; u++)
-                       if (!strcmp(skip_test_list_i2c_no_stub_driver[u], name))
+               for (size_t i = 0; i < n; i++)
+                       if (!strcmp(skip_test_list_i2c_no_stub_driver[i], name))
                                return true;
        }
        return false;