From: Dongwoo Lee Date: Thu, 25 Aug 2022 04:57:27 +0000 (+0900) Subject: tests: unittest: pass: Use proper type for iteration index X-Git-Tag: submit/tizen/20220830.030501~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=15aef3e2ba53fe70dd308ebeab38329b1272aa62;p=platform%2Fcore%2Fsystem%2Fpass.git tests: unittest: pass: Use proper type for iteration index This fixes to use proper type for iteration index, and also refactor the part of clear progress with same code for both success and failure cases. Change-Id: Ide70626a93328ef2bc9668addbf4ede73a345dca Signed-off-by: Dongwoo Lee Signed-off-by: Chanwoo Choi --- diff --git a/tests/unittest/pass-unittests.cc b/tests/unittest/pass-unittests.cc index 2942b63..6408468 100644 --- a/tests/unittest/pass-unittests.cc +++ b/tests/unittest/pass-unittests.cc @@ -519,27 +519,21 @@ TEST(PassParserTest, pass_parser_get_resource_config_invalid) { TEST(PassParserTest, pass_parser_get_each_resource_config_valid) { struct pass pass; const char path_json[] = "./scripts/valid/pass.json"; - unsigned int i; + int i; int ret = pass_parser_get_resource_config(&pass, path_json); ASSERT_EQ(ret, 0); - for (i = 0; i < pass.num_resources; i++) { + for (i = 0; i < (int)pass.num_resources; i++) { struct pass_resource *res = &pass.res[i]; ret = pass_parser_get_each_resource_config(res, res->config_data.path_conf_file); EXPECT_EQ(ret, 0); if (ret < 0) - goto err; + break; } - for (i = 0; i < pass.num_resources; i++) - pass_parser_put_each_resource_config(&pass.res[i]); - pass_parser_put_resource_config(&pass); - - return; -err: for (i--; i >= 0; i--) pass_parser_put_each_resource_config(&pass.res[i]); pass_parser_put_resource_config(&pass);