diff --git a/data/tests/FTM_16dec2015a-mod1.ged b/data/tests/FTM_16dec2015a-mod1.ged
new file mode 100644
index 000000000..807b4f87e
--- /dev/null
+++ b/data/tests/FTM_16dec2015a-mod1.ged
@@ -0,0 +1,78 @@
+0 HEAD
+1 SOUR FTM
+2 VERS Family Tree Maker (22.2.5)
+2 NAME Family Tree Maker for Mac OS X
+2 CORP Ancestry.com
+3 ADDR 360 W 4800 N
+4 CONT Provo, UT 84604
+3 PHON (801) 705-7000
+1 DEST GED55
+1 DATE 16 DEC 2015
+1 CHAR UTF-8
+1 FILE test_FTM_16dec2015-mod.ged
+1 SUBM @SUBM@
+1 GEDC
+2 VERS 5.5
+2 FORM LINEAGE-LINKED
+0 @SUBM@ SUBM
+0 @I278@ INDI
+1 NAME Andrew /May/
+2 SOUR @S29@
+3 PAGE Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll:
+4 CONC M432_394; Page: 435B; Image: 248
+3 OBJE @M159@
+1 SEX M
+1 BIRT
+2 DATE 1816
+2 PLAC Tennessee, USA
+2 SOUR @S29@
+3 PAGE Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll:
+4 CONC M432_394; Page: 435B; Image: 248
+3 OBJE @M159@
+1 RESI
+2 DATE 1850
+2 PLAC District 14, Cape Girardeau, Missouri, USA
+2 SOUR @S29@
+3 PAGE Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll:
+4 CONC M432_394; Page: 435B; Image: 248
+3 OBJE @M159@
+1 DEAT
+2 DATE 1850/1860
+2 PLAC Bollinger Co. MO
+1 FAMS @F73@
+1 FAMS @F74@
+1 FAMC @F73@
+1 FAMC @F73@
+1 FAMC @F74@
+1 FAMC @F74@
+0 @F73@ FAM
+1 HUSB @I278@
+1 MARR
+2 DATE ABT 1841
+2 PLAC Union Co.?, IL
+0 @F74@ FAM
+1 HUSB @I278@
+1 MARR
+2 DATE AUG 1847
+2 PLAC Wayne, Missouri, United States
+0 @S29@ SOUR
+1 AUTH Ancestry.com
+1 TITL 1850 United States Federal Census
+1 PUBL Name: Ancestry.com Operations, Inc.; Location: Provo, UT, USA; Date:
+2 CONC 2009;
+1 REPO @R1@
+0 @R1@ REPO
+1 NAME Ancestry.com
+1 ADDR
+1 EMAIL
+1 PHON
+0 @M159@ OBJE
+1 FILE 1850 United States Federal Census(11)-1.jpg
+2 TITL 1850 United States Federal Census
+1 NOTE Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll:
+2 CONC M432_394; Page: 435B; Image: 248
+0 @M158@ OBJE
+1 FILE D:\Users\PRC\Downloads\1850 United States Federal Census(11)-1.jpg
+0 @M157@ OBJE
+1 FILE http://1.gravatar.com/avatar/77e02a3c8c665155ad1acaac8c2742e0?s=120&d=mm&r=pg
+0 TRLR
diff --git a/data/tests/FTM_16dec2015a-mod1.gramps b/data/tests/FTM_16dec2015a-mod1.gramps
new file mode 100644
index 000000000..2edc28c6b
--- /dev/null
+++ b/data/tests/FTM_16dec2015a-mod1.gramps
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+ Birth
+
+
+
+
+
+ Residence
+
+
+
+
+
+ Death
+
+
+
+
+ Marriage
+
+
+
+
+ Marriage
+
+
+
+
+
+
+ M
+
+ Andrew
+ May
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll: M432_394; Page: 435B; Image: 248
+ 2
+
+
+
+
+ Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll: M432_394; Page: 435B; Image: 248
+ 2
+
+
+
+
+ Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll: M432_394; Page: 435B; Image: 248
+ 2
+
+
+
+
+
+
+ 1850 United States Federal Census
+ Ancestry.com
+ Name: Ancestry.com Operations, Inc.; Location: Provo, UT, USA; Date: 2009;
+
+
+
+
+
+ Tennessee, USA
+
+
+
+ District 14, Cape Girardeau, Missouri, USA
+
+
+
+ Bollinger Co. MO
+
+
+
+ Union Co.?, IL
+
+
+
+ Wayne, Missouri, United States
+
+
+
+
+
+
+
+
+
+
+ Ancestry.com
+ Library
+
+
+
+
+
+
+
+ Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll: M432_394; Page: 435B; Image: 248
+
+
+ Records not imported into OBJE (multi-media object) Gramps ID M159:
+
+Could not import 1850 United States Federal Census(11)-1.jpg Line 70: 1 FILE 1850 United States Federal Census(11)-1.jpg
+
+
+
+
diff --git a/data/tests/MixInlineXrefNote.ged b/data/tests/MixInlineXrefNote.ged
new file mode 100644
index 000000000..857806f48
--- /dev/null
+++ b/data/tests/MixInlineXrefNote.ged
@@ -0,0 +1,34 @@
+0 HEAD
+1 SOUR RootsMagic
+2 NAME RootsMagic
+2 VERS 7.0.2.2
+2 CORP RootsMagic, Inc.
+3 ADDR PO Box 495
+4 CONT Springville, UT 84663
+4 CONT USA
+3 PHON 1-800-ROOTSMAGIC
+1 DEST RootsMagic
+1 DATE 26 JAN 2015
+1 FILE rm.ged
+1 GEDC
+2 VERS 5.5.1
+2 FORM LINEAGE-LINKED
+1 CHAR UTF-8
+0 @I1@ INDI
+1 NAME Living1
+1 SEX M
+1 NOTE Inline 0
+1 NOTE @N0@
+1 NOTE Inline 1
+1 SOUR Inline Source 1
+0 @N0@ NOTE
+1 CONC XREF N0
+0 @I01@ INDI
+1 NAME Living01
+1 SEX M
+1 SOUR inline Source 2
+0 @S1@ SOUR
+1 TITL Source S1
+0 @S01@ SOUR
+1 TITL Source S01
+0 TRLR
diff --git a/data/tests/MixInlineXrefNote.gramps b/data/tests/MixInlineXrefNote.gramps
new file mode 100644
index 000000000..57e91ac0e
--- /dev/null
+++ b/data/tests/MixInlineXrefNote.gramps
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ Paul Culley
+ 11210 Olde Mint House Ln
+ Tomball
+ Tx
+ USA
+ 77375
+ paulr2787@gmail.com
+
+
+
+
+ M
+
+ Living1
+
+
+
+
+
+
+
+ M
+
+ Living01
+
+
+
+
+
+
+ 2
+
+
+
+ 2
+
+
+
+
+
+ Inline Source 1
+
+
+ inline Source 2
+
+
+ Source S1
+
+
+ Source S01
+
+
+
+
+ Inline 0
+
+
+ XREF N0
+
+
+ Inline 1
+
+
+
diff --git a/data/tests/Paris.ged b/data/tests/Paris.ged
new file mode 100644
index 000000000..02cc9bc89
--- /dev/null
+++ b/data/tests/Paris.ged
@@ -0,0 +1,274 @@
+0 HEAD
+1 SOUR HEREDIS 14 PC
+2 VERS 14
+2 NAME HEREDIS PC
+2 CORP BSD Concept ©
+3 ADDR www.heredis.com
+1 DATE 9 JAN 2016
+2 TIME 18:28:16
+1 GEDC
+2 VERS 5.5
+2 FORM LINEAGE-LINKED
+1 CHAR UTF-8
+1 PLAC
+2 FORM Town , Area code , County , Region , Country, Subdivision
+0 @3I@ INDI
+1 NAME Arrondissements/PARIS/
+2 GIVN Arrondissements
+2 SURN PARIS
+1 SEX M
+1 EVEN
+2 TYPE Acquisition
+2 TYPE Paris
+2 PLAC Paris,75056,Paris,Île-de-France,FRANCE,
+1 FAMS @181U@
+0 @4I@ INDI
+1 NAME Églises/LUTECE/
+2 GIVN Églises
+2 SURN LUTECE
+1 SEX F
+1 ORDN
+2 TYPE Notre-Dame-de-Bonne-Nouvelle
+2 PLAC Notre-Dame-de-Bonne-Nouvelle,75102,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Benoît
+2 PLAC Saint-Benoît,75102,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Christophe-de-Javel
+2 PLAC Saint-Christophe-de-Javel,75115,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Eustache
+2 PLAC Saint-Eustache,75101,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Germain-des-Prés
+2 PLAC Saint-Germain-des-Prés,75114,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Germain-L'Auxerrois
+2 PLAC Saint-Germain-L'Auxerrois,75101,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Gervais-et-Protais
+2 PLAC Saint-Gervais-et-Protais,75104,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Jacques-du-Haut-Pas
+2 PLAC Saint-Jacques-du-Haut-Pas,75105,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Laurent
+2 PLAC Saint-Laurent,75110,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Leu-Saint-Gilles
+2 PLAC Saint-Leu-Saint-Gilles,75101,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Médard
+2 PLAC Saint-Médard,75105,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Merri
+2 PLAC Saint-Merri,75104,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Nicolas-de-Chardonnet
+2 PLAC Saint-Nicolas-de-Chardonnet,75105,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Nicolas-des-Champs
+2 PLAC Saint-Nicolas-des-Champs,75104,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Sauveur
+2 PLAC Saint-Sauveur,75102,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Séverin
+2 PLAC Saint-Séverin,75105,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Sulpice
+2 PLAC Saint-Sulpice,75106,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Catédrale Notre-Dame-de-Paris
+2 PLAC Notre-Dame-de-Paris,75104,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Temple Protestant de L'Oratoire du Louvre
+2 PLAC Temple Protestant de L'Oratoire du Louvre,75101,Paris,Île-de-France,FRANCE,
+1 ORDN
+2 TYPE Saint-Paul
+2 PLAC Saint-Paul-Saint-Louis,75104,Paris,Île-de-France,FRANCE,
+1 FAMS @181U@
+0 @93I@ INDI
+1 NAME 01 le Louvre/PARIS/
+2 GIVN 01 le Louvre
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 01,75101,Paris,Ïle-de-France,FRANCE,
+1 FAMC @181U@
+0 @95I@ INDI
+1 NAME 02 la Bourse/PARIS/
+2 GIVN 02 la Bourse
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 02,75102,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @98I@ INDI
+1 NAME 04 Hôtel-de-Ville/PARIS/
+2 GIVN 04 Hôtel-de-Ville
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 04,75104,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @100I@ INDI
+1 NAME 09 Opéra/PARIS/
+2 GIVN 09 Opéra
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 09,75109,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @102I@ INDI
+1 NAME 05 Panthéon/PARIS/
+2 GIVN 05 Panthéon
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 05,75105,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @104I@ INDI
+1 NAME 06 Luxembourg/PARIS/
+2 GIVN 06 Luxembourg
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 06,75106,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @106I@ INDI
+1 NAME 07 Palais-Bourbon/PARIS/
+2 GIVN 07 Palais-Bourbon
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 07,75107,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @108I@ INDI
+1 NAME 08 Élysée/PARIS/
+2 GIVN 08 Élysée
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 08,75108,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @110I@ INDI
+1 NAME 10 Entrepôt/PARIS/
+2 GIVN 10 Entrepôt
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 10,75110,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @112I@ INDI
+1 NAME 11 Popincourt/PARIS/
+2 GIVN 11 Popincourt
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 11,75111,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @114I@ INDI
+1 NAME 12 Reuilly/PARIS/
+2 GIVN 12 Reuilly
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 12,75112,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @116I@ INDI
+1 NAME 13 des Gobelins - la Salpêtrière/PARIS/
+2 GIVN 13 des Gobelins - la Salpêtrière
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 13,75113,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @118I@ INDI
+1 NAME 14 L'Observatoire/PARIS/
+2 GIVN 14 L'Observatoire
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 14,75114,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @120I@ INDI
+1 NAME 19 Buttes-Chaumont/PARIS/
+2 GIVN 19 Buttes-Chaumont
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 19,75119,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @122I@ INDI
+1 NAME 15 Vaugirard/PARIS/
+2 GIVN 15 Vaugirard
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 15,75115,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @124I@ INDI
+1 NAME 16 Passy/PARIS/
+2 GIVN 16 Passy
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 16,75116,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @126I@ INDI
+1 NAME 17 Batignolles-Monceau/PARIS/
+2 GIVN 17 Batignolles-Monceau
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 17,75117,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @128I@ INDI
+1 NAME 18 Buttes-Montmartre/PARIS/
+2 GIVN 18 Buttes-Montmartre
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 18,75118,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @134I@ INDI
+1 NAME 03 Temple/PARIS/
+2 GIVN 03 Temple
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 03,75103,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @179I@ INDI
+1 NAME 20 Ménilmontant/PARIS/
+2 GIVN 20 Ménilmontant
+2 SURN PARIS
+1 SEX M
+1 BIRT
+2 PLAC Paris 20,75120,Paris,Île-de-France,FRANCE,
+1 FAMC @181U@
+0 @181U@ FAM
+1 HUSB @3I@
+1 WIFE @4I@
+1 CHIL @93I@
+1 CHIL @95I@
+1 CHIL @98I@
+1 CHIL @100I@
+1 CHIL @102I@
+1 CHIL @104I@
+1 CHIL @106I@
+1 CHIL @108I@
+1 CHIL @110I@
+1 CHIL @112I@
+1 CHIL @114I@
+1 CHIL @116I@
+1 CHIL @118I@
+1 CHIL @120I@
+1 CHIL @122I@
+1 CHIL @124I@
+1 CHIL @126I@
+1 CHIL @128I@
+1 CHIL @134I@
+1 CHIL @179I@
+0 TRLR
diff --git a/data/tests/Paris.gramps b/data/tests/Paris.gramps
new file mode 100644
index 000000000..e32f43b44
--- /dev/null
+++ b/data/tests/Paris.gramps
@@ -0,0 +1,721 @@
+
+
+
+
+
+
+ Paul Culley
+ 11210 Olde Mint House Ln
+ Tomball
+ Tx
+ USA
+ 77375
+ paulr2787@gmail.com
+
+
+
+
+ Paris
+
+
+
+ Ordination
+
+ Notre-Dame-de-Bonne-Nouvelle
+
+
+ Ordination
+
+ Saint-Benoît
+
+
+ Ordination
+
+ Saint-Christophe-de-Javel
+
+
+ Ordination
+
+ Saint-Eustache
+
+
+ Ordination
+
+ Saint-Germain-des-Prés
+
+
+ Ordination
+
+ Saint-Germain-L'Auxerrois
+
+
+ Ordination
+
+ Saint-Gervais-et-Protais
+
+
+ Ordination
+
+ Saint-Jacques-du-Haut-Pas
+
+
+ Ordination
+
+ Saint-Laurent
+
+
+ Ordination
+
+ Saint-Leu-Saint-Gilles
+
+
+ Ordination
+
+ Saint-Médard
+
+
+ Ordination
+
+ Saint-Merri
+
+
+ Ordination
+
+ Saint-Nicolas-de-Chardonnet
+
+
+ Ordination
+
+ Saint-Nicolas-des-Champs
+
+
+ Ordination
+
+ Saint-Sauveur
+
+
+ Ordination
+
+ Saint-Séverin
+
+
+ Ordination
+
+ Saint-Sulpice
+
+
+ Ordination
+
+ Catédrale Notre-Dame-de-Paris
+
+
+ Ordination
+
+ Temple Protestant de L'Oratoire du Louvre
+
+
+ Ordination
+
+ Saint-Paul
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+
+
+ M
+
+ Arrondissements
+ PARIS
+
+
+
+
+
+ F
+
+ Églises
+ LUTECE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ M
+
+ 01 le Louvre
+ PARIS
+
+
+
+
+
+ M
+
+ 02 la Bourse
+ PARIS
+
+
+
+
+
+ M
+
+ 04 Hôtel-de-Ville
+ PARIS
+
+
+
+
+
+ M
+
+ 09 Opéra
+ PARIS
+
+
+
+
+
+ M
+
+ 05 Panthéon
+ PARIS
+
+
+
+
+
+ M
+
+ 06 Luxembourg
+ PARIS
+
+
+
+
+
+ M
+
+ 07 Palais-Bourbon
+ PARIS
+
+
+
+
+
+ M
+
+ 08 Élysée
+ PARIS
+
+
+
+
+
+ M
+
+ 10 Entrepôt
+ PARIS
+
+
+
+
+
+ M
+
+ 11 Popincourt
+ PARIS
+
+
+
+
+
+ M
+
+ 12 Reuilly
+ PARIS
+
+
+
+
+
+ M
+
+ 13 des Gobelins - la Salpêtrière
+ PARIS
+
+
+
+
+
+ M
+
+ 14 L'Observatoire
+ PARIS
+
+
+
+
+
+ M
+
+ 19 Buttes-Chaumont
+ PARIS
+
+
+
+
+
+ M
+
+ 15 Vaugirard
+ PARIS
+
+
+
+
+
+ M
+
+ 16 Passy
+ PARIS
+
+
+
+
+
+ M
+
+ 17 Batignolles-Monceau
+ PARIS
+
+
+
+
+
+ M
+
+ 18 Buttes-Montmartre
+ PARIS
+
+
+
+
+
+ M
+
+ 03 Temple
+ PARIS
+
+
+
+
+
+ M
+
+ 20 Ménilmontant
+ PARIS
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Paris,75056,Paris,Île-de-France,FRANCE,
+ 75056
+
+
+
+
+ Notre-Dame-de-Bonne-Nouvelle,75102,Paris,Île-de-France,FRANCE,
+ 75102
+
+
+
+
+ Saint-Benoît,75102,Paris,Île-de-France,FRANCE,
+ 75102
+
+
+
+
+ Saint-Christophe-de-Javel,75115,Paris,Île-de-France,FRANCE,
+ 75115
+
+
+
+
+ Saint-Eustache,75101,Paris,Île-de-France,FRANCE,
+ 75101
+
+
+
+
+ Saint-Germain-des-Prés,75114,Paris,Île-de-France,FRANCE,
+ 75114
+
+
+
+
+ Saint-Germain-L'Auxerrois,75101,Paris,Île-de-France,FRANCE,
+ 75101
+
+
+
+
+ Saint-Gervais-et-Protais,75104,Paris,Île-de-France,FRANCE,
+ 75104
+
+
+
+
+ Saint-Jacques-du-Haut-Pas,75105,Paris,Île-de-France,FRANCE,
+ 75105
+
+
+
+
+ Saint-Laurent,75110,Paris,Île-de-France,FRANCE,
+ 75110
+
+
+
+
+ Saint-Leu-Saint-Gilles,75101,Paris,Île-de-France,FRANCE,
+ 75101
+
+
+
+
+ Saint-Médard,75105,Paris,Île-de-France,FRANCE,
+ 75105
+
+
+
+
+ Saint-Merri,75104,Paris,Île-de-France,FRANCE,
+ 75104
+
+
+
+
+ Saint-Nicolas-de-Chardonnet,75105,Paris,Île-de-France,FRANCE,
+ 75105
+
+
+
+
+ Saint-Nicolas-des-Champs,75104,Paris,Île-de-France,FRANCE,
+ 75104
+
+
+
+
+ Saint-Sauveur,75102,Paris,Île-de-France,FRANCE,
+ 75102
+
+
+
+
+ Saint-Séverin,75105,Paris,Île-de-France,FRANCE,
+ 75105
+
+
+
+
+ Saint-Sulpice,75106,Paris,Île-de-France,FRANCE,
+ 75106
+
+
+
+
+ Notre-Dame-de-Paris,75104,Paris,Île-de-France,FRANCE,
+ 75104
+
+
+
+
+ Temple Protestant de L'Oratoire du Louvre,75101,Paris,Île-de-France,FRANCE,
+ 75101
+
+
+
+
+ Saint-Paul-Saint-Louis,75104,Paris,Île-de-France,FRANCE,
+ 75104
+
+
+
+
+ Paris 01,75101,Paris,Ïle-de-France,FRANCE,
+ 75101
+
+
+
+
+ Paris 02,75102,Paris,Île-de-France,FRANCE,
+ 75102
+
+
+
+
+ Paris 04,75104,Paris,Île-de-France,FRANCE,
+ 75104
+
+
+
+
+ Paris 09,75109,Paris,Île-de-France,FRANCE,
+ 75109
+
+
+
+
+ Paris 05,75105,Paris,Île-de-France,FRANCE,
+ 75105
+
+
+
+
+ Paris 06,75106,Paris,Île-de-France,FRANCE,
+ 75106
+
+
+
+
+ Paris 07,75107,Paris,Île-de-France,FRANCE,
+ 75107
+
+
+
+
+ Paris 08,75108,Paris,Île-de-France,FRANCE,
+ 75108
+
+
+
+
+ Paris 10,75110,Paris,Île-de-France,FRANCE,
+ 75110
+
+
+
+
+ Paris 11,75111,Paris,Île-de-France,FRANCE,
+ 75111
+
+
+
+
+ Paris 12,75112,Paris,Île-de-France,FRANCE,
+ 75112
+
+
+
+
+ Paris 13,75113,Paris,Île-de-France,FRANCE,
+ 75113
+
+
+
+
+ Paris 14,75114,Paris,Île-de-France,FRANCE,
+ 75114
+
+
+
+
+ Paris 19,75119,Paris,Île-de-France,FRANCE,
+ 75119
+
+
+
+
+ Paris 15,75115,Paris,Île-de-France,FRANCE,
+ 75115
+
+
+
+
+ Paris 16,75116,Paris,Île-de-France,FRANCE,
+ 75116
+
+
+
+
+ Paris 17,75117,Paris,Île-de-France,FRANCE,
+ 75117
+
+
+
+
+ Paris 18,75118,Paris,Île-de-France,FRANCE,
+ 75118
+
+
+
+
+ Paris 03,75103,Paris,Île-de-France,FRANCE,
+ 75103
+
+
+
+
+ Paris 20,75120,Paris,Île-de-France,FRANCE,
+ 75120
+
+
+
+
+ FRANCE
+
+
+
+ Île-de-France, FRANCE
+
+
+
+
+ Paris, Île-de-France, FRANCE
+
+
+
+
+ Ïle-de-France, FRANCE
+
+
+
+
+ Paris, Ïle-de-France, FRANCE
+
+
+
+
+
diff --git a/data/tests/bug 8322 test.ged b/data/tests/bug 8322 test.ged
new file mode 100644
index 000000000..60f5b1cce
--- /dev/null
+++ b/data/tests/bug 8322 test.ged
@@ -0,0 +1,173 @@
+0 HEAD
+1 SOUR RootsMagic
+2 NAME RootsMagic
+2 VERS 7.0.2.2
+2 CORP RootsMagic, Inc.
+3 ADDR PO Box 495
+4 CONT Springville, UT 84663
+4 CONT USA
+3 PHON 1-800-ROOTSMAGIC
+1 DEST RootsMagic
+1 DATE 26 JAN 2015
+1 FILE rm.ged
+1 GEDC
+2 VERS 5.5.1
+2 FORM LINEAGE-LINKED
+1 CHAR UTF-8
+0 @I310@ INDI
+1 NAME Living
+1 SEX M
+1 _UID B9C4D3F0D254674AA1B9023745BEBFE551C1
+1 CHAN
+2 DATE 26 JAN 2015
+1 RESI
+2 DATE 1960
+2 PLAC the place
+2 ADDR the address
+3 NOTE the place created not previously used so changed to add the address; __event_addr(len==0, place is None)
+1 RESI
+2 DATE 1961
+2 PLAC the place
+3 NOTE check that this note is retained when the place is deleted. it should be merged into place
+2 ADDR the address
+3 NOTE the place created and then deleted and old data reused; __event_addr(len==0, place is not None)
+1 RESI
+2 DATE 1962
+2 PLAC the place
+3 NOTE setup the place
+1 RESI
+2 DATE 1962
+2 PLAC the place
+2 ADDR another address
+3 NOTE the place already exists; but now set doesn't match ; __event_addr(len!=0, place is None)
+1 RESI
+2 DATE 1963
+2 PLAC the place
+2 ADDR another address
+3 NOTE the place already exists but now set matches; __event_addr(len!=0, place is not None)
+1 RESI
+2 DATE 1964
+2 ADDR the address
+2 PLAC the place
+3 NOTE the address created, then destroyed as we find a matching set; __event_addr(no place_handle, create place)
+1 RESI
+2 DATE 1965
+2 ADDR the address
+1 RESI
+2 DATE 1966
+2 ADDR the address
+2 PLAC the place
+3 NOTE address reused, then destroyed as we find a matching set; __event_addr(no place_handle, place found)
+1 RESI
+2 DATE 1967
+2 PLAC the place
+2 ADDR the address
+2 ADDR second address
+3 NOTE second address ignored
+1 RESI
+2 DATE 1968
+2 ADDR the address 2
+2 PLAC the place 2
+2 ADDR second address
+3 NOTE second address ignored again
+2 ADDR a third address ignored again
+1 RESI
+2 DATE 1971
+2 ADDR address place test
+2 PLAC place test
+3 NOTE ADDR created; __event_place finds it but place does not match; __event_place(len==0, place is None)
+1 RESI
+2 DATE 1972
+2 ADDR address place test
+3 NOTE this note is stored with the old address and then merged into the matching place
+2 PLAC place test
+3 NOTE ADDR created; __event_place finds it and now place does match; __event_place(len==0, place is not None)
+1 RESI
+2 DATE 1973
+2 ADDR address place test
+3 NOTE setup address place test
+1 RESI
+2 DATE 1973
+2 ADDR address place test
+2 PLAC place test
+3 NOTE address place test found; place exists and can be reused; __event_place(len!=0, place is not None)
+1 RESI
+2 DATE 1974
+2 ADDR address place test
+2 PLAC different place test
+3 NOTE address place test found; but matching addr/plac not found; __event_place(len!=0, place is not None)
+1 RESI
+2 DATE 1975
+2 PLAC the place
+2 ADDR address place test
+3 NOTE PLAC occurs first; matching entry found; __event_place(no place handle, place is not None)
+1 RESI
+2 DATE 1976
+2 PLAC a new place
+2 ADDR address place test
+3 NOTE PLAC occurs first; matching entry not found; __event_place(no place handle, place is None)
+2 PLAC a second PLACe ignored
+2 PLAC and a third one also ignored
+2 ADDR plus an address just for good measure also ignored
+1 RESI
+2 DATE 1977
+2 ADDR address with no place
+3 NOTE note is stashed with a Place, and then merged into the address
+1 RESI
+2 DATE 1966
+2 PLAC Woerden, Zuid-Holland, Netherlands
+3 NOTE Place note
+2 ADDR Kromwijkerkade 63
+1 RESI
+2 DATE 1969
+2 PLAC Hasselt, Overijssel, Netherlands
+2 ADDR Prinsenstraat 69
+3 NOTE ADDR note
+1 RESI
+2 DATE 1978
+2 PLAC Enschede, Overijssel, Netherlands
+2 ADDR Calslaan 26-52
+1 RESI
+2 DATE 1979
+2 PLAC Enschede, Overijssel, Netherlands
+2 ADDR Calslaan 26-44
+3 NOTE PLAC previously encountered, new ADDR, so new Place
+1 RESI
+2 DATE 1984
+2 ADDR Calslaan 26-61
+2 PLAC Enschede, Overijssel, Netherlands
+3 NOTE ADDR before PLAC (check ADDR is removed)
+1 RESI
+2 DATE 1984
+2 PLAC Enschede, Overijssel, Netherlands
+1 RESI
+2 DATE 1984
+2 ADDR Calslaan 26-61
+1 RESI
+2 DATE 1984
+2 ADDR Calslaan 26-61
+2 PLAC Enschede, Overijssel, Netherlands
+3 NOTE ADDR before PLAC (address matches previous one, then needs to be reassigned)
+1 RESI
+2 DATE 1988
+2 PLAC Amsterdam, Noord-Holland, Netherlands
+2 ADDR Papendrechtstraat 37
+1 RESI
+2 DATE 1994
+2 PLAC Amsterdam, Noord-Holland, Netherlands
+3 NOTE PLAC and no ADDR
+1 RESI
+2 DATE 1994
+2 PLAC Amsterdam, Noord-Holland, Netherlands
+2 ADDR Olympiaplein 46-2
+3 NOTE PLAC matches previous one, then when ADDR is read need to create a new Place
+1 RESI
+2 DATE 1988
+2 PLAC Amsterdam, Noord-Holland, Netherlands
+2 ADDR Papendrechtstraat 37
+3 NOTE PLAC and ADDR match, use existing one
+1 RESI
+2 DATE 1994
+2 ADDR remembered address that should be set into place
+2 PLAC Amsterdam, Noord-Holland, Netherlands
+0 TRLR
diff --git a/data/tests/bug 8322 test.gramps b/data/tests/bug 8322 test.gramps
new file mode 100644
index 000000000..8be3cf23c
--- /dev/null
+++ b/data/tests/bug 8322 test.gramps
@@ -0,0 +1,500 @@
+
+
+
+
+
+
+ Paul Culley
+ 11210 Olde Mint House Ln
+ Tomball
+ Tx
+ USA
+ 77375
+ paulr2787@gmail.com
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+ Residence
+
+
+
+
+
+
+ M
+
+ Living
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ the place
+
+
+
+
+
+ the address
+
+
+
+
+
+ the address
+
+
+
+
+
+ another address
+
+
+
+
+
+ another address
+
+
+
+
+
+ the place
+
+
+
+
+
+
+ the address
+
+
+
+
+ the address
+
+
+
+
+ second address
+
+
+
+
+
+ the place 2
+
+
+
+
+ second address
+
+
+
+
+
+ a third address ignored again
+
+
+
+
+ place test
+
+
+
+
+
+
+
+
+ address place test
+
+
+
+
+
+ different place test
+
+
+
+
+
+ address place test
+
+
+
+
+
+ a new place
+
+
+
+ address place test
+
+
+
+
+
+ plus an address just for good measure also ignored
+
+
+
+
+ address with no place
+
+
+
+
+
+ Woerden, Zuid-Holland, Netherlands
+
+
+
+
+ Kromwijkerkade 63
+
+
+
+
+ Hasselt, Overijssel, Netherlands
+
+
+
+ Prinsenstraat 69
+
+
+
+
+
+ Enschede, Overijssel, Netherlands
+
+
+
+ Calslaan 26-52
+
+
+
+
+ Calslaan 26-44
+
+
+
+
+
+ Enschede, Overijssel, Netherlands
+
+
+
+
+
+
+ Calslaan 26-61
+
+
+
+
+ Amsterdam, Noord-Holland, Netherlands
+
+
+
+
+ Papendrechtstraat 37
+
+
+
+
+ Olympiaplein 46-2
+
+
+
+
+
+ Papendrechtstraat 37
+
+
+
+
+
+ Amsterdam, Noord-Holland, Netherlands
+
+
+
+
+
+
+ the place created not previously used so changed to add the address; __event_addr(len==0, place is None)
+
+
+ check that this note is retained when the place is deleted. it should be merged into place
+
+
+ the place created and then deleted and old data reused; __event_addr(len==0, place is not None)
+
+
+ setup the place
+
+
+ the place already exists; but now set doesn't match ; __event_addr(len!=0, place is None)
+
+
+ the place already exists but now set matches; __event_addr(len!=0, place is not None)
+
+
+ the address created, then destroyed as we find a matching set; __event_addr(no place_handle, create place)
+
+
+ address reused, then destroyed as we find a matching set; __event_addr(no place_handle, place found)
+
+
+ second address ignored
+
+
+ second address ignored again
+
+
+ ADDR created; __event_place finds it but place does not match; __event_place(len==0, place is None)
+
+
+ this note is stored with the old address and then merged into the matching place
+
+
+ ADDR created; __event_place finds it and now place does match; __event_place(len==0, place is not None)
+
+
+ setup address place test
+
+
+ address place test found; place exists and can be reused; __event_place(len!=0, place is not None)
+
+
+ address place test found; but matching addr/plac not found; __event_place(len!=0, place is not None)
+
+
+ PLAC occurs first; matching entry found; __event_place(no place handle, place is not None)
+
+
+ PLAC occurs first; matching entry not found; __event_place(no place handle, place is None)
+
+
+ note is stashed with a Place, and then merged into the address
+
+
+ Place note
+
+
+ ADDR note
+
+
+ PLAC previously encountered, new ADDR, so new Place
+
+
+ ADDR before PLAC (check ADDR is removed)
+
+
+ ADDR before PLAC (address matches previous one, then needs to be reassigned)
+
+
+ PLAC and no ADDR
+
+
+ PLAC matches previous one, then when ADDR is read need to create a new Place
+
+
+ PLAC and ADDR match, use existing one
+
+
+ Records not imported into INDI (individual) Gramps ID I0310:
+
+A second PLAC ignored Line 109: 2 PLAC a second PLACe ignored
+A second PLAC ignored Line 110: 2 PLAC and a third one also ignored
+
+
+
+
diff --git a/data/tests/sample.ged b/data/tests/sample.ged
new file mode 100644
index 000000000..6c939a488
--- /dev/null
+++ b/data/tests/sample.ged
@@ -0,0 +1,946 @@
+0 HEAD
+1 SOUR Gramps
+2 VERS 3.3.0
+2 NAME Gramps
+1 DATE 27 DEC 2010
+2 TIME 15:35:24
+1 SUBM @SUBM@
+1 FILE gramps33/example/gedcom/sample.ged
+1 COPR Copyright (c) 2010 Alex Roitman,,,.
+1 GEDC
+2 VERS 5.5
+2 FORM LINEAGE-LINKED
+1 CHAR UTF-8
+1 LANG French
+0 @SUBM@ SUBM
+1 NAME Alex Roitman,,,
+1 ADDR Not Provided
+2 CONT Not Provided
+2 ADR1 Not Provided
+0 @I0@ INDI
+1 NAME Anna /Hansdotter/
+2 GIVN Anna
+2 SURN Hansdotter
+1 SEX F
+1 BIRT
+2 TYPE Birth of Anna Hansdotter
+2 DATE 2 OCT 1864
+2 PLAC Löderup, Malmöhus Län, Sweden
+1 DEAT
+2 TYPE Death of Anna Hansdotter
+2 DATE 29 SEP 1945
+2 PLAC Sparks, Washoe Co., NV
+1 FAMS @F3@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I1@ INDI
+1 NAME Keith Lloyd /Smith/
+2 GIVN Keith Lloyd
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Keith Lloyd Smith
+2 DATE 11 AUG 1966
+2 PLAC San Francisco, San Francisco Co., CA
+1 FAMC @F8@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I10@ INDI
+1 NAME Hans Peter /Smith/
+2 GIVN Hans Peter
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Hans Peter Smith
+2 DATE 17 APR 1904
+2 PLAC Rønne, Bornholm, Denmark
+1 DEAT
+2 TYPE Death of Hans Peter Smith
+2 DATE 29 JAN 1977
+2 PLAC San Francisco, San Francisco Co., CA
+1 FAMC @F3@
+1 FAMS @F9@
+1 FAMS @F14@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I11@ INDI
+1 NAME Hanna /Smith/
+2 GIVN Hanna
+2 SURN Smith
+1 SEX F
+1 BIRT
+2 TYPE Birth of Hanna Smith
+2 DATE 29 JAN 1821
+2 PLAC Gladsax, Kristianstad Län, Sweden
+1 FAMC @F0@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I12@ INDI
+1 NAME Herman Julius /Nielsen/
+2 GIVN Herman Julius
+2 SURN Nielsen
+1 SEX M
+1 BIRT
+2 TYPE Birth of Herman Julius Nielsen
+2 DATE 31 AUG 1889
+2 PLAC Rønne, Bornholm, Denmark
+1 DEAT
+2 TYPE Death of Herman Julius Nielsen
+2 DATE 1945
+1 FAMS @F5@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I13@ INDI
+1 NAME Evelyn /Michaels/
+2 GIVN Evelyn
+2 SURN Michaels
+1 SEX F
+1 BIRT
+2 TYPE Birth of Evelyn Michaels
+2 DATE ABT 1897
+1 FAMS @F7@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I14@ INDI
+1 NAME Marjorie Lee /Smith/
+2 GIVN Marjorie Lee
+2 SURN Smith
+1 SEX F
+1 BIRT
+2 TYPE Birth of Marjorie Lee Smith
+2 DATE 4 NOV 1934
+2 PLAC Reno, Washoe Co., NV
+1 FAMC @F6@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I15@ INDI
+1 NAME Gus /Smith/
+2 GIVN Gus
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Gus Smith
+2 DATE 11 SEP 1897
+2 PLAC Rønne, Bornholm, Denmark
+1 DEAT
+2 TYPE Death of Gus Smith
+2 DATE 21 OCT 1963
+2 PLAC San Francisco, San Francisco Co., CA
+1 FAMC @F3@
+1 FAMS @F7@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I16@ INDI
+1 NAME Jennifer /Anderson/
+2 GIVN Jennifer
+2 SURN Anderson
+1 SEX F
+1 BIRT
+2 TYPE Birth of Jennifer Anderson
+2 DATE 5 NOV 1907
+2 PLAC Rønne, Bornholm, Denmark
+1 DEAT
+2 TYPE Death of Jennifer Anderson
+2 DATE 29 MAY 1985
+2 PLAC San Francisco, San Francisco Co., CA
+1 FAMS @F14@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I17@ INDI
+1 NAME Lillie Harriet /Jones/
+2 GIVN Lillie Harriet
+2 SURN Jones
+1 SEX F
+1 BIRT
+2 TYPE Birth of Lillie Harriet Jones
+2 DATE 2 MAY 1910
+2 PLAC Rønne, Bornholm, Denmark
+1 DEAT
+2 TYPE Death of Lillie Harriet Jones
+2 DATE 26 JUN 1990
+1 FAMS @F9@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I18@ INDI
+1 NAME John Hjalmar /Smith/
+2 GIVN John Hjalmar
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of John Hjalmar Smith
+2 DATE 30 JAN 1932
+2 PLAC San Francisco, San Francisco Co., CA
+1 FAMC @F6@
+1 FAMS @F12@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I19@ INDI
+1 NAME Eric Lloyd /Smith/
+2 GIVN Eric Lloyd
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Eric Lloyd Smith
+2 DATE 28 AUG 1963
+2 PLAC San Francisco, San Francisco Co., CA
+1 ADOP Y
+2 FAMC @F8@
+3 ADOP BOTH
+1 FAMC @F8@
+1 FAMS @F10@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I2@ INDI
+1 NAME Amber Marie /Smith/
+2 GIVN Amber Marie
+2 SURN Smith
+1 SEX F
+1 BIRT
+2 TYPE Birth of Amber Marie Smith
+2 DATE 12 APR 1998
+2 PLAC Hayward, Alameda Co., CA
+1 CHR
+2 TYPE Christening of Amber Marie Smith
+2 DATE 26 APR 1998
+2 PLAC Community Presbyterian Church, Danville, CA
+1 FAMC @F13@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I20@ INDI
+1 NAME Carl Emil /Smith/
+2 GIVN Carl Emil
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Carl Emil Smith
+2 DATE 20 DEC 1899
+2 PLAC Rønne, Bornholm, Denmark
+1 DEAT
+2 TYPE Death of Carl Emil Smith
+2 DATE 28 JAN 1959
+2 PLAC Reno, Washoe Co., NV
+2 CAUS Bad breath
+1 FAMC @F3@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I21@ INDI
+1 NAME Hjalmar /Smith/
+2 GIVN Hjalmar
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Hjalmar Smith
+2 DATE 31 JAN 1893
+2 PLAC Rønne, Bornholm, Denmark
+1 DEAT
+2 TYPE Death of Hjalmar Smith
+2 DATE 25 SEP 1894
+2 PLAC Rønne, Bornholm, Denmark
+1 FAMC @F3@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I22@ INDI
+1 NAME Martin /Smith/
+2 GIVN Martin
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Martin Smith
+2 DATE 19 NOV 1830
+2 PLAC Gladsax, Kristianstad Län, Sweden
+1 DEAT
+2 TYPE Death of Martin Smith
+2 DATE BET 1899 AND 1905
+2 PLAC Sweden
+1 BAPM
+2 TYPE Baptism of Martin Smith
+2 DATE 23 NOV 1830
+2 PLAC Gladsax, Kristianstad Län, Sweden
+1 FAMC @F0@
+1 FAMS @F2@
+1 NOTE @N0002@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I23@ INDI
+1 NAME Astrid Shermanna Augusta /Smith/
+2 GIVN Astrid Shermanna Augusta
+2 SURN Smith
+1 SEX F
+1 BIRT
+2 TYPE Birth of Astrid Shermanna Augusta Smith
+2 DATE 31 JAN 1889
+2 PLAC Rønne, Bornholm, Denmark
+1 DEAT
+2 TYPE Death of Astrid Shermanna Augusta Smith
+2 DATE 21 DEC 1963
+2 PLAC San Francisco, San Francisco Co., CA
+1 FAMC @F3@
+1 FAMS @F5@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I24@ INDI
+1 NAME Gustaf /Smith/ Sr.
+2 GIVN Gustaf
+2 SURN Smith
+2 NSFX Sr.
+1 SEX M
+1 BIRT
+2 TYPE Birth of Gustaf Smith, Sr.
+2 DATE 28 NOV 1862
+2 PLAC Grostorp, Kristianstad Län, Sweden
+1 DEAT
+2 TYPE Death of Gustaf Smith, Sr.
+2 DATE BEF 23 JUL 1930
+2 PLAC Sparks, Washoe Co., NV
+1 EVEN
+2 TYPE Immi
+2 DATE 21 MAY 1908
+2 PLAC Copenhagen, Denmark
+1 CHR
+2 TYPE Christening of Gustaf Smith, Sr.
+2 DATE 7 DEC 1862
+2 PLAC Gladsax, Kristianstad Län, Sweden
+1 FAMC @F2@
+1 FAMS @F3@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I25@ INDI
+1 NAME Marta /Ericsdotter/
+2 GIVN Marta
+2 SURN Ericsdotter
+1 SEX F
+1 BIRT
+2 TYPE Birth of Marta Ericsdotter
+2 DATE ABT 1775
+2 PLAC Sweden
+1 FAMS @F1@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I26@ INDI
+1 NAME Kirsti Marie /Smith/
+2 GIVN Kirsti Marie
+2 SURN Smith
+1 SEX F
+1 BIRT
+2 TYPE Birth of Kirsti Marie Smith
+2 DATE 15 DEC 1886
+2 PLAC Rønne, Bornholm, Denmark
+1 DEAT
+2 TYPE Death of Kirsti Marie Smith
+2 DATE 18 JUL 1966
+2 PLAC San Francisco, San Francisco Co., CA
+1 FAMC @F3@
+1 FAMS @F4@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I27@ INDI
+1 NAME Ingeman /Smith/
+2 GIVN Ingeman
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Ingeman Smith
+2 DATE ABT 1770
+2 PLAC Sweden
+1 FAMS @F1@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I28@ INDI
+1 NAME Anna /Streiffert/
+2 GIVN Anna
+2 SURN Streiffert
+1 SEX F
+1 BIRT
+2 TYPE Birth of Anna Streiffert
+2 DATE 23 SEP 1860
+2 PLAC Hoya/Jona/Hoia, Sweden
+1 DEAT
+2 TYPE Death of Anna Streiffert
+2 DATE 2 FEB 1927
+2 PLAC Rønne, Bornholm, Denmark
+1 FAMS @F11@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I29@ INDI
+1 NAME Craig Peter /Smith/
+2 GIVN Craig Peter
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Craig Peter Smith
+2 DATE AFT 1966
+2 PLAC San Francisco, San Francisco Co., CA
+1 CENS
+2 TYPE Census of Craig Peter Smith
+2 NOTE @N0000@
+1 FAMC @F8@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I3@ INDI
+1 NAME Magnes /Smith/
+2 GIVN Magnes
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Magnes Smith
+2 DATE 6 OCT 1858
+2 PLAC Simrishamn, Kristianstad Län, Sweden
+1 DEAT
+2 TYPE Death of Magnes Smith
+2 DATE 20 FEB 1910
+2 PLAC Rønne, Bornholm, Denmark
+1 FAMC @F2@
+1 FAMS @F11@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I30@ INDI
+1 NAME Janice Ann /Adams/
+2 GIVN Janice Ann
+2 SURN Adams
+1 SEX F
+1 BIRT
+2 TYPE Birth of Janice Ann Adams
+2 DATE 26 AUG 1965
+2 PLAC Fremont, Alameda Co., CA
+1 OCCU Retail Manager
+1 _DEG
+2 TYPE Business Management
+2 DATE 1988
+1 FAMS @F13@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I31@ INDI
+1 NAME Marjorie /Ohman/
+2 GIVN Marjorie
+2 SURN Ohman
+1 SEX F
+1 BIRT
+2 TYPE Birth of Marjorie Ohman
+2 DATE 3 JUN 1903
+2 PLAC Denver, Denver Co., CO
+1 DEAT
+2 TYPE Death of Marjorie Ohman
+2 DATE 22 JUN 1980
+2 PLAC Reno, Washoe Co., NV
+1 FAMS @F6@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I32@ INDI
+1 NAME Darcy /Horne/
+2 GIVN Darcy
+2 SURN Horne
+1 SEX F
+1 BIRT
+2 TYPE Birth of Darcy Horne
+2 DATE 2 JUL 1966
+2 PLAC Sacramento, Sacramento Co., CA
+1 FAMS @F10@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I33@ INDI
+1 NAME Lloyd /Smith/
+2 GIVN Lloyd
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Lloyd Smith
+2 DATE 13 MAR 1935
+2 PLAC San Francisco, San Francisco Co., CA
+1 FAMC @F9@
+1 FAMS @F8@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I34@ INDI
+1 NAME Alice Paula /Perkins/
+2 GIVN Alice Paula
+2 SURN Perkins
+1 SEX F
+1 BIRT
+2 TYPE Birth of Alice Paula Perkins
+2 DATE 22 NOV 1933
+2 PLAC Sparks, Washoe Co., NV
+1 FAMS @F12@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I35@ INDI
+1 NAME Lars Peter /Smith/
+2 GIVN Lars Peter
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Lars Peter Smith
+2 DATE 16 SEP 1991
+2 PLAC Santa Rosa, Sonoma Co., CA
+1 ADOP Y
+2 FAMC @F10@
+3 ADOP BOTH
+1 FAMC @F10@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I36@ INDI
+1 NAME Elna /Jefferson/
+2 GIVN Elna
+2 SURN Jefferson
+1 SEX F
+1 BIRT
+2 TYPE Birth of Elna Jefferson
+2 DATE 14 SEP 1800
+2 PLAC Gladsax, Kristianstad Län, Sweden
+1 DEAT
+2 TYPE Death of Elna Jefferson
+2 PLAC Sweden
+1 CHR
+2 TYPE Christening of Elna Jefferson
+2 DATE 16 SEP 1800
+2 PLAC Gladsax, Kristianstad Län, Sweden
+1 FAMS @F0@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I37@ INDI
+1 NAME Edwin Michael /Smith/
+2 GIVN Edwin Michael
+2 SURN Smith
+2 SOUR @S1@
+1 SEX M
+1 BIRT
+2 TYPE Birth of Edwin Michael Smith
+2 DATE 24 MAY 1961
+2 PLAC San Jose, Santa Clara Co., CA
+2 SOUR @S3@
+1 OCCU Software Engineer
+2 AGE 23
+2 NOTE @N0001@
+1 EDUC Education of Edwin Michael Smith
+2 DATE BET 1979 AND 1984
+2 PLAC UC Berkeley
+1 _DEG
+2 TYPE B.S.E.E.
+2 DATE 1984
+1 FAMC @F12@
+1 FAMS @F13@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I38@ INDI
+1 NAME Kerstina /Hansdotter/
+2 GIVN Kerstina
+2 SURN Hansdotter
+1 SEX F
+1 BIRT
+2 TYPE Birth of Kerstina Hansdotter
+2 DATE 29 NOV 1832
+2 PLAC Smestorp, Kristianstad Län, Sweden
+1 DEAT
+2 TYPE Death of Kerstina Hansdotter
+2 DATE BEF 1908
+2 PLAC Sweden
+1 FAMS @F2@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I39@ INDI
+1 NAME Martin /Smith/
+2 GIVN Martin
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Martin Smith
+2 DATE BET 1794 AND 1796
+2 PLAC Tommarp, Kristianstad Län, Sweden
+1 DEAT
+2 TYPE Death of Martin Smith
+2 PLAC Sweden
+1 FAMC @F1@
+1 FAMS @F0@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I4@ INDI
+1 NAME Ingeman /Smith/
+2 GIVN Ingeman
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Ingeman Smith
+2 DATE 29 JAN 1826
+2 PLAC Gladsax, Kristianstad Län, Sweden
+1 FAMC @F0@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I40@ INDI
+1 NAME Marjorie Alice /Smith/
+2 GIVN Marjorie Alice
+2 SURN Smith
+1 SEX F
+1 BIRT
+2 TYPE Birth of Marjorie Alice Smith
+2 DATE 5 FEB 1960
+2 PLAC San Jose, Santa Clara Co., CA
+1 FAMC @F12@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I41@ INDI
+1 NAME Janis Elaine /Green/
+2 GIVN Janis Elaine
+2 SURN Green
+1 SEX F
+1 BIRT
+2 TYPE Birth of Janis Elaine Green
+2 DATE 2 DEC 1935
+1 FAMS @F8@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I5@ INDI
+1 NAME Mason Michael /Smith/
+2 GIVN Mason Michael
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Mason Michael Smith
+2 DATE 26 JUN 1996
+2 PLAC Hayward, Alameda Co., CA
+1 CHR
+2 TYPE Christening of Mason Michael Smith
+2 DATE 10 JUL 1996
+2 PLAC Community Presbyterian Church, Danville, CA
+1 FAMC @F13@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I6@ INDI
+1 NAME Edwin /Willard/
+2 GIVN Edwin
+2 SURN Willard
+1 SEX M
+1 BIRT
+2 TYPE Birth of Edwin Willard
+2 DATE ABT 1886
+1 FAMS @F4@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I7@ INDI
+1 NAME Ingar /Smith/
+2 GIVN Ingar
+2 SURN Smith
+1 SEX F
+1 BIRT
+2 TYPE Birth of Ingar Smith
+2 DATE AFT 1823
+2 PLAC Gladsax, Kristianstad Län, Sweden
+1 FAMC @F0@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I8@ INDI
+1 NAME Hjalmar /Smith/
+2 GIVN Hjalmar
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Hjalmar Smith
+2 DATE 7 APR 1895
+2 PLAC Rønne, Bornholm, Denmark
+1 DEAT
+2 TYPE Death of Hjalmar Smith
+2 DATE 26 JUN 1975
+2 PLAC Reno, Washoe Co., NV
+1 BAPM
+2 TYPE Baptism of Hjalmar Smith
+2 DATE 3 JUN 1895
+2 PLAC Rønne Bornholm, Denmark
+1 EVEN
+2 TYPE Immi
+2 DATE 14 NOV 1912
+2 PLAC Copenhagen, Denmark
+1 FAMC @F3@
+1 FAMS @F6@
+1 NOTE @N0003@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @I9@ INDI
+1 NAME Emil /Smith/
+2 GIVN Emil
+2 SURN Smith
+1 SEX M
+1 BIRT
+2 TYPE Birth of Emil Smith
+2 DATE 27 SEP 1860
+2 PLAC Simrishamn, Kristianstad Län, Sweden
+1 FAMC @F2@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F0@ FAM
+1 HUSB @I39@
+1 WIFE @I36@
+1 MARR
+2 TYPE Marriage of Martin Smith and Elna Jefferson
+2 DATE ABT 1816
+2 PLAC Gladsax, Kristianstad Län, Sweden
+1 CHIL @I11@
+1 CHIL @I7@
+1 CHIL @I4@
+1 CHIL @I22@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F1@ FAM
+1 HUSB @I27@
+1 WIFE @I25@
+1 MARR
+2 TYPE Marriage of Ingeman Smith and Marta Ericsdotter
+2 DATE ABT 1790
+2 PLAC Sweden
+1 CHIL @I39@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F10@ FAM
+1 HUSB @I19@
+1 WIFE @I32@
+1 MARR
+2 TYPE Marriage of Eric Lloyd Smith and Darcy Horne
+2 DATE 12 JUL 1986
+2 PLAC Woodland, Yolo Co., CA
+1 CHIL @I35@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F11@ FAM
+1 HUSB @I3@
+1 WIFE @I28@
+1 MARR
+2 TYPE Marriage of Magnes Smith and Anna Streiffert
+2 DATE 24 AUG 1884
+2 PLAC Rønne, Bornholm, Denmark
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F12@ FAM
+1 HUSB @I18@
+1 WIFE @I34@
+1 MARR
+2 TYPE Marriage of John Hjalmar Smith and Alice Paula Perkins
+2 DATE 4 JUN 1954
+2 PLAC Sparks, Washoe Co., NV
+2 SOUR @S0@
+1 CHIL @I40@
+1 CHIL @I37@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F13@ FAM
+1 HUSB @I37@
+1 WIFE @I30@
+1 MARR
+2 TYPE Marriage of Edwin Michael Smith and Janice Ann Adams
+2 DATE 27 MAY 1995
+2 PLAC San Ramon, Conta Costa Co., CA
+1 ENGA
+2 TYPE Engagement of Edwin Michael Smith and Janice Ann Adams
+2 DATE 5 OCT 1994
+2 PLAC San Francisco, San Francisco Co., CA
+1 CHIL @I5@
+1 CHIL @I2@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F14@ FAM
+1 HUSB @I10@
+1 WIFE @I16@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F2@ FAM
+1 HUSB @I22@
+1 WIFE @I38@
+1 MARR
+2 TYPE Marriage of Martin Smith and Kerstina Hansdotter
+2 DATE ABT 1856
+1 CHIL @I3@
+1 CHIL @I9@
+1 CHIL @I24@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F3@ FAM
+1 HUSB @I24@
+1 WIFE @I0@
+1 MARR
+2 TYPE Marriage of Gustaf Smith, Sr. and Anna Hansdotter
+2 DATE 27 NOV 1885
+2 PLAC Rønne, Bornholm, Denmark
+1 CHIL @I26@
+1 CHIL @I23@
+1 CHIL @I21@
+1 CHIL @I8@
+1 CHIL @I15@
+1 CHIL @I20@
+1 CHIL @I10@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F4@ FAM
+1 HUSB @I6@
+1 WIFE @I26@
+1 MARR
+2 TYPE Marriage of Edwin Willard and Kirsti Marie Smith
+2 DATE ABT 1910
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F5@ FAM
+1 HUSB @I12@
+1 WIFE @I23@
+1 MARR
+2 TYPE Marriage of Herman Julius Nielsen and Astrid Shermanna Augusta Smith
+2 DATE 30 NOV 1912
+2 PLAC Rønne, Bornholm, Denmark
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F6@ FAM
+1 HUSB @I8@
+1 WIFE @I31@
+1 MARR
+2 TYPE Marriage of Hjalmar Smith and Marjorie Ohman
+2 DATE 31 OCT 1927
+2 PLAC Reno, Washoe Co., NV
+1 CHIL @I18@
+1 CHIL @I14@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F7@ FAM
+1 HUSB @I15@
+1 WIFE @I13@
+1 MARR
+2 TYPE Marriage of Gus Smith and Evelyn Michaels
+2 DATE ABT 1920
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F8@ FAM
+1 HUSB @I33@
+1 WIFE @I41@
+1 MARR
+2 TYPE Marriage of Lloyd Smith and Janis Elaine Green
+2 DATE 10 AUG 1958
+2 PLAC San Francisco, San Francisco Co., CA
+1 CHIL @I19@
+1 CHIL @I1@
+1 CHIL @I29@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @F9@ FAM
+1 HUSB @I10@
+1 WIFE @I17@
+1 CHIL @I33@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @S0@ SOUR
+1 TITL Marriage Certificae
+1 REPO @R0002@
+2 CALN what-321-ever
+3 MEDI Photo
+1 NOTE @N0004@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @S1@ SOUR
+1 TITL Birth Certificate
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @S2@ SOUR
+1 TITL Birth Records
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @S3@ SOUR
+1 TITL Birth, Death and Marriage Records
+1 REPO @R0002@
+2 CALN CA-123-LL-456_Num/ber
+3 MEDI Film
+1 NOTE @N0005@
+1 CHAN
+2 DATE 21 DEC 2007
+3 TIME 01:35:26
+0 @R0002@ REPO
+1 NAME New York Public Library
+1 ADDR 5th Ave at 42 street
+2 ADR1 5th Ave at 42 street
+2 CITY New York
+2 STAE New York
+2 POST 11111
+2 CTRY USA
+0 @R0003@ REPO
+1 NAME Aunt Martha's Attic
+1 ADDR 123 Main St
+2 ADR1 123 Main St
+2 CITY Someville
+2 STAE ST
+2 CTRY USA
+1 WWW http://library.gramps-project.org
+1 NOTE @N0006@
+0 @N0000@ NOTE Witness name: John Doe
+1 CONT Witness comment: This is a simple test.
+0 @N0001@ NOTE Witness name: No Name
+0 @N0002@ NOTE BIOGRAPHY
+1 CONT Martin was listed as being a Husman, (owning a house as opposed to a far
+1 CONC m) in the house records of Gladsax.
+0 @N0003@ NOTE BIOGRAPHY
+1 CONT
+1 CONT Hjalmar sailed from Copenhagen, Denmark on the OSCAR II, 14 November 191
+1 CONC 2 arriving in New York 27 November 1912. He was seventeen years old. O
+1 CONC n the ship passenger list his trade was listed as a Blacksmith. He cam
+1 CONC e to Reno, Nevada and lived with his sister Marie for a time before sett
+1 CONC ling in Sparks. He worked for Southern Pacific Railroad as a car inspect
+1 CONC or for a time, then went to work for Standard Oil
+1 CONT Company. He enlisted in the army at Sparks 7 December 1917 and served a
+1 CONC s a Corporal in the Medical Corp until his discharge 12 August 1919 at t
+1 CONC he Presidio in San Francisco, California. Both he and Marjorie are burie
+1 CONC d in the Masonic Memorial Gardens Mausoleum in Reno, he the 30th June 19
+1 CONC 75, and she the 25th of June 1980.
+0 @N0004@ NOTE But Aunt Martha still keeps the original!
+0 @N0005@ NOTE The repository reference from the source is important
+0 @N0006@ NOTE Some note on the repo
+0 TRLR
diff --git a/data/tests/sample.gramps b/data/tests/sample.gramps
new file mode 100644
index 000000000..e338b9100
--- /dev/null
+++ b/data/tests/sample.gramps
@@ -0,0 +1,1274 @@
+
+
+
+
+
+
+ Alex Roitman,,,
+ Not Provided
+
+
+
+
+ Birth
+
+
+ Birth of Anna Hansdotter
+
+
+ Death
+
+
+ Death of Anna Hansdotter
+
+
+ Birth
+
+
+ Birth of Keith Lloyd Smith
+
+
+ Birth
+
+
+ Birth of Hans Peter Smith
+
+
+ Death
+
+
+ Death of Hans Peter Smith
+
+
+ Birth
+
+
+ Birth of Hanna Smith
+
+
+ Birth
+
+
+ Birth of Herman Julius Nielsen
+
+
+ Death
+
+ Death of Herman Julius Nielsen
+
+
+ Birth
+
+ Birth of Evelyn Michaels
+
+
+ Birth
+
+
+ Birth of Marjorie Lee Smith
+
+
+ Birth
+
+
+ Birth of Gus Smith
+
+
+ Death
+
+
+ Death of Gus Smith
+
+
+ Birth
+
+
+ Birth of Jennifer Anderson
+
+
+ Death
+
+
+ Death of Jennifer Anderson
+
+
+ Birth
+
+
+ Birth of Lillie Harriet Jones
+
+
+ Death
+
+ Death of Lillie Harriet Jones
+
+
+ Birth
+
+
+ Birth of John Hjalmar Smith
+
+
+ Birth
+
+
+ Birth of Eric Lloyd Smith
+
+
+ Adopted
+
+
+ Birth
+
+
+ Birth of Amber Marie Smith
+
+
+ Christening
+
+
+ Christening of Amber Marie Smith
+
+
+ Birth
+
+
+ Birth of Carl Emil Smith
+
+
+ Death
+
+
+ Death of Carl Emil Smith
+
+
+
+ Birth
+
+
+ Birth of Hjalmar Smith
+
+
+ Death
+
+
+ Death of Hjalmar Smith
+
+
+ Birth
+
+
+ Birth of Martin Smith
+
+
+ Death
+
+
+ Death of Martin Smith
+
+
+ Baptism
+
+
+ Baptism of Martin Smith
+
+
+ Birth
+
+
+ Birth of Astrid Shermanna Augusta Smith
+
+
+ Death
+
+
+ Death of Astrid Shermanna Augusta Smith
+
+
+ Birth
+
+
+ Birth of Gustaf Smith, Sr.
+
+
+ Death
+
+
+ Death of Gustaf Smith, Sr.
+
+
+ Immi
+
+
+
+
+ Christening
+
+
+ Christening of Gustaf Smith, Sr.
+
+
+ Birth
+
+
+ Birth of Marta Ericsdotter
+
+
+ Birth
+
+
+ Birth of Kirsti Marie Smith
+
+
+ Death
+
+
+ Death of Kirsti Marie Smith
+
+
+ Birth
+
+
+ Birth of Ingeman Smith
+
+
+ Birth
+
+
+ Birth of Anna Streiffert
+
+
+ Death
+
+
+ Death of Anna Streiffert
+
+
+ Birth
+
+
+ Birth of Craig Peter Smith
+
+
+ Census
+ Census of Craig Peter Smith
+
+
+
+ Birth
+
+
+ Birth of Magnes Smith
+
+
+ Death
+
+
+ Death of Magnes Smith
+
+
+ Birth
+
+
+ Birth of Janice Ann Adams
+
+
+ Occupation
+ Retail Manager
+
+
+ Degree
+
+ Business Management
+
+
+ Birth
+
+
+ Birth of Marjorie Ohman
+
+
+ Death
+
+
+ Death of Marjorie Ohman
+
+
+ Birth
+
+
+ Birth of Darcy Horne
+
+
+ Birth
+
+
+ Birth of Lloyd Smith
+
+
+ Birth
+
+
+ Birth of Alice Paula Perkins
+
+
+ Birth
+
+
+ Birth of Lars Peter Smith
+
+
+ Adopted
+
+
+ Birth
+
+
+ Birth of Elna Jefferson
+
+
+ Death
+
+ Death of Elna Jefferson
+
+
+ Christening
+
+
+ Christening of Elna Jefferson
+
+
+ Birth
+
+
+ Birth of Edwin Michael Smith
+
+
+
+ Occupation
+ Software Engineer
+
+
+
+ Education
+
+
+ Education of Edwin Michael Smith
+
+
+ Degree
+
+ B.S.E.E.
+
+
+ Birth
+
+
+ Birth of Kerstina Hansdotter
+
+
+ Death
+
+
+ Death of Kerstina Hansdotter
+
+
+ Birth
+
+
+ Birth of Martin Smith
+
+
+ Death
+
+ Death of Martin Smith
+
+
+ Birth
+
+
+ Birth of Ingeman Smith
+
+
+ Birth
+
+
+ Birth of Marjorie Alice Smith
+
+
+ Birth
+
+ Birth of Janis Elaine Green
+
+
+ Birth
+
+
+ Birth of Mason Michael Smith
+
+
+ Christening
+
+
+ Christening of Mason Michael Smith
+
+
+ Birth
+
+ Birth of Edwin Willard
+
+
+ Birth
+
+
+ Birth of Ingar Smith
+
+
+ Birth
+
+
+ Birth of Hjalmar Smith
+
+
+ Death
+
+
+ Death of Hjalmar Smith
+
+
+ Baptism
+
+
+ Baptism of Hjalmar Smith
+
+
+ Immi
+
+
+
+
+ Birth
+
+
+ Birth of Emil Smith
+
+
+ Marriage
+
+
+ Marriage of Martin Smith and Elna Jefferson
+
+
+ Marriage
+
+
+ Marriage of Ingeman Smith and Marta Ericsdotter
+
+
+ Marriage
+
+
+ Marriage of Eric Lloyd Smith and Darcy Horne
+
+
+ Marriage
+
+
+ Marriage of Magnes Smith and Anna Streiffert
+
+
+ Marriage
+
+
+ Marriage of John Hjalmar Smith and Alice Paula Perkins
+
+
+
+ Marriage
+
+
+ Marriage of Edwin Michael Smith and Janice Ann Adams
+
+
+ Engagement
+
+
+ Engagement of Edwin Michael Smith and Janice Ann Adams
+
+
+ Marriage
+
+ Marriage of Martin Smith and Kerstina Hansdotter
+
+
+ Marriage
+
+
+ Marriage of Gustaf Smith, Sr. and Anna Hansdotter
+
+
+ Marriage
+
+ Marriage of Edwin Willard and Kirsti Marie Smith
+
+
+ Marriage
+
+
+ Marriage of Herman Julius Nielsen and Astrid Shermanna Augusta Smith
+
+
+ Marriage
+
+
+ Marriage of Hjalmar Smith and Marjorie Ohman
+
+
+ Marriage
+
+ Marriage of Gus Smith and Evelyn Michaels
+
+
+ Marriage
+
+
+ Marriage of Lloyd Smith and Janis Elaine Green
+
+
+
+
+ F
+
+ Anna
+ Hansdotter
+
+
+
+
+
+
+ M
+
+ Keith Lloyd
+ Smith
+
+
+
+
+
+ M
+
+ Hans Peter
+ Smith
+
+
+
+
+
+
+
+
+ F
+
+ Hanna
+ Smith
+
+
+
+
+
+ M
+
+ Herman Julius
+ Nielsen
+
+
+
+
+
+
+ F
+
+ Evelyn
+ Michaels
+
+
+
+
+
+ F
+
+ Marjorie Lee
+ Smith
+
+
+
+
+
+ M
+
+ Gus
+ Smith
+
+
+
+
+
+
+
+ F
+
+ Jennifer
+ Anderson
+
+
+
+
+
+
+ F
+
+ Lillie Harriet
+ Jones
+
+
+
+
+
+
+ M
+
+ John Hjalmar
+ Smith
+
+
+
+
+
+
+ M
+
+ Eric Lloyd
+ Smith
+
+
+
+
+
+
+
+ F
+
+ Amber Marie
+ Smith
+
+
+
+
+
+
+ M
+
+ Carl Emil
+ Smith
+
+
+
+
+
+
+ M
+
+ Hjalmar
+ Smith
+
+
+
+
+
+
+ M
+
+ Martin
+ Smith
+
+
+
+
+
+
+
+
+
+ F
+
+ Astrid Shermanna Augusta
+ Smith
+
+
+
+
+
+
+
+ M
+
+ Gustaf
+ Smith
+ Sr.
+
+
+
+
+
+
+
+
+
+ F
+
+ Marta
+ Ericsdotter
+
+
+
+
+
+ F
+
+ Kirsti Marie
+ Smith
+
+
+
+
+
+
+
+ M
+
+ Ingeman
+ Smith
+
+
+
+
+
+ F
+
+ Anna
+ Streiffert
+
+
+
+
+
+
+ M
+
+ Craig Peter
+ Smith
+
+
+
+
+
+
+ M
+
+ Magnes
+ Smith
+
+
+
+
+
+
+
+ F
+
+ Janice Ann
+ Adams
+
+
+
+
+
+
+
+ F
+
+ Marjorie
+ Ohman
+
+
+
+
+
+
+ F
+
+ Darcy
+ Horne
+
+
+
+
+
+ M
+
+ Lloyd
+ Smith
+
+
+
+
+
+
+ F
+
+ Alice Paula
+ Perkins
+
+
+
+
+
+ M
+
+ Lars Peter
+ Smith
+
+
+
+
+
+
+ F
+
+ Elna
+ Jefferson
+
+
+
+
+
+
+
+ M
+
+ Edwin Michael
+ Smith
+
+
+
+
+
+
+
+
+
+
+
+
+ F
+
+ Kerstina
+ Hansdotter
+
+
+
+
+
+
+ M
+
+ Martin
+ Smith
+
+
+
+
+
+
+
+ M
+
+ Ingeman
+ Smith
+
+
+
+
+
+ F
+
+ Marjorie Alice
+ Smith
+
+
+
+
+
+ F
+
+ Janis Elaine
+ Green
+
+
+
+
+
+ M
+
+ Mason Michael
+ Smith
+
+
+
+
+
+
+ M
+
+ Edwin
+ Willard
+
+
+
+
+
+ F
+
+ Ingar
+ Smith
+
+
+
+
+
+ M
+
+ Hjalmar
+ Smith
+
+
+
+
+
+
+
+
+
+
+ M
+
+ Emil
+ Smith
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2
+
+
+
+ 2
+
+
+
+ 2
+
+
+
+
+
+ Birth Certificate
+
+
+ Birth, Death and Marriage Records
+
+
+
+
+ Marriage Certificae
+
+
+
+
+ Birth Records
+
+
+
+
+ Löderup, Malmöhus Län, Sweden
+
+
+
+ Sparks, Washoe Co., NV
+
+
+
+ San Francisco, San Francisco Co., CA
+
+
+
+ Rønne, Bornholm, Denmark
+
+
+
+ Gladsax, Kristianstad Län, Sweden
+
+
+
+ Reno, Washoe Co., NV
+
+
+
+ Hayward, Alameda Co., CA
+
+
+
+ Community Presbyterian Church, Danville, CA
+
+
+
+ Sweden
+
+
+
+ Grostorp, Kristianstad Län, Sweden
+
+
+
+ Copenhagen, Denmark
+
+
+
+ Hoya/Jona/Hoia, Sweden
+
+
+
+ Simrishamn, Kristianstad Län, Sweden
+
+
+
+ Fremont, Alameda Co., CA
+
+
+
+ Denver, Denver Co., CO
+
+
+
+ Sacramento, Sacramento Co., CA
+
+
+
+ Santa Rosa, Sonoma Co., CA
+
+
+
+ San Jose, Santa Clara Co., CA
+
+
+
+ UC Berkeley
+
+
+
+ Smestorp, Kristianstad Län, Sweden
+
+
+
+ Tommarp, Kristianstad Län, Sweden
+
+
+
+ Rønne Bornholm, Denmark
+
+
+
+ Woodland, Yolo Co., CA
+
+
+
+ San Ramon, Conta Costa Co., CA
+
+
+
+
+
+ New York Public Library
+ Library
+
+ 5th Ave at 42 street
+ New York
+ New York
+ USA
+ 11111
+
+
+
+ Aunt Martha's Attic
+ Library
+
+ 123 Main St
+ Someville
+ ST
+ USA
+
+
+
+
+
+
+
+ BIOGRAPHY
+Martin was listed as being a Husman, (owning a house as opposed to a farm) in the house records of Gladsax.
+
+
+ Witness name: John Doe
+Witness comment: This is a simple test.
+
+
+ Witness name: No Name
+
+
+ BIOGRAPHY
+
+Hjalmar sailed from Copenhagen, Denmark on the OSCAR II, 14 November 1912 arriving in New York 27 November 1912. He was seventeen years old. On the ship passenger list his trade was listed as a Blacksmith. He came to Reno, Nevada and lived with his sister Marie for a time before settling in Sparks. He worked for Southern Pacific Railroad as a car inspector for a time, then went to work for Standard Oil
+Company. He enlisted in the army at Sparks 7 December 1917 and served as a Corporal in the Medical Corp until his discharge 12 August 1919 at the Presidio in San Francisco, California. Both he and Marjorie are buried in the Masonic Memorial Gardens Mausoleum in Reno, he the 30th June 1975, and she the 25th of June 1980.
+
+
+ But Aunt Martha still keeps the original!
+
+
+ The repository reference from the source is important
+
+
+ Some note on the repo
+
+
+
diff --git a/data/tests/test_FTM_CONC.difs b/data/tests/test_FTM_CONC.difs
new file mode 100644
index 000000000..c372c4222
--- /dev/null
+++ b/data/tests/test_FTM_CONC.difs
@@ -0,0 +1,17 @@
+Mismatch on file: test_FTM_CONC.ged
+Source: S0029 handle=0000000500000005
+ Diff on: Source, pubinfo
+ 73: Name: Ancestry.com Operations, Inc.; Location: Provo, UT, USA; Date:2009;
+ 74: Name: Ancestry.com Operations, Inc.; Location: Provo, UT, USA; Date: 2009;
+Citation: C0000 handle=0000000600000006
+ Diff on: Citation, page
+ 102: Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll:M432_394; Page: 435B; Image: 248
+ 103: Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll: M432_394; Page: 435B; Image: 248
+Note: N0000 handle=0000000200000002
+ Diff on: Note, text, string
+ 54: The FTM way to do a CONC line with space at end --><--
+ 55: The FTM way to do a CONC line with space at end --> <--
+Note: N0002 handle=0000000400000004
+ Diff on: Note, text, string
+ 136: Be nice if we supported FTM way to do CONC sousers would not have to spell check and edit their whole database for these kind of errors.
+ 137: Be nice if we supported FTM way to do CONC so users would not have to spell check and edit their whole database for these kind of errors.
diff --git a/data/tests/test_FTM_CONC.ged b/data/tests/test_FTM_CONC.ged
new file mode 100644
index 000000000..4baf739dc
--- /dev/null
+++ b/data/tests/test_FTM_CONC.ged
@@ -0,0 +1,42 @@
+0 HEAD
+1 SOUR FTM
+2 VERS Family Tree Maker (22.2.5)
+2 NAME Family Tree Maker for Mac OS X
+2 CORP Ancestry.com
+3 ADDR 360 W 4800 N
+4 CONT Provo, UT 84604
+3 PHON (801) 705-7000
+1 DEST GED55
+1 DATE 16 DEC 2015
+1 CHAR UTF-8
+1 FILE test_FTM_CONC.ged
+1 SUBM @SUBM@
+1 GEDC
+2 VERS 5.5
+2 FORM LINEAGE-LINKED
+0 @SUBM@ SUBM
+1 NAME Paul Culley
+0 @I278@ INDI
+1 NAME Andrew /May/
+2 NOTE The FTM way to do a CONC line with space at end -->
+3 CONC <--
+2 NOTE The GEDCOM spec way to do CONC line, with space at beginning -->
+3 CONC <--
+2 NOTE Be nice if we supported FTM way to do CONC so
+3 CONC users would not have to spell check and edit their whole
+3 CONC database for these kind of errors.
+2 SOUR @S29@
+3 PAGE Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll:
+4 CONC M432_394; Page: 435B; Image: 248
+0 @S29@ SOUR
+1 AUTH Ancestry.com
+1 TITL 1850 United States Federal Census
+1 PUBL Name: Ancestry.com Operations, Inc.; Location: Provo, UT, USA; Date:
+2 CONC 2009;
+1 REPO @R1@
+0 @R1@ REPO
+1 NAME Ancestry.com
+1 ADDR I'm sure someone knows
+1 EMAIL ancestry@ancestry.com
+1 PHON 1-234-567-8901
+0 TRLR
diff --git a/data/tests/test_FTM_CONC.gramps b/data/tests/test_FTM_CONC.gramps
new file mode 100644
index 000000000..564030f73
--- /dev/null
+++ b/data/tests/test_FTM_CONC.gramps
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+ U
+
+ Andrew
+ May
+
+
+
+
+
+
+
+
+
+ Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll: M432_394; Page: 435B; Image: 248
+ 2
+
+
+
+
+
+ 1850 United States Federal Census
+ Ancestry.com
+ Name: Ancestry.com Operations, Inc.; Location: Provo, UT, USA; Date: 2009;
+
+
+
+
+
+ Ancestry.com
+ Library
+
+ I'm sure someone knows
+ 1-234-567-8901
+
+
+
+
+
+
+ The FTM way to do a CONC line with space at end --> <--
+
+
+ The GEDCOM spec way to do CONC line, with space at beginning --> <--
+
+
+ Be nice if we supported FTM way to do CONC so users would not have to spell check and edit their whole database for these kind of errors.
+
+
+
diff --git a/data/tests/vcard.difs b/data/tests/vcard.difs
new file mode 100644
index 000000000..35b0519ee
--- /dev/null
+++ b/data/tests/vcard.difs
@@ -0,0 +1,5 @@
+Mismatch on file: vcard.vcf
+Person: I0019 handle=0000001800000018
+ Diff on: Person, primary_name, surname list #2, primary
+ : True
+ : False
diff --git a/data/tests/vcard.gramps b/data/tests/vcard.gramps
new file mode 100644
index 000000000..1216c48b4
--- /dev/null
+++ b/data/tests/vcard.gramps
@@ -0,0 +1,424 @@
+
+
+
+
+
+
+ Paul Culley
+ 11210 Olde Mint House Ln
+ Tomball
+ Tx
+ USA
+ 77375
+ paulr2787@gmail.com
+
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+ Occupation
+ scarecrow
+
+
+ Birth
+
+
+
+ Birth
+
+
+
+
+
+ U
+
+ Lastname
+
+
+ box 1 bis Broadway 11
+ New York
+ New York
+ USA
+ NY1234
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Lastname
+
+
+ Broadway 11
+ New York
+
+
+
+ U
+
+ Lastname
+
+
+ Broadway 11
+ New,York
+ USA
+
+
+
+ U
+
+ Lastname
+
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Lastname
+
+
+
+
+ U
+
+ Lastname
+
+
+
+
+ U
+
+ Lastname
+
+
+
+
+ U
+
+ Lastname
+
+
+
+
+ U
+
+ A B
+ B
+ Lastname
+
+
+
+ U
+
+ A B
+ Lastname
+
+
+
+ U
+
+ A B
+ Lastname
+
+
+
+ U
+
+ A B C
+ B
+ Lastname
+
+
+
+ U
+
+ A
+ Lastname
+
+
+
+ U
+
+ A
+ Lastname
+
+
+
+ U
+
+ A
+ Lastname
+
+
+
+ U
+
+ A B
+ Lastname
+
+
+
+ U
+
+ B A
+ A
+ Lastname
+
+
+
+ U
+
+ Lastname
+ Lastname2
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Alembert
+
+
+
+ U
+
+ Firstname Middlename
+ Lastname
+ Jr.
+ Mr.
+
+
+
+ U
+
+ Firstname
+ Lastname
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Lastname
+
+
+ A
+
+
+ B,C
+
+
+
+ U
+
+ Lastname
+
+
+ Ton
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Lastname
+
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Lastname
+
+
+ 01234-56789
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Lastname
+
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Lastname
+
+
+
+
+ U
+
+ Lastname
+
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Another
+
+
+
+ U
+
+ Lastname
+
+
+ 01234-56789
+
+
+
+ U
+
+ Lastname
+
+
+ 01234-56789
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Lastname
+
+
+ 01234-56789
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Lastname
+
+
+ 01234-56789
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Another
+
+
+
+ U
+
+ Lastname
+
+
+ 01234-56789
+
+
+
+ U
+
+ Lastname
+
+
+
+ U
+
+ Lastname
+
+
+
+
diff --git a/data/tests/vcard.vcf b/data/tests/vcard.vcf
new file mode 100644
index 000000000..113118210
--- /dev/null
+++ b/data/tests/vcard.vcf
@@ -0,0 +1,291 @@
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+ADR:box 1;bis;Broadway 11; New York; New York; NY1234; USA
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+ADR:
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+ADR:;;Broadway 11; New York
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+ADR:;;Broadway 11; New\,York; ;; USA; Earth
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+BDAY:2001-09-28T09:23:47Z
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+BDAY:
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+BDAY:20010928
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+BDAY:2001-0928
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+BDAY:2001-09-28
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+EMAIL:me@example.org
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:A B Lastname
+N:Lastname;B;A;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:B Lastname
+N:Lastname;A;B;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:A Lastname
+N:Lastname;A;B;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:A B C Lastname
+N:Lastname;B;A C;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:A Lastname
+N:Lastname;A;;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:
+N:Lastname;;A;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:A Lastname
+N:Lastname;;A;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:A B Lastname
+N:Lastname;A;B;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname B A
+N:Lastname;A;B;;
+FN:Lastname A B
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname Lastname2
+N:Lastname,Lastname2;;;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+N:Another;;;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:van d'Alembert
+N:van d'Alembert;;;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Mr. Firstname Middlename Lastname Jr.
+N:Lastname;Firstname;Middlename;Mr.;Jr.
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Firstname Lastname
+N:Lastname; Firstname;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+NICKNAME:
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+NICKNAME:A,B\,C
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+NICKNAME:Ton
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+ROLE:
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+ROLE:scarecrow
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+TEL:
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+TEL:01234-56789
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+URL:
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+URL:http://www.example.com
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+BDAY:unforgettable
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+BDAY:20010229
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Another
+N:Another;;;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+TEL:01234-
+ 56789
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+TEL:01234-56789
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+TEL:01234-56789
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+:email@example.com
+END:VCARD
+BEGIN:VCARD
+group.VERSION:3.0
+FN:Lastname
+group.N:Lastname;;;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+TEL;TYPE="FANCY:TYPE":01234-56789
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+BEGIN:VCARD
+VERSION:3.0
+FN:Another
+N:Another;;;;
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+tel:01234-56789
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+TEL;01234-56789
+END:VCARD
+BEGIN:VCARD
+VERSION:3.0
+FN:Lastname
+N:Lastname;;;;
+TELEPHONE:01234-56789
+END:VCARD
diff --git a/gramps/gen/utils/id.py b/gramps/gen/utils/id.py
index f8e8f21b0..63a0436d9 100644
--- a/gramps/gen/utils/id.py
+++ b/gramps/gen/utils/id.py
@@ -46,11 +46,19 @@ from ..const import GRAMPS_UUID
# create_id
#
#-------------------------------------------------------------------------
-rand = random.Random(time.time())
+_rand = random.Random(time.time())
+_det_id = False
+
def create_id():
- return "%08x%08x" % (int(time.time()*10000),
- rand.randint(0, sys.maxsize))
+ global _rand
+ if _det_id:
+ _rand = _rand + 1
+ return "%08x%08x" % (_rand, _rand)
+ else:
+ return "%08x%08x" % (int(time.time()*10000),
+ _rand.randint(0, sys.maxsize))
+
def create_uid(self, handle=None):
if handle:
@@ -59,3 +67,11 @@ def create_uid(self, handle=None):
uid = uuid.uuid4()
return uid.hex.upper()
+
+def set_det_id(self, val=True):
+ global _rand, _det_id
+ _det_id = val
+ if _det_id is True:
+ _rand = 0
+ else:
+ _rand = random.Random(time.time())
diff --git a/gramps/plugins/test/test_imports.py b/gramps/plugins/test/test_imports.py
new file mode 100644
index 000000000..1d51ea5c1
--- /dev/null
+++ b/gramps/plugins/test/test_imports.py
@@ -0,0 +1,255 @@
+#! /usr/bin/env python3
+""" Test program for import modules
+"""
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (c) 2016 Gramps Development Team
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+import unittest
+import os
+import sys
+import re
+import logging
+
+from gramps.gen.merge.diff import diff_dbs, import_as_dict
+from gramps.gen.simple import SimpleAccess
+from gramps.gen.utils.id import set_det_id
+from gramps.cli.user import User
+from gramps.gen.const import TEMP_DIR, DATA_DIR
+
+logger = logging.getLogger(__name__)
+
+# the following defines where to find the test import and result files
+TEST_DIR = os.path.abspath(os.path.join(DATA_DIR, "tests"))
+
+# ------------------------------------------------------------------
+# Local Functions
+# ------------------------------------------------------------------
+
+
+class CompleteCheck(unittest.TestCase):
+ """The test class cases will be dynamically created at import time from
+ files to be tested. The following defs are used by the test cases
+ """
+
+ def prepare_result(self, diffs, added, missing):
+ """ Looks through the diffs, added, and missing items and begins
+ reporting process. Returns True if there were significant errors.
+ """
+ # pylint: disable=E1101
+ # pylint does not like dynamically created methods
+ deltas = False
+ if diffs:
+ for diff in diffs:
+ obj_type, item1, item2 = diff
+ msg = self._report_diff(obj_type, item1.to_struct(),
+ item2.to_struct())
+ if msg != "":
+ if hasattr(item1, "gramps_id"):
+ self.msg += "%s: %s handle=%s\n" % \
+ (obj_type, item1.gramps_id,
+ getattr(item1, "handle"))
+ else:
+ self.msg += "%s: %s\n" % (obj_type, item1.get_name())
+ self.msg += msg
+ deltas = True
+ if missing:
+ deltas = True
+ sac = SimpleAccess(self.database1)
+ for pair in missing:
+ obj_type, item = pair
+ self.msg += "Missing %s: %s\n" % (obj_type, sac.describe(item))
+ if added:
+ deltas = True
+ sac = SimpleAccess(self.database2)
+ for pair in added:
+ obj_type, item = pair
+ self.msg += "Added %s: %s\n" % (obj_type, sac.describe(item))
+ return deltas
+
+
+ def _report_diff(self, path, struct1, struct2):
+ """
+ Compare two struct objects and report differences.
+ """
+ msg = ""
+ if struct1 == struct2:
+ return ""
+ elif (isinstance(struct1, (list, tuple)) or
+ isinstance(struct2, (list, tuple))):
+ len1 = len(struct1) if isinstance(struct1, (list, tuple)) else 0
+ len2 = len(struct2) if isinstance(struct2, (list, tuple)) else 0
+ for pos in range(max(len1, len2)):
+ value1 = struct1[pos] if pos < len1 else None
+ value2 = struct2[pos] if pos < len2 else None
+ msg += self._report_diff(path + ("[%d]" % pos), value1, value2)
+ elif isinstance(struct1, dict) or isinstance(struct2, dict):
+ keys = struct1.keys() if isinstance(struct1, dict)\
+ else struct2.keys()
+ for key in keys:
+ value1 = struct1[key] if struct1 is not None else None
+ value2 = struct2[key] if struct2 is not None else None
+ if key == "dict": # a raw dict, not a struct
+ msg += _report_details(path, value1, value2)
+ else:
+ msg += self._report_diff(path + "." + key, value1, value2)
+ else:
+ msg += _report_details(path, struct1, struct2)
+ return msg
+
+
+def _report_details(path, diff1, diff2):
+ """ Checks if a detail is significant, needs adjusting for xml filter
+ effects, and returns a string describing the specific difference.
+ """
+ if isinstance(diff1, bool):
+ desc1 = repr(diff1)
+ else:
+ desc1 = str(diff1) if diff1 else ""
+ if isinstance(diff2, bool):
+ desc2 = repr(diff2)
+ else:
+ desc2 = str(diff2) if diff2 else ""
+ d1t = type(diff1)
+ d2t = type(diff2)
+ # the xml exporter edits the data base by stripping spaces, so
+ # we have to ignore these differences
+ if d1t == str:
+ diff1 = diff1.strip()
+ if d2t == str:
+ diff2 = diff2.strip()
+ d1l = len(diff1) if d1t == str else ""
+ d2l = len(diff2) if d2t == str else ""
+ # 'change' date is not significant for comparison
+ if path.endswith(".change"):
+ return ""
+ # the xml exporter edits the data base by converting media path
+ # to unix '/' conventions, so we have to ignore these differences
+ if path == "Media.path":
+ diff1 = diff1.replace('\\', '/')
+ if diff1 != diff2:
+ msg = " Diff on: %s\n %s%s: %s\n %s%s: %s\n" % \
+ (_format_struct_path(path), d1t, d1l, desc1,
+ d2t, d2l, desc2)
+ return msg
+ return ""
+
+
+def _format_struct_path(path):
+ """ prepares a 'path' string for the report out of the structure.
+ """
+ retval = ""
+ parts = path.split(".")
+ for part in parts:
+ if retval:
+ retval += ", "
+ if "[" in part and "]" in part:
+ part, index = re.match(r"(.*)\[(\d*)\]", part).groups()
+ retval += "%s #%s" % (part.replace("_", " "), int(index) + 1)
+ else:
+ retval += part
+ return retval
+
+
+def make_tst_function(tstfile, file_name):
+ """ This is here to support the dynamic function creation. This creates
+ the test function (a method, to be precise).
+ """
+ def tst(self):
+ """ This compares the import file with the expected result '.gramps'
+ file.
+ """
+ self.user = User(quiet=True)
+ fn1 = os.path.join(TEST_DIR, tstfile)
+ fn2 = os.path.join(TEST_DIR, (file_name + ".gramps"))
+ fres = os.path.join(TEMP_DIR, (file_name + ".difs"))
+ try:
+ os.remove(fres)
+ except OSError:
+ pass
+ logging.info("\n**** %s ****", tstfile)
+ set_det_id(True)
+ self.database1 = import_as_dict(fn1, self.user)
+ set_det_id(True)
+ self.database2 = import_as_dict(fn2, self.user)
+ self.assertIsNotNone(self.database1,
+ "Unable to import file: %s" % fn1)
+ self.assertIsNotNone(self.database2,
+ "Unable to import expected result file: %s" % fn2)
+ if self.database2 is None or self.database1 is None:
+ return
+ diffs, added, missing = diff_dbs(self.database1,
+ self.database2, self.user)
+ self.msg = "Mismatch on file: %s\n" % tstfile
+ deltas = self.prepare_result(diffs, added, missing)
+ # We save a copy of any issues in the users Gramps TEMP_DIR in a file
+ # with a '.difs' extension, as well as usual unittest report
+ if deltas:
+ hres = open(fres, mode='w', encoding='utf-8',
+ errors='replace')
+ hres.write(self.msg)
+ hres.close()
+ # let's see if we have any allowed exception file
+ fdif = os.path.join(TEST_DIR, (file_name + ".difs"))
+ try:
+ hdif = open(fdif)
+ msg = hdif.read()
+ hdif.close()
+ except (FileNotFoundError, IOError):
+ msg = ""
+ # if exception file matches exactly, we are done.
+ if self.msg != msg:
+ self.fail(self.msg)
+ return tst
+
+# let's see if we have a single file to run, example;
+# "python test_import.py -i sample.ged"
+# This only works for files in normal test directory, so don't add a path
+#pylint: disable=invalid-name
+_tstfile = ""
+if __name__ == "__main__":
+ for i, option in enumerate(sys.argv):
+ if option == '-i':
+ _tstfile = sys.argv[i+1]
+ del sys.argv[i]
+ del sys.argv[i]
+# The following code dynamically creates the methods for each test file.
+# The methods are inserted at load time into the 'CompleteCheck' class
+# via the modules' globals, taking advantage that they are a dict.
+if _tstfile: # single file mode
+ (fname, ext) = os.path.splitext(os.path.basename(_tstfile))
+ test_func = make_tst_function(_tstfile, fname)
+ clname = 'Import_{0}'.format(_tstfile)
+ globals()[clname] = type(clname,
+ (CompleteCheck,),
+ {"testit": test_func})
+else:
+ for _tstfile in os.listdir(TEST_DIR):
+ (fname, ext) = os.path.splitext(os.path.basename(_tstfile))
+ if ext == ".gramps" or ext == ".difs" or ext == ".bak":
+ continue
+ test_func = make_tst_function(_tstfile, fname)
+ clname = 'Import_{0}'.format(_tstfile)
+ globals()[clname] = type(clname,
+ (CompleteCheck,),
+ {"testit": test_func})
+
+
+if __name__ == "__main__":
+ unittest.main()