forked from gramps-project/gramps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly assign sortval = 0 when a date is EMPTY
The is_valid() method for a Date simply checks the sortval for a zero value. However, if an empty date is passed to _calc_sort_value() it first adjusts to 1 ALL y,m,d values that are zero. Thus, an empty date would return a sortval for the year 1-1-1 as a valid date. The problematic part of the test calculates an age for somebody with a birth date of "" (an empty string) and a death date given by a year, such as 1760. The previous test code required it to report "greater than 110 years", which should not be a suitable response. The previous code also reported an age of negative 1999 years for a birth year of 2000 and a death date of the empty string. The unit test code now tests against a reply of "unknown". Fixes #13415, #13423.
- Loading branch information
1 parent
9aacb07
commit e898c78
Showing
2 changed files
with
17 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters