1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "timestamp.h"
int
main(int argc, char **argv)
{
struct timestamp_reply reply;
int rc;
assert(argc == 6);
rc = timestamp_fetch(argv[1], argv[2], argv[3],
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
atol(argv[5]), &reply);
if (strcmp(argv[4], "good") == 0)
assert(rc == 0 && reply.error == NULL && reply.size > 0 && reply.at[0] != '\0');
else
assert(rc == -1 && reply.error != NULL && reply.at[0] == '\0');
printf("timestamp verification case=%s passed\n", argv[4]);
return 0;
}