| 14 | public: |
| 15 | virtual ~MemoryUtilsTest() = default; |
| 16 | virtual bool run(int precision) { |
| 17 | { |
| 18 | void *ptr = MNNMemoryAllocAlign(5, 0b111111 + 1); |
| 19 | MNNTEST_ASSERT(((intptr_t)ptr & 0b111111) == 0); |
| 20 | MNNMemoryFreeAlign(ptr); |
| 21 | } |
| 22 | { |
| 23 | void *ptr = MNNMemoryCallocAlign(8 * sizeof(int), 0b111 + 1); |
| 24 | MNNTEST_ASSERT(((intptr_t)ptr & 0b111) == 0); |
| 25 | for (int i = 0; i < 8; i++) |
| 26 | MNNTEST_ASSERT(((int *)ptr)[i] == 0); |
| 27 | MNNMemoryFreeAlign(ptr); |
| 28 | } |
| 29 | return true; |
| 30 | } |
| 31 | }; |
| 32 | MNNTestSuiteRegister(MemoryUtilsTest, "core/memory_utils"); |
| 33 | #endif |
nothing calls this directly
no test coverage detected