On 2009-02-08 08:18-0800 Alan W. Irwin wrote:

> My next step is to implement forceJulian=-1 (i.e., forced proleptic
> Gregorian mode regardless of date) for breakDownMJD, and then to compare
> breakDownMJD with gmtime for forceJulian=-1 over a very wide range of date.

I finished (revision 9491) a first pass at the implementation, and the result
seems to work for test1 of qsastime_testlib.  You can run test1 by running

echo 0xffff |lib/qsastime/qsastime_testlib

from the top of the build tree.  The echo 0xffff provides a bit pattern that
potentially runs the first 16 tests, but only one has been implemented so
far.  test1 does some standard comparisons of setFromUT, breakDownMJD, and
strfMJD with the my_timegm POSIX emulation of the Linux C library timegm
routine and the C library routines gmtime and strftime.  The reason why I
emulate the Linux C library timegm routine with my_timegm is so that both
Linux and non-Linux POSIX compliant systems can run the above test.  Note
test 1 is just for a small epoch range near the Julian day number epoch, and
I plan to try other more extensive ranges for test2, etc.  (Some of these
further tests will be a repeat of previous work (currently bypassed with
"if(0) " but done in a systematic way and controlled with the bit pattern of
whatever is fed to stdin as above.  As the systematic versions of the tests
get implemented, the hodge-podge of bypassed code at the tail-end of
qsastime_testlib.c will gradually disappear.)

The above test immediately exits if sizeof(time_t) !=8 or sizeof(int) != 4.
The reason for those constraints is you need a 64-bit time_t to have access
to large date ranges in the C library, and you need access to 32-bit ints to
test how we expect libqsastime to work on 32-bit systems.  Probably most
64-bit hardware platforms will pass these criteria, most 32-bit platforms
will pass the sizeof(int) criterion, but few 32-bit platforms will pass the
sizeof(time_t) criterion (which is one of our motivations for implementing
this library in the first place.)

If you have a 64-bit system (especially Mac OS X and Windows since I don't
have access to those platforms), please give the above test a try. I suspect
it will build and run out of the box on Mac OS X.  It's probable some
additional work will be required to build the test on Windows. If it turns
out such a build is not possible on Windows, you should bypass
the build of qsastime_testlib in our CMake build system file,
lib/qsastime/CMakeLists.txt, by modifying that build logic as follows:

if(NOT WIN32)
   add_executable(qsastime_testlib qsastime_testlib.c)
   target_link_libraries(qsastime_testlib qsastime)
endif(NOT WIN32)

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to