glib2 GDateTime API tests fail on Mac OS X



This is driving me batty.  I must be missing something simple.

I have downloaded and compiled glib2 2.31.0.  That took quite a while because I first had to download and install expat and GNU gettxt.  Those libraries compiled fine and passed their make check tests.  However, glib2 fails the GDateTime "make check" tests (e.g., /GDateTime/equal).  It seems not to be reading any of the time zone info files in /usr/share/zoneinfo.  The America/Recife tzinfo file used by the /GDateTime/equal test is there:

$ ls -l /usr/share/zoneinfo/America/Recife
-rw-r--r--  1 root  wheel  276 Dec  5  2007 /usr/share/zoneinfo/America/Recife

I tried defining the TZDIR envonment variable, but that did not help.  For example,

$ TZDIR=/usr/share/zoneinfo glib/tests/gdatetime

I added a couple printf()'s in the test that fails (in glib/tests/gdatetime.c), which show that the time zone structure is coming back as UTC:

$ TZDIR=/usr/share/zoneinfo glib/tests/gdatetime
/GDateTime/add_days: OK
/GDateTime/add_full: OK
/GDateTime/add_hours: OK
/GDateTime/add_minutes: OK
/GDateTime/add_months: OK
/GDateTime/add_seconds: OK
/GDateTime/add_weeks: OK
/GDateTime/add_years: OK
/GDateTime/compare: OK
/GDateTime/diff: OK
/GDateTime/equal:
--->America/Recife time zone abbreviation: UTC


--->UTC offset: 0

**
ERROR:gdatetime.c:196:test_GDateTime_equal: assertion failed (g_date_time_get_utc_offset (dt1) / G_USEC_PER_SEC == (-3 * 3600)): (0 == -10800)
Abort trap

I don't actually plan to use the GDateTime routines; I don't plan to use glib2 at all (though I would like to experiment with it some time).  All I'm trying to do is compile the ARM QEMU emulators.  I just don't like it when make check's fail.

I'm running Mac OS X 10.5.8, Xcode 3.1.3, but I don't think that matters.

$ uname -a
Darwin savaii.wr.usgs.gov 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386

$ gcc -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc_42/gcc_42-5574~1/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/usr/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-gxx-include-dir=/usr/include/c++/4.0.0 --host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5574)

$ env | grep TZ

Does anyone know what I should do on a Mac to get the GDateTime APIs to work?

Thank you,

Larry Baker
US Geological Survey
650-329-5608



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]