loadable_apps/binary_update: Update tests for binary_manager_set_bootparam APIs
Add test cases for binary_manager_set_bootparam first.
It is called before calling binary_manager_update_binary to update bootparams with the latest binary information.
After API implementation, These test cases should be ran well and passed.
@@ -316,6 +316,7 @@ static int binary_update_unregister_state_changed_callback(void)
static int binary_update_same_version_test(void)
{
int ret;
+ uint8_t type = 0;
char path[BINARY_PATH_LEN];
binary_update_info_t pre_bin_info;
binary_update_info_t cur_bin_info;
@@ -335,6 +336,12 @@ static int binary_update_same_version_test(void)
sleep(2);
+ BM_SET_GROUP(type, BINARY_USERAPP);
+ ret = binary_manager_set_bootparam(type);
+ if (ret != OK) {
+ return ret;
+ }
+
ret = binary_update_reload();
if (ret != OK) {
return ret;
@@ -351,6 +358,7 @@ static int binary_update_same_version_test(void)
static int binary_update_new_version_test(char *bin_name)
{
int ret;
+ uint8_t type = 0;
char path[BINARY_PATH_LEN];
binary_update_info_t pre_bin_info;
binary_update_info_t cur_bin_info;
@@ -375,6 +383,12 @@ static int binary_update_new_version_test(char *bin_name)
return ret;
}
+ BM_SET_GROUP(type, BINARY_USERAPP);
+ ret = binary_manager_set_bootparam(type);
+ if (ret != OK) {
+ return ret;
+ }
+
ret = binary_update_reload();
if (ret != OK) {
return ret;
