test(ethereum): Add test_001CreateWallet_0014UnloadInexistentWallet
@@ -387,6 +387,28 @@ START_TEST(test_001CreateWallet_0013UnloadWalletSuccess)
}
END_TEST
+START_TEST(test_001CreateWallet_0014UnloadInexistentWallet)
+{
+ BSINT32 rtnVal;
+ BoatEthWalletConfig wallet = get_ethereum_wallet_settings();
+ extern BoatIotSdkContext g_boat_iot_sdk_context;
+ wallet.prikeyCtx_config.prikey_genMode = BOAT_WALLET_PRIKEY_GENMODE_INTERNAL_GENERATION;
+ /* 1. execute unit test */
+ rtnVal = BoatWalletCreate(BOAT_PROTOCOL_ETHEREUM, NULL, &wallet, sizeof(BoatEthWalletConfig));
+ /* 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);
+
+ BoatWalletUnload(1);
+ ck_assert(g_boat_iot_sdk_context.wallet_list[0].is_used == true);
+
+ BoatIotSdkDeInit();
+}
+END_TEST
+
START_TEST(test_002InitWallet_0001SetEIP155CompSuccess)
{
BSINT32 rtnVal;
@@ -739,7 +761,7 @@ Suite *make_wallet_suite(void)
tcase_add_test(tc_wallet_api, test_001CreateWallet_0011CreateSevenWallet);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0012CreateOnetimeWalletWithLoadExistedWallet);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0013UnloadWalletSuccess);
-
+ tcase_add_test(tc_wallet_api, test_001CreateWallet_0014UnloadInexistentWallet);
tcase_add_test(tc_wallet_api, test_002InitWallet_0001SetEIP155CompSuccess);
tcase_add_test(tc_wallet_api, test_002InitWallet_0002SetEIP155CompFailureNullParam);
