summaryrefslogtreecommitdiff
path: root/doc/example/tests/check_money.2.c
diff options
context:
space:
mode:
Diffstat (limited to 'doc/example/tests/check_money.2.c')
-rw-r--r--doc/example/tests/check_money.2.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/example/tests/check_money.2.c b/doc/example/tests/check_money.2.c
new file mode 100644
index 0000000..7c7c9d4
--- /dev/null
+++ b/doc/example/tests/check_money.2.c
@@ -0,0 +1,20 @@
+#include <check.h>
+#include "../src/money.h"
+
+START_TEST (test_money_create)
+{
+ Money *m;
+ m = money_create (5, "USD");
+ fail_unless (money_amount (m) == 5,
+ "Amount not set correctly on creation");
+ fail_unless (strcmp (money_currency (m), "USD") == 0,
+ "Currency not set correctly on creation");
+ money_free (m);
+}
+END_TEST
+
+int
+main (void)
+{
+ return 0;
+}