Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

BasicJavaTest

This unit test compares the DST transitions calculated by the BasicZoneProcessor class (which uses the zonedb data files) with the validation_data.cpp file generated by the Java ../../tools/compare_java/TestDataGenerator.java program.

The Java tool generates about 130,000 data points spanning the year 2000 to 2050. It is too large to run on any Arduino board that I am aware of, including the ESP32. However it does run on a Linux machine using the UnixHostDuino adapter layer.

Running the Test

Assuming that you have g++ and make installed, just type:

$ make clean && make -j 4

$ make runtests
TestRunner started on 268 test(s).
Test BasicTransitionTest_Africa_Abidjan passed.
...
Test BasicTransitionTest_Pacific_Wallis passed.
TestRunner duration: 0.070 seconds.
TestRunner summary: 268 passed, 0 failed, 0 skipped, 0 timed out, out of 268 test(s).

$ make clean

Java JDK Version

The TZ Database version used by the TestDataGenerator.java program and the version that generated the zonedbx files must match for this unit test to succeed. For example, one of JDK versions used to run this test was openjdk version "11.0.3" 2019-04-16 (see java -version) which seems to use version 2018g. So the Makefile generates the zoneinfo files for 2018g` specifically for this test.

Compiling the Java Generator

The Makefile assumes that you have already compiled the TestDataGenerator.java program into TestDataGenerator.class. Type the following if you have not done so:

$ cd .../tools/compare_java
$ make