Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
OverAlignedTest.cpp File Reference
#include "include/core/SkTypes.h"
#include "include/private/base/SkAlign.h"
#include "include/private/base/SkMalloc.h"
#include "src/base/SkRandom.h"
#include "tests/Test.h"
#include <stdint.h>

Go to the source code of this file.

Functions

 DEF_TEST (OverAligned, r)
 

Function Documentation

◆ DEF_TEST()

DEF_TEST ( OverAligned  ,
 
)

Definition at line 18 of file OverAlignedTest.cpp.

18 {
19 SkRandom rand;
20 // Let's test that assertion. We think it really should be providing 8-byte alignment.
21 for (int i = 0; i < 1000; i++) {
22 void* p = sk_malloc_throw(rand.nextRangeU(0,100));
23 REPORTER_ASSERT(r, SkIsAlign8((uintptr_t)p));
24 sk_free(p);
25 }
26}
static constexpr bool SkIsAlign8(T x)
Definition SkAlign.h:21
SK_API void sk_free(void *)
static void * sk_malloc_throw(size_t size)
Definition SkMalloc.h:67
#define REPORTER_ASSERT(r, cond,...)
Definition Test.h:286
uint32_t nextRangeU(uint32_t min, uint32_t max)
Definition SkRandom.h:80