--- tests/check_money.3.c 2006-11-21 18:19:14.000000000 -0500
+++ tests/check_money.6.c 2006-11-21 18:19:15.000000000 -0500
@@ -14,6 +14,23 @@
}
END_TEST
+START_TEST (test_money_create_neg)
+{
+ Money *m = money_create (-1, "USD");
+ fail_unless (m == NULL,
+ "NULL should be returned on attempt to create with "
+ "a negative amount");
+}
+END_TEST
+
+START_TEST (test_money_create_zero)
+{
+ Money *m = money_create (0, "USD");
+ fail_unless (money_amount (m) == 0,
+ "Zero is a valid amount of money");
+}
+END_TEST
+
Suite *
money_suite (void)
{
@@ -24,6 +41,12 @@
tcase_add_test (tc_core, test_money_create);
suite_add_tcase (s, tc_core);
+ /* Limits test case */
+ TCase *tc_limits = tcase_create ("Limits");
+ tcase_add_test (tc_limits, test_money_create_neg);
+ tcase_add_test (tc_limits, test_money_create_zero);
+ suite_add_tcase (s, tc_limits);
+
return s;
}
syntax highlighted by Code2HTML, v. 0.9.1