diff options
author | Raimo Järvi <raimo.jarvi@gmail.com> | 2012-05-27 23:09:43 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2012-07-02 11:44:31 +0100 |
commit | 40e68e77600ffddaf909894bea238d63fe505e4e (patch) | |
tree | 821a6a3474b157c153b5c59b0823deebaf979622 | |
parent | e288ac7913b86dfaee4af51ea022db9ecd43cd0c (diff) |
tests: fix build of datetime unit test in Windows
Also include config.h for all the #ifdef HAVE_XYZ.
https://bugzilla.gnome.org/show_bug.cgi?id=676935
-rw-r--r-- | tests/check/gst/gstdatetime.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/check/gst/gstdatetime.c b/tests/check/gst/gstdatetime.c index da447f723..993a2587e 100644 --- a/tests/check/gst/gstdatetime.c +++ b/tests/check/gst/gstdatetime.c @@ -20,6 +20,10 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <string.h> #include <time.h> #include <gst/check/gstcheck.h> @@ -262,8 +266,6 @@ GST_END_TEST; GST_START_TEST (test_GstDateTime_get_utc_offset) { - GstDateTime *dt; - gfloat ts; struct tm tm; time_t t; @@ -275,10 +277,17 @@ GST_START_TEST (test_GstDateTime_get_utc_offset) memcpy (&tm, localtime (&t), sizeof (struct tm)); #endif - dt = gst_date_time_new_now_local_time (); - ts = gst_date_time_get_time_zone_offset (dt); - assert_equals_int (ts, tm.tm_gmtoff / 3600.0); - gst_date_time_unref (dt); +#ifdef HAVE_TM_GMTOFF + { + GstDateTime *dt; + gfloat ts; + + dt = gst_date_time_new_now_local_time (); + ts = gst_date_time_get_time_zone_offset (dt); + assert_equals_int (ts, tm.tm_gmtoff / 3600.0); + gst_date_time_unref (dt); + } +#endif } GST_END_TEST; |