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
This commit is contained in:
Raimo Järvi 2012-05-27 23:09:43 +03:00 committed by Tim-Philipp Müller
parent e288ac7913
commit 40e68e7760

View file

@ -20,6 +20,10 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include <gst/check/gstcheck.h> #include <gst/check/gstcheck.h>
@ -262,8 +266,6 @@ GST_END_TEST;
GST_START_TEST (test_GstDateTime_get_utc_offset) GST_START_TEST (test_GstDateTime_get_utc_offset)
{ {
GstDateTime *dt;
gfloat ts;
struct tm tm; struct tm tm;
time_t t; time_t t;
@ -275,11 +277,18 @@ GST_START_TEST (test_GstDateTime_get_utc_offset)
memcpy (&tm, localtime (&t), sizeof (struct tm)); memcpy (&tm, localtime (&t), sizeof (struct tm));
#endif #endif
#ifdef HAVE_TM_GMTOFF
{
GstDateTime *dt;
gfloat ts;
dt = gst_date_time_new_now_local_time (); dt = gst_date_time_new_now_local_time ();
ts = gst_date_time_get_time_zone_offset (dt); ts = gst_date_time_get_time_zone_offset (dt);
assert_equals_int (ts, tm.tm_gmtoff / 3600.0); assert_equals_int (ts, tm.tm_gmtoff / 3600.0);
gst_date_time_unref (dt); gst_date_time_unref (dt);
} }
#endif
}
GST_END_TEST; GST_END_TEST;