diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-15 12:25:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:23:09 -0500 |
commit | 060113de980c7cc6fe5729e1adce56052aaa2508 (patch) | |
tree | 733fd8e55ceb7ec9cdb281b4937a55273c12ff6c | |
parent | fc5639626166fdff83da100e5914ec246ab29b9e (diff) | |
download | samba-060113de980c7cc6fe5729e1adce56052aaa2508.tar.gz samba-060113de980c7cc6fe5729e1adce56052aaa2508.tar.bz2 samba-060113de980c7cc6fe5729e1adce56052aaa2508.zip |
r8495: allow for up 10% change in allocated disk space during QFSINFO tests
(This used to be commit 16d752b55189780a038aed1d54ef28201a9859a4)
-rw-r--r-- | source4/torture/raw/qfsinfo.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source4/torture/raw/qfsinfo.c b/source4/torture/raw/qfsinfo.c index 58bc801a02..1237ddf7b1 100644 --- a/source4/torture/raw/qfsinfo.c +++ b/source4/torture/raw/qfsinfo.c @@ -75,6 +75,14 @@ static union smb_fsinfo *find(const char *name) ret = False; \ }} while(0) +#define VAL_APPROX_EQUAL(n1, v1, n2, v2) do {if (ABS(s1->n1.out.v1 - s2->n2.out.v2) > 0.1*s1->n1.out.v1) { \ + printf("%s/%s [%u] != %s/%s [%u] at %s(%d)\n", \ + #n1, #v1, (uint_t)s1->n1.out.v1, \ + #n2, #v2, (uint_t)s2->n2.out.v2, \ + __FILE__, __LINE__); \ + ret = False; \ +}} while(0) + #define STR_EQUAL(n1, v1, n2, v2) do {if (!s1->n1.out.v1 && !s2->n2.out.v2) return True; \ if (!s1->n1.out.v1 || !s2->n2.out.v2) return False; \ if (strcmp(s1->n1.out.v1, s2->n2.out.v2)) { \ @@ -162,7 +170,7 @@ BOOL torture_raw_qfsinfo(void) s2 = find("SIZE_INFORMATION"); if (s1 && s2) { VAL_EQUAL(size_info, total_alloc_units, size_info, total_alloc_units); - VAL_EQUAL(size_info, avail_alloc_units, size_info, avail_alloc_units); + VAL_APPROX_EQUAL(size_info, avail_alloc_units, size_info, avail_alloc_units); VAL_EQUAL(size_info, sectors_per_unit, size_info, sectors_per_unit); VAL_EQUAL(size_info, bytes_per_sector, size_info, bytes_per_sector); } @@ -252,7 +260,7 @@ BOOL torture_raw_qfsinfo(void) s2 = find("FULL_SIZE_INFORMATION"); if (s1 && s2) { VAL_EQUAL(size_info, total_alloc_units, full_size_information, total_alloc_units); - VAL_EQUAL(size_info, avail_alloc_units, full_size_information, call_avail_alloc_units); + VAL_APPROX_EQUAL(size_info, avail_alloc_units, full_size_information, call_avail_alloc_units); VAL_EQUAL(size_info, sectors_per_unit, full_size_information, sectors_per_unit); VAL_EQUAL(size_info, bytes_per_sector, full_size_information, bytes_per_sector); } |