]> mj.ucw.cz Git - libucw.git/commitdiff
xtypes: update of tests, code cleanup
authorRobert Kessl <kesslr@centrum.cz>
Wed, 23 Jul 2014 13:58:18 +0000 (15:58 +0200)
committerRobert Kessl <kesslr@centrum.cz>
Wed, 23 Jul 2014 13:58:18 +0000 (15:58 +0200)
ucw/table-types.c
ucw/xtypes-test.c
ucw/xtypes-test.t

index 063760b705314fe2dd9b65144563031542805ca4..b14431485b7aac4c483e861c45217662a616127f 100644 (file)
@@ -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.";
index ae89b154c9683165b28dbe2394922fa557d9a287..7ddde2d82eb81012c0c1e24ca2b66b775b4f7a8c 100644 (file)
@@ -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
   };
 
index 396bda3aa8d854e2175c3cb4dcecc31f9aec29fb..f62e19a62d2d2ae05d4f0b29b0d59b89db884ab0 100644 (file)
@@ -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