test: add platone test case test_001CreateWallet_0012CreateOnetimeWalletWithLoadExistedWallet
fix the issue aitos-io#1176
teambition task id:
@@ -347,6 +347,25 @@ START_TEST(test_001CreateWallet_0011CreateSevenWallet)
}
END_TEST
+START_TEST(test_001CreateWallet_0012CreateOnetimeWalletWithLoadExistedWallet)
+{
+ BSINT32 rtnVal;
+ BoatIotSdkInit();
+ BoatPlatoneWalletConfig wallet = get_platone_wallet_settings();
+ extern BoatIotSdkContext g_boat_iot_sdk_context;
+ wallet.prikeyCtx_config.load_existed_wallet = BOAT_TRUE;
+ /* 1. execute unit test */
+ rtnVal = BoatWalletCreate(BOAT_PROTOCOL_PLATONE, NULL, &wallet, sizeof(BoatPlatoneWalletConfig));
+ /* 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);
+ BoatIotSdkDeInit();
+}
+END_TEST
+
Suite *make_wallet_suite(void)
{
/* Create Suite */
@@ -369,6 +388,7 @@ Suite *make_wallet_suite(void)
tcase_add_test(tc_wallet_api, test_001CreateWallet_0009CreateWalletWithInternalGeneration);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0010CreateSixWallet);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0011CreateSevenWallet);
+ tcase_add_test(tc_wallet_api, test_001CreateWallet_0012CreateOnetimeWalletWithLoadExistedWallet);
return s_wallet;
}
