[chainmaker][#436]add test_01CreateWallet_0004
@@ -116,6 +116,24 @@ START_TEST(test_01CreateWallet_0003CreatePersistWalletSuccess)
}
END_TEST
+START_TEST(test_01CreateWallet_0004CreateLoadWalletSuccess)
+{
+ BSINT32 rtnVal;
+ extern BoatIotSdkContext g_boat_iot_sdk_context;
+
+ /* 1. execute unit test */
+ rtnVal = BoatWalletCreate(BOAT_PROTOCOL_CHAINMAKER, "chainmaker", NULL, sizeof(BoatHlchainmakerWalletConfig));
+
+ /* 2. verify test result */
+ /* 2-1. verify the return value */
+ ck_assert_int_eq(rtnVal, 0);
+
+ /* 2-2. verify the global variables that be affected */
+ ck_assert(g_boat_iot_sdk_context.wallet_list[0].is_used == true);
+}
+END_TEST
+
+
Suite *make_wallet_suite(void)
{
/* Create Suite */
@@ -130,6 +148,8 @@ Suite *make_wallet_suite(void)
tcase_add_test(tc_wallet_api, test_01CreateWallet_0001CreateOneTimeWalletSuccess);
tcase_add_test(tc_wallet_api, test_01CreateWallet_0002CreateOneTimeWalletFailureNullConfig);
tcase_add_test(tc_wallet_api, test_01CreateWallet_0003CreatePersistWalletSuccess);
+ tcase_add_test(tc_wallet_api, test_01CreateWallet_0004CreateLoadWalletSuccess);
+
return s_wallet;
}
