Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

ExtendedJavaTest

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

The Java program generates about 260,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 384 test(s).
Test ExtendedTransitionTest_Africa_Abidjan passed.
...
Test ExtendedTransitionTest_Pacific_Wallis passed.
TestRunner duration: 0.113 seconds.
test(s).
TestRunner summary: 384 passed, 0 failed, 0 skipped, 0 timed out, out of 384 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