File: t_iso8601.c

package info (click to toggle)
libmpdclient 2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,784 kB
  • ctags: 772
  • sloc: sh: 10,142; ansic: 6,238; makefile: 201
file content (19 lines) | stat: -rw-r--r-- 354 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "iso8601.h"
#include <mpd/compiler.h>

#include <assert.h>
#include <time.h>

int main(mpd_unused int argc, mpd_unused char **argv)
{
	char buffer[64];
	time_t t, now;
	bool success;

	now = time(NULL);
	success = iso8601_datetime_format(buffer, sizeof(buffer), now);
	assert(success);

	t = iso8601_datetime_parse(buffer);
	assert(t == now);
}