[fabric][tests]fix test case failed to run and error
aitos-io#1354 aitos-io#1355
BoATE-1058
@@ -82,7 +82,7 @@ START_TEST(test_005Transaction_0003TxInvoke_Failure_Args_NULL)
time(&timesec);
rtnVal = BoatHlfabricTxSetTimestamp(&tx_ptr, timesec, 0);
ck_assert_int_eq(rtnVal, BOAT_SUCCESS);
- rtnVal = BoatHlfabricTxSetArgs(&tx_ptr, NULL);
+ rtnVal = BoatHlfabricTxSetArgs(&tx_ptr, NULL, NULL);
ck_assert_int_eq(rtnVal, BOAT_SUCCESS);
rtnVal = BoatHlfabricTxSubmit(&tx_ptr);
ck_assert_int_eq(rtnVal, BOAT_ERROR_COMMON_INVALID_ARGUMENT);
@@ -303,7 +303,13 @@ START_TEST(test_005Transaction_0013TxInvoke_Failure_Walleturl_Err)
BoatHlfabricTx tx_ptr;
BoatHlfabricWallet *g_fabric_wallet_ptr = NULL;
g_fabric_wallet_ptr = fabric_get_wallet_ptr();
- g_fabric_wallet_ptr->network_info.nodesCfg.layoutCfg[0].groupCfg[0].endorser[0].nodeUrl = "121.4.178.74";
+
+ BoatFree(g_fabric_wallet_ptr->network_info.nodesCfg.layoutCfg[0].groupCfg[0].endorser[0].nodeUrl);
+ g_fabric_wallet_ptr->network_info.nodesCfg.layoutCfg[0].groupCfg[0].endorser[0].nodeUrl = NULL;
+
+ BCHAR *fabric_demo_endorser_peer0Org1_url_err = "121.4.178.74";
+ g_fabric_wallet_ptr->network_info.nodesCfg.layoutCfg[0].groupCfg[0].endorser[0].nodeUrl = BoatMalloc(strlen(fabric_demo_endorser_peer0Org1_url_err) + 1);
+ strcpy(g_fabric_wallet_ptr->network_info.nodesCfg.layoutCfg[0].groupCfg[0].endorser[0].nodeUrl, fabric_demo_endorser_peer0Org1_url_err);
rtnVal = BoatHlfabricTxInit(&tx_ptr, g_fabric_wallet_ptr, NULL, "mycc", NULL, "mychannel", "Org1MSP");
ck_assert_int_eq(rtnVal, BOAT_SUCCESS);
