[chainmaker][#436]modify test 13 function
@@ -411,18 +411,18 @@ START_TEST(test_001CreateWallet_0012_CreatePersisWalletFailureIndexExceed)
END_TEST
-START_TEST(test_001CreateWallet_0013_CreateOneTimeWalletFailureHostNameLenExceed)
+START_TEST(test_001CreateWallet_0013_CreateOneTimeWalletSucessHostNameMaxLen)
{
BSINT32 rtnVal;
BoatHlchainmakerWallet *g_chaninmaker_wallet_ptr = NULL;
BoatHlchainmakerWalletConfig wallet_config = get_chainmaker_wallet_settings();
- char host_name[EXCEED_STR_MAX_LEN];
- for (int i = 0; i < EXCEED_STR_MAX_LEN; i++)
+ char host_name[BAOT_CHAINMAKER_NODE_STR_LEN];
+ for (int i = 0; i < BAOT_CHAINMAKER_NODE_STR_LEN; i++)
{
host_name[i] = 'a';
}
- memcpy(wallet_config.host_name_cfg, host_name, EXCEED_STR_MAX_LEN);
+ memcpy(wallet_config.host_name_cfg, host_name, BAOT_CHAINMAKER_NODE_STR_LEN);
extern BoatIotSdkContext g_boat_iot_sdk_context;
/* 1. execute unit test */
@@ -430,12 +430,14 @@ START_TEST(test_001CreateWallet_0013_CreateOneTimeWalletFailureHostNameLenExceed
/* 2. verify test result */
/* 2-1. verify the return value */
- ck_assert_int_eq(rtnVal, BOAT_ERROR);
+ 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 == false);
+ ck_assert(g_boat_iot_sdk_context.wallet_list[0].is_used == true);
+
g_chaninmaker_wallet_ptr = BoatGetWalletByIndex(rtnVal);
- ck_assert(g_chaninmaker_wallet_ptr == NULL);
+ ck_assert(g_chaninmaker_wallet_ptr != NULL);
+ ck_assert(check_chainmaker_wallet(g_chaninmaker_wallet_ptr) == BOAT_SUCCESS);
BoatIotSdkDeInit();
}
END_TEST
@@ -591,7 +593,7 @@ Suite *make_wallet_suite(void)
tcase_add_test(tc_wallet_api, test_001CreateWallet_0010_CreatePersisWalletFailureLongName);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0011_CreatePersisWalletFailurePotocolTypeNoExit);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0012_CreatePersisWalletFailureIndexExceed);
- tcase_add_test(tc_wallet_api, test_001CreateWallet_0013_CreateOneTimeWalletFailureHostNameLenExceed);
+ tcase_add_test(tc_wallet_api, test_001CreateWallet_0013_CreateOneTimeWalletSucessHostNameMaxLen);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0014_CreateOneTimeWalletFailureChainIdLenExceed);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0015_CreateOneTimeWalletFailureOrgIdLenExceed);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0016_CreateOneTimeWalletFailurePrikeyError);
