| 1 |
Index: buffer-redux/src/ringbuf_tests.rs |
| 2 |
=================================================================== |
| 3 |
--- buffer-redux.orig/src/ringbuf_tests.rs |
| 4 |
+++ buffer-redux/src/ringbuf_tests.rs |
| 5 |
@@ -28,7 +28,11 @@ macro_rules! assert_capacity { |
| 6 |
// Macos' minimum allocation size is sometimes? 16K |
| 7 |
assert!(cap == $cap || cap == ::std::cmp::max(16 * 1024, $cap)); |
| 8 |
} else { |
| 9 |
- assert_eq!(cap, $cap); |
| 10 |
+ // some linux systems have larger pages, we assert that |
| 11 |
+ // either the capacity is the capacity requested, or |
| 12 |
+ // that the capacity is larger than requested and is |
| 13 |
+ // a power of two. |
| 14 |
+ assert!((cap == $cap) || ((cap >= $cap) && ((cap & (cap - 1)) == 0 ))); |
| 15 |
} |
| 16 |
}; |
| 17 |
} |