Displaying 2 results from an estimated 2 matches for "signed_test".
2023 Mar 01
6
[libnbd PATCH 0/6] common: catch up with nbdkit
If we compare the "common" subdirectory between nbdkit @ 6b4178d0fdfe
("ci: Temporarily disable perl in MacOS", 2023-02-27) and libnbd @
d05cd8f384a7 ("Version 1.15.11.", 2023-02-28), we find differences. We
can categorize these differences along two (orthogonal) axes:
- Intentional or unintentional.
Intentional differences are for example when one of the libnbd
2023 Mar 01
1
[libnbd PATCH 6/6] common/include: Fix MIN and MAX macros so they can be nested [finish port]
...mon/include/test-minmax.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/common/include/test-minmax.c b/common/include/test-minmax.c
index 285f8074e503..095c91491acc 100644
--- a/common/include/test-minmax.c
+++ b/common/include/test-minmax.c
@@ -154,5 +154,19 @@ main (void)
SIGNED_TEST (f, -FLT_MAX, FLT_MAX);
SIGNED_TEST (d, -DBL_MAX, DBL_MAX);
+ /* Test that MIN and MAX can be nested. This is really a compile
+ * test, but we do check the answer.
+ */
+ assert (MIN (MIN (1, 2), 3) == 1);
+ assert (MAX (MIN (1, 2), 3) == 3);
+ assert (MIN (MAX (1, 2), 3) == 2);
+ a...