From: Robert Kessl Date: Wed, 23 Jul 2014 13:58:18 +0000 (+0200) Subject: xtypes: update of tests, code cleanup X-Git-Tag: v6.1~3^2~59 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=9d7f3c7f3c26842da16de9e1c128d7b1fb99de9a;p=libucw.git xtypes: update of tests, code cleanup --- diff --git a/ucw/table-types.c b/ucw/table-types.c index 063760b7..b1443148 100644 --- a/ucw/table-types.c +++ b/ucw/table-types.c @@ -49,7 +49,7 @@ static const char *xt_size_format(void *src, u32 fmt, struct mempool *pool) return mp_printf(pool, "%"PRIu64"%s", curr_val, xtype_units_size[out_units].unit); } -static const char * xt_size_fmt_parse(const char *opt_str, u32 *dest, struct mempool *pool) +static const char *xt_size_fmt_parse(const char *opt_str, u32 *dest, struct mempool *pool) { if(opt_str == NULL) { return "NULL is not supported as a column argument."; @@ -136,7 +136,7 @@ static const char *xt_timestamp_format(void *src, u32 fmt, struct mempool *pool) return mp_printf(pool, "%s", formatted_time_buf); } -static const char * xt_timestamp_fmt_parse(const char *opt_str, u32 *dest, struct mempool *pool) +static const char *xt_timestamp_fmt_parse(const char *opt_str, u32 *dest, struct mempool *pool) { if(opt_str == NULL) { return "NULL is not supported as a column argument."; diff --git a/ucw/xtypes-test.c b/ucw/xtypes-test.c index ae89b154..7ddde2d8 100644 --- a/ucw/xtypes-test.c +++ b/ucw/xtypes-test.c @@ -162,7 +162,10 @@ static void test_timestamp_parse_errors(struct fastbuf *out) "2014X-06-25 08:38:53", "2X014-06-25 08:38:53", "2014-06-25 08:38:53X", + "X2014-06-25 08:38:53", "X1403685533", + "14X03685533", + "1403685533X", NULL }; diff --git a/ucw/xtypes-test.t b/ucw/xtypes-test.t index 396bda3a..f62e19a6 100644 --- a/ucw/xtypes-test.t +++ b/ucw/xtypes-test.t @@ -18,5 +18,8 @@ xt_timestamp.parse error: 'Invalid value of timestamp: '1403685533X'.'. xt_timestamp.parse error: 'Invalid value of timestamp: '2014X-06-25 08:38:53'.'. xt_timestamp.parse error: 'Invalid value of timestamp: '2X014-06-25 08:38:53'.'. xt_timestamp.parse error: 'Invalid value of timestamp: '2014-06-25 08:38:53X'.'. +xt_timestamp.parse error: 'Invalid value of timestamp: 'X2014-06-25 08:38:53'.'. xt_timestamp.parse error: 'Invalid value of timestamp: 'X1403685533'.'. +xt_timestamp.parse error: 'Invalid value of timestamp: '14X03685533'.'. +xt_timestamp.parse error: 'Invalid value of timestamp: '1403685533X'.'. EOF