Lines Matching full:bytes
23 uint8_t* bytes = (uint8_t*) sk_calloc_throw(alloc_count); // provide num bytes directly in DEF_TEST() local
24 SkASSERT_RELEASE(bytes != nullptr); in DEF_TEST()
26 REPORTER_ASSERT(reporter, bytes[i] == 0); in DEF_TEST()
27 bytes[i] = (uint8_t)i; in DEF_TEST()
29 sk_free(bytes); in DEF_TEST()
43 uint8_t* bytes = (uint8_t*) sk_malloc_throw(alloc_count); // provide num bytes directly in DEF_TEST() local
44 SkASSERT_RELEASE(bytes != nullptr); in DEF_TEST()
46 bytes[i] = (uint8_t)i; in DEF_TEST()
48 sk_free(bytes); in DEF_TEST()
60 uint8_t* bytes = (uint8_t*) sk_realloc_throw(nullptr, 10); in DEF_TEST() local
61 SkASSERT_RELEASE(bytes != nullptr); in DEF_TEST()
62 // Make sure those 10 bytes are writeable in DEF_TEST()
64 bytes[i] = (uint8_t)i; in DEF_TEST()
68 bytes = (uint8_t*) sk_realloc_throw(bytes, 5); in DEF_TEST()
69 SkASSERT_RELEASE(bytes != nullptr); in DEF_TEST()
70 // Make sure those 5 bytes are still writeable and contain the previous values in DEF_TEST()
72 REPORTER_ASSERT(reporter, bytes[i] == i, "bytes[%d] != %d", i, i); in DEF_TEST()
73 bytes[i] = (uint8_t)i + 17; in DEF_TEST()
77 bytes = (uint8_t*) sk_realloc_throw(bytes, 20, sizeof(uint8_t)); // count + elem size in DEF_TEST()
78 SkASSERT_RELEASE(bytes != nullptr); in DEF_TEST()
79 // Make sure the first 5 bytes are still writeable and contain the previous values in DEF_TEST()
81 REPORTER_ASSERT(reporter, bytes[i] == (i + 17), "bytes[%d] != %d", i, i+17); in DEF_TEST()
82 bytes[i] = (uint8_t)i + 43; in DEF_TEST()
84 // The next 15 bytes are uninitialized, so just make sure we can write to them. in DEF_TEST()
86 bytes[i] = (uint8_t)i + 43; in DEF_TEST()
90 bytes = (uint8_t*) sk_realloc_throw(bytes, 0); in DEF_TEST()
91 REPORTER_ASSERT(reporter, bytes == nullptr); in DEF_TEST()
92 // We run our tests with LeakSanitizer, so if bytes is *not* freed, we should see a failure. in DEF_TEST()