1
#include <libsmbclient.h>
6
#include "get_auth_data_fn.h"
9
* This test is intended to ensure that the timestamps returned by
10
* libsmbclient using smbc_stat() are the same as those returned by
15
int main(int argc, char* argv[])
23
char * pUrl = argv[1];
27
printf("usage: %s <file_url>\n", argv[0]);
32
smbc_init(get_auth_data_fn, 0);
34
if (smbc_stat(pUrl, &st1) < 0)
40
if ((fd = smbc_open(pUrl, O_RDONLY, 0)) < 0)
46
if (smbc_fstat(fd, &st2) < 0)
54
#define COMPARE(name, field) \
55
if (st1.field != st2.field) \
57
printf("Field " name " MISMATCH: st1=%lu, st2=%lu\n", \
58
(unsigned long) st1.field, \
59
(unsigned long) st2.field); \
62
COMPARE("st_dev", st_dev);
63
COMPARE("st_ino", st_ino);
64
COMPARE("st_mode", st_mode);
65
COMPARE("st_nlink", st_nlink);
66
COMPARE("st_uid", st_uid);
67
COMPARE("st_gid", st_gid);
68
COMPARE("st_rdev", st_rdev);
69
COMPARE("st_size", st_size);
70
COMPARE("st_blksize", st_blksize);
71
COMPARE("st_blocks", st_blocks);
72
COMPARE("st_atime", st_atime);
73
COMPARE("st_mtime", st_mtime);
74
COMPARE("st_ctime", st_ctime);