29 #include "cashobjects.h"
30 #include "gncAddressP.h"
31 #include "test-stuff.h"
34 test_string_fcn (
GncAddress *address,
const char *message,
45 ent = g_object_new(QOF_TYPE_INSTANCE,
"guid",
guid_null(), NULL);
50 do_test (gncAddressCreate (NULL, NULL) == NULL,
"address create NULL");
52 address = gncAddressCreate (book, ent);
53 do_test (address != NULL,
"address create");
55 gncAddressBeginEdit (address);
56 gncAddressDestroy (address);
57 success (
"create/destroy");
62 address = gncAddressCreate (book, ent);
63 test_string_fcn (address,
"Name", gncAddressSetName, gncAddressGetName);
64 test_string_fcn (address,
"Addr1", gncAddressSetAddr1, gncAddressGetAddr1);
65 test_string_fcn (address,
"Addr2", gncAddressSetAddr2, gncAddressGetAddr2);
66 test_string_fcn (address,
"Addr3", gncAddressSetAddr3, gncAddressGetAddr3);
67 test_string_fcn (address,
"Addr4", gncAddressSetAddr4, gncAddressGetAddr4);
68 test_string_fcn (address,
"Phone", gncAddressSetPhone, gncAddressGetPhone);
69 test_string_fcn (address,
"Fax", gncAddressSetFax, gncAddressGetFax);
70 test_string_fcn (address,
"Email", gncAddressSetEmail, gncAddressGetEmail);
75 test_string_fcn (
GncAddress *address,
const char *message,
79 char const *str = get_random_string ();
81 do_test (!gncAddressIsDirty (address),
"test if start dirty");
83 do_test (gncAddressIsDirty (address),
"test dirty later");
84 do_test (g_strcmp0 (
get (address), str) == 0, message);
85 gncAddressClearDirty (address);
89 main (
int argc,
char **argv)
92 if (cashobjects_register())
QofBook * qof_book_new(void)
void qof_close(void)
Safely close down the Query Object Framework.
const GncGUID * guid_null(void)
void qof_init(void)
Initialise the Query Object Framework.