[chainmaker][#436]add wallet short size test case
@@ -188,6 +188,25 @@ START_TEST(test_001CreateWallet_0005CreateLoadWalletFailureNoExist)
}
END_TEST
+START_TEST(test_001CreateWallet_0006_CreateOneTimeWalletFailureShortSize)
+{
+ BSINT32 rtnVal;
+ BoatHlchainmakerWallet *g_chaninmaker_wallet_ptr;
+ BoatHlchainmakerWalletConfig wallet_config = get_chainmaker_wallet_settings();
+ extern BoatIotSdkContext g_boat_iot_sdk_context;
+
+ /* 1. execute unit test */
+ rtnVal = BoatWalletCreate(BOAT_PROTOCOL_CHAINMAKER, NULL, &wallet_config, sizeof(BoatHlchainmakerWalletConfig) - 10);
+
+ /* 2. verify test result */
+ /* 2-1. verify the return value */
+ ck_assert_int_eq(rtnVal, BOAT_ERROR_COMMON_INVALID_ARGUMENT);
+
+ /* 2-2. verify the global variables that be affected */
+ ck_assert(g_boat_iot_sdk_context.wallet_list[0].is_used == false);
+}
+END_TEST
+
START_TEST(test_002DeleteWallet_0001DeleteWalletFailureNullFleName)
{
BoatWalletDelete(NULL);
@@ -225,6 +244,7 @@ Suite *make_wallet_suite(void)
tcase_add_test(tc_wallet_api, test_001CreateWallet_0003CreatePersistWalletSuccess);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0004CreateLoadWalletSuccess);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0005CreateLoadWalletFailureNoExist);
+ tcase_add_test(tc_wallet_api, test_001CreateWallet_0006_CreateOneTimeWalletFailureShortSize);
tcase_add_test(tc_wallet_api, test_002DeleteWallet_0001DeleteWalletFailureNullFleName);
tcase_add_test(tc_wallet_api, test_002DeleteWallet_0002DeleteWalletFailureNoExistingFile);
tcase_add_test(tc_wallet_api, test_002DeleteWallet_0003DeleteWalletSucessExistingFile);
