test(ethereum): Add InitEthWalletWithWrongGenMode
@@ -485,6 +485,26 @@ START_TEST(test_002InitWallet_0013InitEthWalletGenerationKey)
walletConfig.prikeyCtx_config.prikey_format = BOAT_WALLET_PRIKEY_TYPE_SECP256K1;
walletConfig.eip155_compatibility = BOAT_FALSE;
+ /* 1. execute unit test */
+ rtnVal = BoatEthWalletInit(&walletConfig, sizeof(BoatEthWalletConfig));
+ /* 2. verify test result */
+ /* 2-1. verify the return value */
+ ck_assert_ptr_null(rtnVal);
+
+ /* 2-2. verify the global variables that be affected */
+}
+END_TEST
+
+START_TEST(test_002InitWallet_0014InitEthWalletWithWrongGenMode)
+{
+ BoatEthWallet *rtnVal;
+ BoatEthWalletConfig walletConfig;
+
+ walletConfig.prikeyCtx_config.prikey_genMode = 3;
+ walletConfig.prikeyCtx_config.prikey_format = BOAT_WALLET_PRIKEY_FORMAT_NATIVE;
+ walletConfig.prikeyCtx_config.prikey_format = BOAT_WALLET_PRIKEY_TYPE_SECP256K1;
+ walletConfig.eip155_compatibility = BOAT_FALSE;
+
/* 1. execute unit test */
rtnVal = BoatEthWalletInit(&walletConfig, sizeof(BoatEthWalletConfig));
/* 2. verify test result */
@@ -548,6 +568,7 @@ Suite *make_wallet_suite(void)
tcase_add_test(tc_wallet_api, test_002InitWallet_0011InitEthWalletWithBiggerSize);
tcase_add_test(tc_wallet_api, test_002InitWallet_0012InitEthWalletSuccess);
tcase_add_test(tc_wallet_api, test_002InitWallet_0013InitEthWalletGenerationKey);
+ tcase_add_test(tc_wallet_api, test_002InitWallet_0014InitEthWalletWithWrongGenMode);
tcase_add_test(tc_wallet_api, test_003DeleteWallet_0001DeleteWalletFailureNullFleName);
tcase_add_test(tc_wallet_api, test_003DeleteWallet_0002DeleteWalletFailureNoExistingFile);
tcase_add_test(tc_wallet_api, test_003DeleteWallet_0003DeleteWalletSucessExistingFile);
