test: Add test_008Contract_0006SetAndGetAddressContractFuction
@@ -364,6 +364,43 @@ START_TEST(test_008Contract_0005SetAndGetBytesContractFuction)
}
END_TEST
+START_TEST(test_008Contract_0006SetAndGetAddressContractFuction)
+{
+ BoatEthTx tx_ctx;
+ BoatEthWallet *rtnVal;
+ BCHAR *result_str;
+ BOAT_RESULT result;
+ BoatFieldVariable parse_result = {NULL, 0};
+ BoatAddress ba;
+ BUINT32 i;
+ BoatEthWalletConfig walletConfig = get_ethereum_wallet_settings();
+
+ /* 1. execute unit test */
+ rtnVal = BoatEthWalletInit(&walletConfig, sizeof(BoatEthWalletConfig));
+ ck_assert_ptr_ne(rtnVal, NULL);
+
+ result = BoatEthTxInit(rtnVal, &tx_ctx, BOAT_TRUE, NULL,
+ "0x333333",
+ (BCHAR *)TEST_CONTRACT_ADDRESS);
+ ck_assert_int_eq(result, BOAT_SUCCESS);
+
+ for (i = 0; i < 20; i++)
+ {
+ ba[i] = i * 5 + 0x10;
+ }
+
+ result_str = TestABIContract_setAddress(&tx_ctx, ba);
+ ck_assert_ptr_ne(rtnVal, NULL);
+
+ result_str = TestABIContract_getAddress(&tx_ctx);
+ ck_assert_ptr_ne(rtnVal, NULL);
+ result = BoatEthParseRpcResponseStringResult(result_str, &parse_result);
+ ck_assert_int_eq(result, BOAT_SUCCESS);
+
+ BoatLog(BOAT_LOG_NORMAL, "readListByIndex returns: %s", parse_result.field_ptr);
+}
+END_TEST
+
Suite *make_general_suite(void)
{
/* Create Suite */
@@ -392,7 +429,7 @@ Suite *make_general_suite(void)
tcase_add_test(tc_general_api, test_008Contract_0003SetAndGetUintContractFuction);
tcase_add_test(tc_general_api, test_008Contract_0004SetAndGetStringContractFuction);
tcase_add_test(tc_general_api, test_008Contract_0005SetAndGetBytesContractFuction);
-
+ tcase_add_test(tc_general_api, test_008Contract_0006SetAndGetAddressContractFuction);
return s_general;
}
\ No newline at end of file
