feat(fabric test):
add fabric test case "TxSetNetworkInfo_Wallet_NULL"
@@ -148,6 +148,26 @@ START_TEST(test_002Transaction_0007SetNetworkInfoSuccess)
}
END_TEST
+START_TEST(test_002Transaction_0008TxSetNetworkInfo_Wallet_NULL)
+{
+ BSINT32 rtnVal;
+ BoatHlfabricTx tx_ptr;
+ BoatHlfabricWallet *g_fabric_wallet_ptr = NULL;
+ BoatHlfabricWalletConfig wallet_config = get_fabric_wallet_settings();
+ BoatIotSdkInit();
+ /* 1. execute unit test */
+ rtnVal = BoatWalletCreate(BOAT_PROTOCOL_HLFABRIC, NULL, &wallet_config, sizeof(BoatHlfabricWalletConfig));
+ g_fabric_wallet_ptr = BoatGetWalletByIndex(rtnVal);
+
+ rtnVal = BoatHlfabricTxInit(&tx_ptr, g_fabric_wallet_ptr, NULL, "mycc", NULL, "mychannel", NULL);
+ ck_assert_int_eq(rtnVal, BOAT_ERROR_COMMON_INVALID_ARGUMENT);
+ rtnVal = BoatHlfabricWalletSetNetworkInfo(NULL, wallet_config.nodesCfg);
+ ck_assert_int_eq(rtnVal, BOAT_ERROR_COMMON_INVALID_ARGUMENT);
+ BoatIotSdkDeInit();
+ fabricWalletConfigFree(wallet_config);
+}
+END_TEST
+
Suite *make_transaction_suite(void)
{
/* Create Suite */
@@ -166,6 +186,7 @@ Suite *make_transaction_suite(void)
tcase_add_test(tc_transaction_api, test_002Transaction_0005TxInit_channelID_NULL);
tcase_add_test(tc_transaction_api, test_002Transaction_0006TxInit_orgName_NULL);
tcase_add_test(tc_transaction_api, test_002Transaction_0007SetNetworkInfoSuccess);
+ tcase_add_test(tc_transaction_api, test_002Transaction_0008TxSetNetworkInfo_Wallet_NULL);
return s_transaction;
