test: add ethereum test case
test_002InitWallet_0010SetEIP155CompFailureNullParam
@@ -249,6 +249,24 @@ START_TEST(test_002InitWallet_0009SetEIP155CompSuccess)
}
END_TEST
+START_TEST(test_002InitWallet_0010SetEIP155CompFailureNullParam)
+{
+ BSINT32 rtnVal;
+ BoatEthWallet *wallet_ptr = BoatMalloc(sizeof(BoatEthWallet));
+ BoatEthWalletConfig wallet_config = get_ethereum_wallet_settings();
+
+ /* 1. execute unit test */
+ rtnVal = BoatEthWalletSetEIP155Comp(NULL, wallet_config.eip155_compatibility);
+ /* 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.eip155_compatibility == NULL);
+
+}
+END_TEST
+
Suite *make_wallet_suite(void)
{
/* Create Suite */
@@ -269,6 +287,7 @@ Suite *make_wallet_suite(void)
tcase_add_test(tc_wallet_api, test_001CreateWallet_0007CreateOneTimeWalletSuccessLongSize);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0008CreateOneTimeWalletFailureProtocolUnknown);
tcase_add_test(tc_wallet_api, test_002InitWallet_0009SetEIP155CompSuccess);
+ tcase_add_test(tc_wallet_api, test_002InitWallet_0010SetEIP155CompFailureNullParam);
return s_wallet;
}
