From 9d7f3c7f3c26842da16de9e1c128d7b1fb99de9a Mon Sep 17 00:00:00 2001 From: Robert Kessl Date: Wed, 23 Jul 2014 15:58:18 +0200 Subject: [PATCH] xtypes: update of tests, code cleanup --- ucw/table-types.c | 4 ++-- ucw/xtypes-test.c | 3 +++ ucw/xtypes-test.t | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) 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 -- 2.39.2