From 0ba899a49684fbb62d6f1baea4309e716d170d16 Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Sun, 5 Jan 2003 17:48:06 +0000 Subject: [PATCH] Test of xref link functions. --- t/output/update_gom.ref | 6 +++++- t/src/update_gom.c | 33 +++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/t/output/update_gom.ref b/t/output/update_gom.ref index a9de005..518d141 100644 --- a/t/output/update_gom.ref +++ b/t/output/update_gom.ref @@ -236,7 +236,10 @@ Record id: '(null)' User data: 0x === FAMILY (@FAM1@) === Family events: 0x -Husband: 0x +Husband: + type: 2 + xref: '@IND1@' + object: 0x Wife: 0x Children: 0x Number of children: '3' @@ -353,6 +356,7 @@ Tag: '_TAG' String value: '(null)' Xref value: 0x User data: 0x +ERROR: Error: Cross-reference @IND1@ still in use Test succeeded === HEADER === Source: diff --git a/t/src/update_gom.c b/t/src/update_gom.c index c4152ed..f529f66 100644 --- a/t/src/update_gom.c +++ b/t/src/update_gom.c @@ -224,6 +224,7 @@ int test_record_add_delete_functions() struct submitter* subm2; struct submission* subn1; struct user_rec* user1; + struct xref_value* xr; int result; char* value; const char* new_nr_of_children = "3"; @@ -277,35 +278,47 @@ int test_record_add_delete_functions() user1 = gom_add_user_rec("@USER1@", "_TAG"); if (!user1) return 216; + xr = gom_make_individual_link(ind1); + if (!xr) return 217; + + xr = gom_set_xref_value(&(fam1->husband), xr); + if (!xr) return 218; + output(0, "Intermediate output:\n"); show_data(); - result = gom_delete_family(fam1); - if (result != 0) return 217; + result = gom_delete_individual(ind1); + if (result == 0) return 251; + + xr = gom_set_xref_value(&(fam1->husband), NULL); + if (xr) return 252; result = gom_delete_individual(ind1); - if (result != 0) return 218; + if (result != 0) return 253; + + result = gom_delete_family(fam1); + if (result != 0) return 250; result = gom_delete_multimedia(mm1); - if (result != 0) return 219; + if (result != 0) return 254; result = gom_delete_note(note1); - if (result != 0) return 220; + if (result != 0) return 255; result = gom_delete_repository(repo1); - if (result != 0) return 221; + if (result != 0) return 256; result = gom_delete_source(sour1); - if (result != 0) return 222; + if (result != 0) return 257; result = gom_delete_submitter(subm2); - if (result != 0) return 223; + if (result != 0) return 258; result = gom_delete_submission(subn1); - if (result != 0) return 224; + if (result != 0) return 259; result = gom_delete_user_rec(user1); - if (result != 0) return 225; + if (result != 0) return 260; return 0; } -- 2.30.2