feat(fabric tests):
add the test case of CreateWallet_0002
@@ -264,6 +264,28 @@ START_TEST(test_001CreateWallet_0001CreateOneTimeWalletSuccess)
rtnVal = BoatWalletCreate(BOAT_PROTOCOL_HLFABRIC, NULL, &wallet_config, sizeof(BoatHlfabricWalletConfig));
+ ck_assert_int_eq(rtnVal, 0);
+ ck_assert(g_boat_iot_sdk_context.wallet_list[0].is_used == true);
+ g_fabric_wallet_ptr = BoatGetWalletByIndex(rtnVal);
+ ck_assert(g_fabric_wallet_ptr != NULL);
+ rtnVal = BoatHlfabricWalletSetNetworkInfo(g_fabric_wallet_ptr, wallet_config.nodesCfg);
+ ck_assert(rtnVal == BOAT_SUCCESS);
+ ck_assert(check_fabric_wallet(g_fabric_wallet_ptr) == BOAT_SUCCESS);
+ BoatIotSdkDeInit();
+}
+END_TEST
+
+START_TEST(test_001CreateWallet_0002CreateOneTimeWalletSuccess)
+{
+ BSINT32 rtnVal;
+ BoatHlfabricWallet *g_fabric_wallet_ptr = NULL;
+ BoatHlfabricWalletConfig wallet_config = get_fabric_wallet_settings();
+ extern BoatIotSdkContext g_boat_iot_sdk_context;
+
+ /* 1. execute unit test */
+ rtnVal = BoatWalletCreate(BOAT_PROTOCOL_HLFABRIC, NULL, &wallet_config, sizeof(BoatHlfabricWalletConfig));
+
+
ck_assert_int_eq(rtnVal, 0);
ck_assert(g_boat_iot_sdk_context.wallet_list[0].is_used == true);
g_fabric_wallet_ptr = BoatGetWalletByIndex(rtnVal);
@@ -298,6 +320,7 @@ Suite *make_wallet_suite(void)
suite_add_tcase(s_wallet, tc_wallet_api);
/* Test cases are added to the test set */
tcase_add_test(tc_wallet_api, test_001CreateWallet_0001CreateOneTimeWalletSuccess);
+ tcase_add_test(tc_wallet_api, test_001CreateWallet_0002CreateOneTimeWalletSuccess);
return s_wallet;
}
