2018-03-15 11:08:20 +00:00
|
|
|
# TZ Test
|
2015-08-15 16:00:42 -04:00
|
|
|
|
2018-03-15 11:08:20 +00:00
|
|
|
## How to Test
|
2015-08-15 16:00:42 -04:00
|
|
|
|
2018-03-15 11:08:20 +00:00
|
|
|
* Install tz.cpp by downloading the IANA timezone database at: http://www.iana.org/time-zones You only need the data, not the code.
|
|
|
|
* Change the string `install` in tz.cpp to point to your downloaded IANA database.
|
2015-08-15 16:00:42 -04:00
|
|
|
* Compile validate.cpp along with tz.cpp.
|
|
|
|
* Run the binary and direct the terminal output to a temporary file.
|
2018-03-15 11:08:20 +00:00
|
|
|
* Unzip the tzdata file that has the version corresponding to the IANA database you downloaded (e.g. tzdata2015f.txt.zip).
|
|
|
|
* Compare the unzipped txt file with the output of your validate test program. If they are identical, the test passes, else it fails.
|
2015-08-15 16:00:42 -04:00
|
|
|
|
2018-03-15 11:08:20 +00:00
|
|
|
## Miscellaneous
|
2015-08-15 16:00:42 -04:00
|
|
|
|
|
|
|
You can also compare one version of the tzdatabase with another using
|
|
|
|
these uncompressed text files. The text files contain for each
|
|
|
|
timezone its initial state, and each {offset, abbreviation} change
|
|
|
|
contained in the database up through the year 2035. As the database
|
|
|
|
versions change, minor updates to the set of these transitions are
|
|
|
|
typically made, typically due to changes in government policies.
|
|
|
|
|
|
|
|
The tests in this section will run much faster with optimizations
|
2018-03-15 11:08:20 +00:00
|
|
|
cranked up.
|