diff options
author | Frederic Martinsons <frederic.martinsons@sigfox.com> | 2021-10-15 17:02:20 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-10-22 13:48:20 +0200 |
commit | 9d82d309782c70ed7247db32902f48adebe90669 (patch) | |
tree | bb6a51a909ae9c544d05986c9b9beb96013887df | |
parent | 0510e9aef8818eeaa445aea246b670871c671ddb (diff) |
cli, plugins: factorize usage of iso8601 datetime format
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
Includes updates by Aleksander Morgado to fix coding style issues.
-rw-r--r-- | cli/mmcli-output.c | 2 | ||||
-rw-r--r-- | libmm-glib/mm-common-helpers.c | 87 | ||||
-rw-r--r-- | libmm-glib/mm-common-helpers.h | 11 | ||||
-rw-r--r-- | libmm-glib/tests/test-common-helpers.c | 19 | ||||
-rw-r--r-- | plugins/cinterion/mm-modem-helpers-cinterion.c | 1 | ||||
-rw-r--r-- | plugins/cinterion/tests/test-modem-helpers-cinterion.c | 4 | ||||
-rw-r--r-- | plugins/huawei/mm-modem-helpers-huawei.c | 1 | ||||
-rw-r--r-- | plugins/huawei/tests/test-modem-helpers-huawei.c | 28 | ||||
-rw-r--r-- | plugins/icera/mm-broadband-modem-icera.c | 1 | ||||
-rw-r--r-- | plugins/novatel/mm-broadband-modem-novatel.c | 1 | ||||
-rw-r--r-- | plugins/sierra/mm-broadband-modem-sierra.c | 1 | ||||
-rw-r--r-- | src/mm-modem-helpers.c | 33 | ||||
-rw-r--r-- | src/mm-modem-helpers.h | 9 | ||||
-rw-r--r-- | src/mm-sms-part-3gpp.c | 1 | ||||
-rw-r--r-- | src/tests/test-modem-helpers.c | 18 | ||||
-rw-r--r-- | src/tests/test-sms-part-3gpp.c | 26 |
16 files changed, 131 insertions, 112 deletions
diff --git a/cli/mmcli-output.c b/cli/mmcli-output.c index 90bd753a..5b8a10d4 100644 --- a/cli/mmcli-output.c +++ b/cli/mmcli-output.c @@ -603,7 +603,7 @@ mmcli_output_start_date (guint64 value) { /* Merge value and recent flag in a single item in human output */ if (selected_type == MMC_OUTPUT_TYPE_HUMAN) { - output_item_new_take_single (MMC_F_BEARER_STATS_START_DATE, mm_format_iso8601 (value)); + output_item_new_take_single (MMC_F_BEARER_STATS_START_DATE, mm_new_iso8601_time_from_unix_time (value)); return; } diff --git a/libmm-glib/mm-common-helpers.c b/libmm-glib/mm-common-helpers.c index 6f0a4929..a240eed2 100644 --- a/libmm-glib/mm-common-helpers.c +++ b/libmm-glib/mm-common-helpers.c @@ -1661,45 +1661,70 @@ mm_get_string_unquoted_from_match_info (GMatchInfo *match_info, return str; } -gchar * -mm_format_iso8601 (guint64 timestamp) +/* + * The following implementation is taken from glib g_date_time_format_iso8601 code + * https://gitlab.gnome.org/GNOME/glib/-/blob/main/glib/gdatetime.c#L3490 + */ +static gchar * +date_time_format_iso8601 (GDateTime *dt) { - gchar *format_date = NULL; - GDateTime *datetime = NULL; - - datetime = g_date_time_new_from_unix_utc ((gint64)timestamp); - #if GLIB_CHECK_VERSION (2, 62, 0) - format_date = g_date_time_format_iso8601 (datetime); + return g_date_time_format_iso8601 (dt); #else - { - GString *outstr = NULL; - gchar *main_date = NULL; - gint64 offset = 0; + GString *outstr = NULL; + g_autofree gchar *main_date = NULL; + gint64 offset = 0; + + main_date = g_date_time_format (dt, "%Y-%m-%dT%H:%M:%S"); + outstr = g_string_new (main_date); + + /* Timezone. Format it as `%:::z` unless the offset is zero, in which case + * we can simply use `Z`. */ + offset = g_date_time_get_utc_offset (dt); + if (offset == 0) { + g_string_append_c (outstr, 'Z'); + } else { + g_autofree gchar *time_zone = NULL; + + time_zone = g_date_time_format (dt, "%:::z"); + g_string_append (outstr, time_zone); + } + + return g_string_free (outstr, FALSE); +#endif +} - main_date = g_date_time_format (datetime, "%Y-%m-%dT%H:%M:%S"); - outstr = g_string_new (main_date); - g_free (main_date); +gchar * +mm_new_iso8601_time_from_unix_time (guint64 timestamp) +{ + g_autoptr(GDateTime) dt = NULL; - /* Timezone. Format it as `%:::z` unless the offset is zero, in which case - * we can simply use `Z`. */ - offset = g_date_time_get_utc_offset (datetime); + dt = g_date_time_new_from_unix_utc ((gint64)timestamp); - if (offset == 0) { - g_string_append_c (outstr, 'Z'); - } else { - gchar *time_zone; + return date_time_format_iso8601 (dt); +} - time_zone = g_date_time_format (datetime, "%:::z"); - g_string_append (outstr, time_zone); - g_free (time_zone); - } +gchar * +mm_new_iso8601_time (guint year, + guint month, + guint day, + guint hour, + guint minute, + guint second, + gboolean have_offset, + gint offset_minutes) +{ + g_autoptr(GDateTime) dt = NULL; + + if (have_offset) { + g_autoptr(GTimeZone) tz = NULL; + + tz = g_time_zone_new_offset (offset_minutes * 60); + dt = g_date_time_new (tz, year, month, day, hour, minute, second); + } else + dt = g_date_time_new_utc (year, month, day, hour, minute, second); - format_date = g_string_free (outstr, FALSE); - } -#endif - g_date_time_unref (datetime); - return format_date; + return date_time_format_iso8601 (dt); } /*****************************************************************************/ diff --git a/libmm-glib/mm-common-helpers.h b/libmm-glib/mm-common-helpers.h index c4720e58..a081a0dd 100644 --- a/libmm-glib/mm-common-helpers.h +++ b/libmm-glib/mm-common-helpers.h @@ -190,7 +190,16 @@ gboolean mm_get_double_from_match_info (GMatchInfo *match_info, gdouble *out); gchar *mm_get_string_unquoted_from_match_info (GMatchInfo *match_info, guint32 match_index); -gchar *mm_format_iso8601 (guint64 timestamp); + +gchar *mm_new_iso8601_time_from_unix_time (guint64 timestamp); +gchar *mm_new_iso8601_time (guint year, + guint month, + guint day, + guint hour, + guint minute, + guint second, + gboolean have_offset, + gint offset_minutes); /******************************************************************************/ /* Type checkers and conversion utilities */ diff --git a/libmm-glib/tests/test-common-helpers.c b/libmm-glib/tests/test-common-helpers.c index 19e1122a..69b95cb1 100644 --- a/libmm-glib/tests/test-common-helpers.c +++ b/libmm-glib/tests/test-common-helpers.c @@ -598,6 +598,24 @@ hexstr_wrong_digits_some (void) common_hexstr2bin_test_failure ("012345k7"); } +static void +date_time_iso8601 (void) +{ + gchar *date = NULL; + + date = mm_new_iso8601_time_from_unix_time (1634307342); + g_assert_cmpstr (date, ==, "2021-10-15T14:15:42Z"); + g_free (date); + + date = mm_new_iso8601_time (2021, 10, 15, 16, 15, 42, FALSE, 0); + g_assert_cmpstr (date, ==, "2021-10-15T16:15:42Z"); + g_free (date); + + date = mm_new_iso8601_time (2021, 10, 15, 16, 15, 42, TRUE, 120); + g_assert_cmpstr (date, ==, "2021-10-15T16:15:42+02"); + g_free (date); +} + /**************************************************************/ int main (int argc, char **argv) @@ -644,5 +662,6 @@ int main (int argc, char **argv) g_test_add_func ("/MM/Common/HexStr/wrong-digits-all", hexstr_wrong_digits_all); g_test_add_func ("/MM/Common/HexStr/wrong-digits-some", hexstr_wrong_digits_some); + g_test_add_func ("/MM/Common/DateTime/iso8601", date_time_iso8601); return g_test_run (); } diff --git a/plugins/cinterion/mm-modem-helpers-cinterion.c b/plugins/cinterion/mm-modem-helpers-cinterion.c index b63b67c1..f8cec825 100644 --- a/plugins/cinterion/mm-modem-helpers-cinterion.c +++ b/plugins/cinterion/mm-modem-helpers-cinterion.c @@ -29,6 +29,7 @@ #include "mm-errors-types.h" #include "mm-modem-helpers-cinterion.h" #include "mm-modem-helpers.h" +#include "mm-common-helpers.h" #include "mm-port-serial-at.h" /* Setup relationship between the 3G band bitmask in the modem and the bitmask diff --git a/plugins/cinterion/tests/test-modem-helpers-cinterion.c b/plugins/cinterion/tests/test-modem-helpers-cinterion.c index efd19b38..c3e7e9e5 100644 --- a/plugins/cinterion/tests/test-modem-helpers-cinterion.c +++ b/plugins/cinterion/tests/test-modem-helpers-cinterion.c @@ -1359,7 +1359,7 @@ static void test_ctzu_urc_simple (void) { const gchar *urc = "\r\n+CTZU: \"19/07/09,11:15:40\",+08\r\n"; - const gchar *expected_iso8601 = "2019-07-09T11:15:40+02:00"; + const gchar *expected_iso8601 = "2019-07-09T11:15:40+02"; gint expected_offset = 120; gint expected_dst_offset = -1; /* not given */ @@ -1370,7 +1370,7 @@ static void test_ctzu_urc_full (void) { const gchar *urc = "\r\n+CTZU: \"19/07/09,11:15:40\",+08,1\r\n"; - const gchar *expected_iso8601 = "2019-07-09T11:15:40+02:00"; + const gchar *expected_iso8601 = "2019-07-09T11:15:40+02"; gint expected_offset = 120; gint expected_dst_offset = 60; diff --git a/plugins/huawei/mm-modem-helpers-huawei.c b/plugins/huawei/mm-modem-helpers-huawei.c index 1b443052..b8548418 100644 --- a/plugins/huawei/mm-modem-helpers-huawei.c +++ b/plugins/huawei/mm-modem-helpers-huawei.c @@ -23,6 +23,7 @@ #include <libmm-glib.h> #include "mm-log-object.h" +#include "mm-common-helpers.h" #include "mm-modem-helpers.h" #include "mm-modem-helpers-huawei.h" #include "mm-huawei-enums-types.h" diff --git a/plugins/huawei/tests/test-modem-helpers-huawei.c b/plugins/huawei/tests/test-modem-helpers-huawei.c index 650f3f92..e6f2490b 100644 --- a/plugins/huawei/tests/test-modem-helpers-huawei.c +++ b/plugins/huawei/tests/test-modem-helpers-huawei.c @@ -1072,32 +1072,32 @@ typedef struct { static const NwtimeTest nwtime_tests[] = { { "^NWTIME: 14/08/05,04:00:21+40,00", TRUE, TRUE, FALSE, - "2014-08-05T04:00:21+10:00", 600, 0, NWT_UNKNOWN }, + "2014-08-05T04:00:21+10", 600, 0, NWT_UNKNOWN }, { "^NWTIME: 14/08/05,04:00:21+40,00", TRUE, FALSE, TRUE, - "2014-08-05T04:00:21+10:00", 600, 0, NWT_UNKNOWN }, + "2014-08-05T04:00:21+10", 600, 0, NWT_UNKNOWN }, { "^NWTIME: 14/08/05,04:00:21+40,00", TRUE, TRUE, TRUE, - "2014-08-05T04:00:21+10:00", 600, 0, NWT_UNKNOWN }, + "2014-08-05T04:00:21+10", 600, 0, NWT_UNKNOWN }, { "^NWTIME: 14/08/05,04:00:21+20,00", TRUE, TRUE, FALSE, - "2014-08-05T04:00:21+05:00", 300, 0, NWT_UNKNOWN }, + "2014-08-05T04:00:21+05", 300, 0, NWT_UNKNOWN }, { "^NWTIME: 14/08/05,04:00:21+20,00", TRUE, FALSE, TRUE, - "2014-08-05T04:00:21+05:00", 300, 0, NWT_UNKNOWN }, + "2014-08-05T04:00:21+05", 300, 0, NWT_UNKNOWN }, { "^NWTIME: 14/08/05,04:00:21+20,00", TRUE, TRUE, TRUE, - "2014-08-05T04:00:21+05:00", 300, 0, NWT_UNKNOWN }, + "2014-08-05T04:00:21+05", 300, 0, NWT_UNKNOWN }, { "^NWTIME: 14/08/05,04:00:21+40,01", TRUE, TRUE, FALSE, - "2014-08-05T04:00:21+11:00", 600, 60, NWT_UNKNOWN }, + "2014-08-05T04:00:21+11", 600, 60, NWT_UNKNOWN }, { "^NWTIME: 14/08/05,04:00:21+40,01", TRUE, FALSE, TRUE, - "2014-08-05T04:00:21+11:00", 600, 60, NWT_UNKNOWN }, + "2014-08-05T04:00:21+11", 600, 60, NWT_UNKNOWN }, { "^NWTIME: 14/08/05,04:00:21+40,01", TRUE, TRUE, TRUE, - "2014-08-05T04:00:21+11:00", 600, 60, NWT_UNKNOWN }, + "2014-08-05T04:00:21+11", 600, 60, NWT_UNKNOWN }, { "^NWTIME: 14/08/05,04:00:21+40,02", TRUE, TRUE, FALSE, - "2014-08-05T04:00:21+12:00", 600, 120, NWT_UNKNOWN }, + "2014-08-05T04:00:21+12", 600, 120, NWT_UNKNOWN }, { "^NWTIME: 14/08/05,04:00:21+40,02", TRUE, FALSE, TRUE, - "2014-08-05T04:00:21+12:00", 600, 120, NWT_UNKNOWN }, + "2014-08-05T04:00:21+12", 600, 120, NWT_UNKNOWN }, { "^NWTIME: 14/08/05,04:00:21+40,02", TRUE, TRUE, TRUE, - "2014-08-05T04:00:21+12:00", 600, 120, NWT_UNKNOWN }, + "2014-08-05T04:00:21+12", 600, 120, NWT_UNKNOWN }, { "^TIME: XX/XX/XX,XX:XX:XX+XX,XX", FALSE, TRUE, FALSE, NULL, NWT_UNKNOWN, NWT_UNKNOWN, NWT_UNKNOWN }, @@ -1155,8 +1155,8 @@ typedef struct { } TimeTest; static const TimeTest time_tests[] = { - { "^TIME: 14/08/05 04:00:21", TRUE, "2014-08-05T04:00:21" }, - { "^TIME: 2014/08/05 04:00:21", TRUE, "2014-08-05T04:00:21" }, + { "^TIME: 14/08/05 04:00:21", TRUE, "2014-08-05T04:00:21Z" }, + { "^TIME: 2014/08/05 04:00:21", TRUE, "2014-08-05T04:00:21Z" }, { "^TIME: 14-08-05 04:00:21", FALSE, NULL }, { "^TIME: 14-08-05,04:00:21", FALSE, NULL }, { "^TIME: 14/08/05 04:00:21 AEST", FALSE, NULL }, diff --git a/plugins/icera/mm-broadband-modem-icera.c b/plugins/icera/mm-broadband-modem-icera.c index 23f8b058..e60d4bd5 100644 --- a/plugins/icera/mm-broadband-modem-icera.c +++ b/plugins/icera/mm-broadband-modem-icera.c @@ -32,6 +32,7 @@ #include "mm-iface-modem-3gpp.h" #include "mm-iface-modem-3gpp-profile-manager.h" #include "mm-iface-modem-time.h" +#include "mm-common-helpers.h" #include "mm-base-modem-at.h" #include "mm-bearer-list.h" #include "mm-broadband-bearer-icera.h" diff --git a/plugins/novatel/mm-broadband-modem-novatel.c b/plugins/novatel/mm-broadband-modem-novatel.c index d05e649b..4eba0e16 100644 --- a/plugins/novatel/mm-broadband-modem-novatel.c +++ b/plugins/novatel/mm-broadband-modem-novatel.c @@ -33,6 +33,7 @@ #include "mm-broadband-modem-novatel.h" #include "mm-errors-types.h" #include "mm-modem-helpers.h" +#include "mm-common-helpers.h" #include "libqcdm/src/commands.h" #include "libqcdm/src/result.h" #include "mm-log-object.h" diff --git a/plugins/sierra/mm-broadband-modem-sierra.c b/plugins/sierra/mm-broadband-modem-sierra.c index 3316c99f..518f8adb 100644 --- a/plugins/sierra/mm-broadband-modem-sierra.c +++ b/plugins/sierra/mm-broadband-modem-sierra.c @@ -28,6 +28,7 @@ #include "mm-base-modem-at.h" #include "mm-log-object.h" #include "mm-modem-helpers.h" +#include "mm-common-helpers.h" #include "mm-errors-types.h" #include "mm-iface-modem.h" #include "mm-iface-modem-3gpp.h" diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 1264289c..7c92305a 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -29,6 +29,7 @@ #include <libmm-glib.h> #include "mm-sms-part.h" +#include "mm-common-helpers.h" #include "mm-modem-helpers.h" #include "mm-helper-enums-types.h" #include "mm-log-object.h" @@ -384,38 +385,6 @@ mm_filter_current_bands (const GArray *supported_bands, /*****************************************************************************/ -gchar * -mm_new_iso8601_time (guint year, - guint month, - guint day, - guint hour, - guint minute, - guint second, - gboolean have_offset, - gint offset_minutes) -{ - GString *str; - - str = g_string_sized_new (30); - g_string_append_printf (str, "%04d-%02d-%02dT%02d:%02d:%02d", - year, month, day, hour, minute, second); - if (have_offset) { - if (offset_minutes >=0 ) { - g_string_append_printf (str, "+%02d:%02d", - offset_minutes / 60, - offset_minutes % 60); - } else { - offset_minutes *= -1; - g_string_append_printf (str, "-%02d:%02d", - offset_minutes / 60, - offset_minutes % 60); - } - } - return g_string_free (str, FALSE); -} - -/*****************************************************************************/ - GArray * mm_filter_supported_modes (const GArray *all, const GArray *supported_combinations, diff --git a/src/mm-modem-helpers.h b/src/mm-modem-helpers.h index 4107137c..98bcea37 100644 --- a/src/mm-modem-helpers.h +++ b/src/mm-modem-helpers.h @@ -71,15 +71,6 @@ guint mm_netmask_to_cidr (const gchar *netmask); GArray *mm_filter_current_bands (const GArray *supported_bands, const GArray *current_bands); -gchar *mm_new_iso8601_time (guint year, - guint month, - guint day, - guint hour, - guint minute, - guint second, - gboolean have_offset, - gint offset_minutes); - GArray *mm_filter_supported_modes (const GArray *all, const GArray *supported_combinations, gpointer log_object); diff --git a/src/mm-sms-part-3gpp.c b/src/mm-sms-part-3gpp.c index 51f2cfeb..bfae03a8 100644 --- a/src/mm-sms-part-3gpp.c +++ b/src/mm-sms-part-3gpp.c @@ -23,6 +23,7 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> +#include "mm-common-helpers.h" #include "mm-helper-enums-types.h" #include "mm-sms-part-3gpp.h" #include "mm-charsets.h" diff --git a/src/tests/test-modem-helpers.c b/src/tests/test-modem-helpers.c index 9adfc100..1f040e8f 100644 --- a/src/tests/test-modem-helpers.c +++ b/src/tests/test-modem-helpers.c @@ -3562,25 +3562,25 @@ typedef struct { static const CclkTest cclk_tests[] = { { "+CCLK: \"14/08/05,04:00:21\"", TRUE, TRUE, FALSE, - "2014-08-05T04:00:21+00:00", 0 }, + "2014-08-05T04:00:21Z", 0 }, { "+CCLK: \"14/08/05,04:00:21\"", TRUE, FALSE, TRUE, "2014-08-05T04:00:21+00:00", 0 }, { "+CCLK: \"14/08/05,04:00:21\"", TRUE, TRUE, TRUE, - "2014-08-05T04:00:21+00:00", 0 }, + "2014-08-05T04:00:21Z", 0 }, { "+CCLK: \"14/08/05,04:00:21+40\"", TRUE, TRUE, FALSE, - "2014-08-05T04:00:21+10:00", 600 }, + "2014-08-05T04:00:21+10", 600 }, { "+CCLK: \"14/08/05,04:00:21+40\"", TRUE, FALSE, TRUE, "2014-08-05T04:00:21+10:00", 600 }, { "+CCLK: \"14/08/05,04:00:21+40\"", TRUE, TRUE, TRUE, - "2014-08-05T04:00:21+10:00", 600 }, + "2014-08-05T04:00:21+10", 600 }, { "+CCLK: \"15/02/28,20:30:40-32\"", TRUE, TRUE, FALSE, - "2015-02-28T20:30:40-08:00", -480 }, + "2015-02-28T20:30:40-08", -480 }, { "+CCLK: \"15/02/28,20:30:40-32\"", TRUE, FALSE, TRUE, - "2015-02-28T20:30:40-08:00", -480 }, + "2015-02-28T20:30:40-08", -480 }, { "+CCLK: \"15/02/28,20:30:40-32\"", TRUE, TRUE, TRUE, - "2015-02-28T20:30:40-08:00", -480 }, + "2015-02-28T20:30:40-08", -480 }, { "+CCLK: 17/07/26,11:42:15+01", TRUE, TRUE, FALSE, "2017-07-26T11:42:15+00:15", 15 }, @@ -3590,11 +3590,11 @@ static const CclkTest cclk_tests[] = { "2017-07-26T11:42:15+00:15", 15 }, { "+CCLK: \"15/02/28,20:30:40-32\"", TRUE, TRUE, FALSE, - "2015-02-28T20:30:40-08:00", -480 }, + "2015-02-28T20:30:40-08", -480 }, { "+CCLK: \"15/02/28,20:30:40-32\"", TRUE, FALSE, TRUE, "2015-02-28T20:30:40-08:00", -480 }, { "+CCLK: \"15/02/28,20:30:40-32\"", TRUE, TRUE, TRUE, - "2015-02-28T20:30:40-08:00", -480 }, + "2015-02-28T20:30:40-08", -480 }, { "+CCLK: 17/07/26,11:42:15+01", TRUE, TRUE, FALSE, "2017-07-26T11:42:15+00:15", 15 }, diff --git a/src/tests/test-sms-part-3gpp.c b/src/tests/test-sms-part-3gpp.c index db6aa7a0..4da299e7 100644 --- a/src/tests/test-sms-part-3gpp.c +++ b/src/tests/test-sms-part-3gpp.c @@ -119,7 +119,7 @@ test_pdu1 (void) pdu, sizeof (pdu), "+12404492164", /* smsc */ "+16175927198", /* number */ - "2011-02-28T11:50:50-05:00", /* timestamp */ + "2011-02-28T11:50:50-05", /* timestamp */ FALSE, "Here's a longer message [{with some extended characters}] " "thrown in, such as £ and ΩΠΨ and §¿ as well.", /* text */ @@ -140,7 +140,7 @@ test_pdu2 (void) pdu, sizeof (pdu), "+79037011111", /* smsc */ "InternetSMS", /* number */ - "2011-03-29T19:20:04+04:00", /* timestamp */ + "2011-03-29T19:20:04+04", /* timestamp */ FALSE, "тест", /* text */ NULL, 0); @@ -160,7 +160,7 @@ test_pdu3 (void) pdu, sizeof (pdu), "+12345678901", /* smsc */ "+18005551212", /* number */ - "2011-01-01T12:34:56+00:00", /* timestamp */ + "2011-01-01T12:34:56Z", /* timestamp */ FALSE, "hellohello", /* text */ NULL, 0); @@ -181,7 +181,7 @@ test_pdu3_nzpid (void) pdu, sizeof (pdu), "+12345678901", /* smsc */ "+18005551212", /* number */ - "2011-01-01T12:34:56+00:00", /* timestamp */ + "2011-01-01T12:34:56Z", /* timestamp */ FALSE, "hellohello", /* text */ NULL, 0); @@ -202,7 +202,7 @@ test_pdu3_mms (void) pdu, sizeof (pdu), "+12345678901", /* smsc */ "+18005551212", /* number */ - "2011-01-01T12:34:56+00:00", /* timestamp */ + "2011-01-01T12:34:56Z", /* timestamp */ FALSE, "hellohello", /* text */ NULL, 0); @@ -223,7 +223,7 @@ test_pdu3_natl (void) pdu, sizeof (pdu), "+12345678901", /* smsc */ "18005551212", /* number, no plus */ - "2011-01-01T12:34:56+00:00", /* timestamp */ + "2011-01-01T12:34:56Z", /* timestamp */ FALSE, "hellohello", /* text */ NULL, 0); @@ -245,7 +245,7 @@ test_pdu3_8bit (void) pdu, sizeof (pdu), "+12345678901", /* smsc */ "+18005551212", /* number */ - "2011-01-01T12:34:56+00:00", /* timestamp */ + "2011-01-01T12:34:56Z", /* timestamp */ FALSE, NULL, /* text */ expected_data, /* data */ @@ -293,7 +293,7 @@ test_pdu_dcsf1 (void) pdu, sizeof (pdu), "+33609001390", /* smsc */ "1800", /* number */ - "2011-06-24T13:08:15+02:00", /* timestamp */ + "2011-06-24T13:08:15+02", /* timestamp */ FALSE, "Info SFR - Confidentiel, à ne jamais transmettre -\r\n" "Voici votre nouveau mot de passe : sw2ced pour gérer " @@ -317,7 +317,7 @@ test_pdu_dcsf_8bit (void) pdu, sizeof (pdu), "+12345678901", /* smsc */ "+18005551212", /* number */ - "2011-01-01T12:34:56+00:00", /* timestamp */ + "2011-01-01T12:34:56Z", /* timestamp */ FALSE, NULL, /* text */ expected_data, /* data */ @@ -363,7 +363,7 @@ test_pdu_udhi (void) hexpdu, "+31653131316", /* smsc */ "1002", /* number */ - "2011-06-29T23:32:19+02:00", /* timestamp */ + "2011-06-29T23:32:19+02", /* timestamp */ TRUE, "Welkom, bel om uw Voicemail te beluisteren naar +31612001233" " (PrePay: *100*1233#). Voicemail ontvangen is altijd gratis." @@ -388,7 +388,7 @@ test_pdu_multipart (void) hexpdu1, "+12063130025", /* smsc */ "+16175046925", /* number */ - "2012-04-25T19:56:50-04:00", /* timestamp */ + "2012-04-25T19:56:50-04", /* timestamp */ TRUE, /* multipart! */ "This is a very long test designed to exercise multi part capability. It should " "show up as one message, not as two, as the underlying encoding represents ", /* text */ @@ -398,7 +398,7 @@ test_pdu_multipart (void) hexpdu2, "+12063130026", /* smsc */ "+16175046925", /* number */ - "2012-04-25T19:56:51-04:00", /* timestamp */ + "2012-04-25T19:56:51-04", /* timestamp */ TRUE, /* multipart! */ "that the parts are related to one another. ", /* text */ NULL, 0); @@ -431,7 +431,7 @@ test_pdu_not_stored (void) hexpdu1, "+34656000311", /* smsc */ "639337937", /* number */ - "2012-09-11T07:40:36+02:00", /* timestamp */ + "2012-09-11T07:40:36+02", /* timestamp */ FALSE, /* multipart! */ NULL, /* text */ NULL, 0); |