]>
git.saurik.com Git - apple/xnu.git/blob - tests/safe_allocation_src/usage.for_loop.cpp
2 // Make sure `safe_allocation` works nicely with the range-based for-loop.
5 #include <libkern/c++/safe_allocation.h>
6 #include <darwintest.h>
7 #include "test_utils.h"
17 test_safe_allocation
<T
> array(10, libkern::allocate_memory
);
18 for (T
& element
: array
) {
22 for (T
const& element
: array
) {
23 CHECK(element
.i
== 3);
27 T_DECL(usage_for_loop
, "safe_allocation.usage.for_loop") {