test: add ethereum test case
test_002InitWallet_0016SetNodeUrlFailureNodeUrlOutOfLimit
@@ -380,6 +380,24 @@ START_TEST(test_002InitWallet_0015SetNodeUrlFailureErrorNodeUrlFormat)
}
END_TEST
+START_TEST(test_002InitWallet_0016SetNodeUrlFailureNodeUrlOutOfLimit)
+{
+ BSINT32 rtnVal;
+ BoatEthWallet *wallet_ptr = BoatMalloc(sizeof(BoatEthWallet));
+
+ /* 1. execute unit test */
+ wallet_ptr->network_info.node_url_ptr = NULL;
+ rtnVal = BoatEthWalletSetNodeUrl(wallet_ptr, error_ethereum_node_url);
+ /* 2. verify test result */
+ /* 2-1. verify the return value */
+ ck_assert_int_eq(rtnVal, BOAT_ERROR_COMMON_INVALID_ARGUMENT);
+
+ /* 2-2. verify the global variables that be affected */
+ ck_assert(wallet_ptr->network_info.node_url_ptr == NULL);
+
+}
+END_TEST
+
Suite *make_wallet_suite(void)
{
/* Create Suite */
@@ -406,6 +424,7 @@ Suite *make_wallet_suite(void)
tcase_add_test(tc_wallet_api, test_002InitWallet_0013SetNodeUrlSuccess);
tcase_add_test(tc_wallet_api, test_002InitWallet_0014SetNodeUrlFailureNullParam);
tcase_add_test(tc_wallet_api, test_002InitWallet_0015SetNodeUrlFailureErrorNodeUrlFormat);
+ tcase_add_test(tc_wallet_api, test_002InitWallet_0016SetNodeUrlFailureNodeUrlOutOfLimit);
return s_wallet;
}
