test: add ethereum test case
test_003DeleteWallet
@@ -398,6 +398,27 @@ START_TEST(test_002InitWallet_0016SetNodeUrlFailureNodeUrlOutOfLimit)
}
END_TEST
+START_TEST(test_002DeleteWallet_0001DeleteWalletFailureNullFleName)
+{
+ BoatWalletDelete(NULL);
+ ck_assert_int_eq(access("ethereum", F_OK), 0);
+}
+END_TEST
+
+START_TEST(test_002DeleteWallet_0002DeleteWalletFailureNoExistingFile)
+{
+ BoatWalletDelete("ethereum_no_exist");
+ ck_assert_int_eq(access("ethereum", F_OK), 0);
+}
+END_TEST
+
+START_TEST(test_002DeleteWallet_0003DeleteWalletSucessExistingFile)
+{
+ BoatWalletDelete("ethereum");
+ ck_assert_int_eq(access("ethereum", F_OK), -1);
+}
+END_TEST
+
Suite *make_wallet_suite(void)
{
/* Create Suite */
@@ -425,6 +446,9 @@ Suite *make_wallet_suite(void)
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);
+ 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);
return s_wallet;
}
