/frameworks/libs/binary_translation/base/ |
D | format_buffer_test.cc | 33 char buf[128] = "hello"; in TEST() local 34 EXPECT_EQ(0U, FormatBuffer(buf, 0, "test")); in TEST() 36 EXPECT_STREQ("hello", buf); in TEST() 40 char buf[128] = "hello"; in TEST() local 41 EXPECT_EQ(0U, FormatBuffer(buf, sizeof(buf), nullptr)); in TEST() 44 EXPECT_STREQ("", buf); in TEST() 48 char buf[128] = "hello"; in TEST() local 49 EXPECT_EQ(0U, FormatBuffer(buf, sizeof(buf), "")); in TEST() 51 EXPECT_STREQ("", buf); in TEST() 55 char buf[128]; in TEST() local [all …]
|
/frameworks/libs/binary_translation/code_gen_lib/ |
D | code_gen_lib_riscv64_test.cc | 127 void DummyRunner2(GuestAddr pc, GuestArgumentBuffer* buf) { in DummyRunner2() argument 130 ASSERT_NE(nullptr, buf); in DummyRunner2() 131 ASSERT_EQ(1, buf->argc); in DummyRunner2() 132 ASSERT_EQ(0, buf->resc); in DummyRunner2() 133 ASSERT_EQ(1234u, buf->argv[0]); in DummyRunner2() 150 void Run10UInt8(GuestAddr pc, GuestArgumentBuffer* buf) { in Run10UInt8() argument 152 ASSERT_NE(buf, nullptr); in Run10UInt8() 153 ASSERT_EQ(buf->argc, 8); in Run10UInt8() 154 ASSERT_EQ(buf->stack_argc, 16); in Run10UInt8() 155 ASSERT_EQ(buf->resc, 1); in Run10UInt8() [all …]
|
/frameworks/native/opengl/tests/EGLTest/ |
D | egl_cache_test.cpp | 63 uint8_t buf[4] = { 0xee, 0xee, 0xee, 0xee }; in TEST_P() local 65 ASSERT_EQ(0, mCache->getBlob("abcd", 4, buf, 4)); in TEST_P() 66 ASSERT_EQ(0xee, buf[0]); in TEST_P() 67 ASSERT_EQ(0xee, buf[1]); in TEST_P() 68 ASSERT_EQ(0xee, buf[2]); in TEST_P() 69 ASSERT_EQ(0xee, buf[3]); in TEST_P() 73 uint8_t buf[4] = { 0xee, 0xee, 0xee, 0xee }; in TEST_P() local 76 ASSERT_EQ(4, mCache->getBlob("abcd", 4, buf, 4)); in TEST_P() 77 ASSERT_EQ('e', buf[0]); in TEST_P() 78 ASSERT_EQ('f', buf[1]); in TEST_P() [all …]
|
/frameworks/base/core/tests/coretests/src/android/os/ |
D | RedactingFileDescriptorTest.java | 60 final byte[] buf = new byte[1_000_000]; in setUp() 61 Arrays.fill(buf, (byte) 64); in setUp() 62 out.write(buf); in setUp() 76 final byte[] buf = new byte[1_000]; in testSingleByte() 77 assertEquals(buf.length, Os.read(fd, buf, 0, buf.length)); in testSingleByte() 78 for (int i = 0; i < buf.length; i++) { in testSingleByte() 80 assertEquals(0, buf[i]); in testSingleByte() 82 assertEquals(64, buf[i]); in testSingleByte() 92 final byte[] buf = new byte[10]; in testRanges() 93 assertEquals(buf.length, Os.pread(fd, buf, 0, 10, 90)); in testRanges() [all …]
|
/frameworks/native/libs/gui/tests/ |
D | SurfaceTextureClient_test.cpp | 208 ANativeWindowBuffer* buf; in TEST_F() local 209 ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); in TEST_F() 210 EXPECT_EQ(1, buf->width); in TEST_F() 211 EXPECT_EQ(1, buf->height); in TEST_F() 212 EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format); in TEST_F() 213 ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf, -1)); in TEST_F() 218 ANativeWindowBuffer* buf; in TEST_F() local 221 ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); in TEST_F() 222 EXPECT_EQ(16, buf->width); in TEST_F() 223 EXPECT_EQ(8, buf->height); in TEST_F() [all …]
|
D | CpuConsumer_test.cpp | 167 void checkPixel(const CpuConsumer::LockedBuffer &buf, in checkPixel() argument 170 switch(buf.format) { in checkPixel() 173 uint16_t *bPtr = (uint16_t*)buf.data; in checkPixel() 174 bPtr += y * buf.stride + x; in checkPixel() 192 uint8_t *bPtr = (uint8_t*)buf.data; in checkPixel() 193 bPtr += y * buf.stride + x; in checkPixel() 200 uint16_t *bPtr = ((uint16_t*)buf.data) + y * buf.stride + x; in checkPixel() 207 uint8_t *bPtr = (uint8_t*)buf.data; in checkPixel() 208 bPtr += (y * buf.stride + x) * bytesPerPixel; in checkPixel() 216 ADD_FAILURE() << "Unknown format for check:" << buf.format; in checkPixel() [all …]
|
D | FillBuffer.cpp | 25 void fillYV12Buffer(uint8_t* buf, int w, int h, int stride) { in fillYV12Buffer() argument 39 buf[yuvTexOffsetY + (y * yuvTexStrideY) + x] = intensity; in fillYV12Buffer() 41 buf[yuvTexOffsetU + (y * yuvTexStrideU) + x] = intensity; in fillYV12Buffer() 43 buf[yuvTexOffsetV + (y*2 * yuvTexStrideV) + x*2 + 0] = in fillYV12Buffer() 44 buf[yuvTexOffsetV + (y*2 * yuvTexStrideV) + x*2 + 1] = in fillYV12Buffer() 45 buf[yuvTexOffsetV + ((y*2+1) * yuvTexStrideV) + x*2 + 0] = in fillYV12Buffer() 46 buf[yuvTexOffsetV + ((y*2+1) * yuvTexStrideV) + x*2 + 1] = in fillYV12Buffer() 54 void fillYV12BufferRect(uint8_t* buf, int w, int h, int stride, in fillYV12BufferRect() argument 66 buf[yuvTexOffsetY + (y * yuvTexStrideY) + x] = inside ? 240 : 64; in fillYV12BufferRect() 70 buf[yuvTexOffsetU + (y * yuvTexStrideU) + x] = 16; in fillYV12BufferRect() [all …]
|
/frameworks/native/opengl/libs/EGL/ |
D | BlobCache_test.cpp | 51 unsigned char buf[4] = {0xee, 0xee, 0xee, 0xee}; in TEST_F() local 53 ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4)); in TEST_F() 54 ASSERT_EQ('e', buf[0]); in TEST_F() 55 ASSERT_EQ('f', buf[1]); in TEST_F() 56 ASSERT_EQ('g', buf[2]); in TEST_F() 57 ASSERT_EQ('h', buf[3]); in TEST_F() 61 unsigned char buf[2] = {0xee, 0xee}; in TEST_F() local 64 ASSERT_EQ(size_t(2), mBC->get("ab", 2, buf, 2)); in TEST_F() 65 ASSERT_EQ('c', buf[0]); in TEST_F() 66 ASSERT_EQ('d', buf[1]); in TEST_F() [all …]
|
D | MultifileBlobCache_test.cpp | 73 unsigned char buf[4] = {0xee, 0xee, 0xee, 0xee}; in TEST_F() local 75 ASSERT_EQ(size_t(4), mMBC->get("abcd", 4, buf, 4)); in TEST_F() 76 ASSERT_EQ('e', buf[0]); in TEST_F() 77 ASSERT_EQ('f', buf[1]); in TEST_F() 78 ASSERT_EQ('g', buf[2]); in TEST_F() 79 ASSERT_EQ('h', buf[3]); in TEST_F() 83 unsigned char buf[2] = {0xee, 0xee}; in TEST_F() local 86 ASSERT_EQ(size_t(2), mMBC->get("ab", 2, buf, 2)); in TEST_F() 87 ASSERT_EQ('c', buf[0]); in TEST_F() 88 ASSERT_EQ('d', buf[1]); in TEST_F() [all …]
|
D | FileBlobCache.cpp | 37 uint32_t crc32c(const uint8_t* buf, size_t len) { in crc32c() argument 41 r ^= buf[i]; in crc32c() 87 uint8_t* buf = reinterpret_cast<uint8_t*>(mmap(nullptr, fileSize, in FileBlobCache() local 89 if (buf == MAP_FAILED) { in FileBlobCache() 98 if (memcmp(buf, cacheFileMagic, 4) != 0) { in FileBlobCache() 103 uint32_t* crc = reinterpret_cast<uint32_t*>(buf + 4); in FileBlobCache() 104 if (crc32c(buf + headerSize, cacheSize) != *crc) { in FileBlobCache() 110 int err = unflatten(buf + headerSize, cacheSize); in FileBlobCache() 114 munmap(buf, fileSize); in FileBlobCache() 119 munmap(buf, fileSize); in FileBlobCache() [all …]
|
/frameworks/libs/binary_translation/guest_os_primitives/riscv64/ |
D | guest_setjmp.cc | 63 uint64_t CalcJumpBufChecksum(const uint64_t* buf) { in CalcJumpBufChecksum() argument 66 res ^= buf[i]; in CalcJumpBufChecksum() 74 uint64_t* buf = reinterpret_cast<uint64_t*>(guest_jmp_buf); in SaveRegsToJumpBuf() local 77 memset(buf, 0, kJmpBufChecksumWord * sizeof(uint64_t)); in SaveRegsToJumpBuf() 80 buf[kJmpBufSigFlagAndCookieWord] = kJmpBufCookie; in SaveRegsToJumpBuf() 82 buf[kJmpBufSigFlagAndCookieWord] |= 0x1; in SaveRegsToJumpBuf() 84 SIG_SETMASK, nullptr, reinterpret_cast<HostSigset*>(buf + kJmpBufSigMaskWord)); in SaveRegsToJumpBuf() 92 memcpy(buf + kJmpBufRaWord, state->cpu.x + RA, 3 * kXRegSize); in SaveRegsToJumpBuf() 95 memcpy(buf + kJmpBufCoreBaseWord, state->cpu.x + S0, 2 * kXRegSize); in SaveRegsToJumpBuf() 97 memcpy(buf + kJmpBufCoreBaseWord + 2, state->cpu.x + S2, 10 * kXRegSize); in SaveRegsToJumpBuf() [all …]
|
/frameworks/minikin/libs/minikin/ |
D | Locale.cpp | 51 static bool isSubtag(const char* buf, size_t bufLen, const char* subtag, size_t subtagLen) { in isSubtag() argument 55 if (strncmp(buf, subtag, subtagLen) != 0) { in isSubtag() 58 return (bufLen == subtagLen || buf[subtagLen] == '\0' || buf[subtagLen] == '-' || in isSubtag() 59 buf[subtagLen] == '_'); in isSubtag() 230 void Locale::resolveUnicodeExtension(const char* buf, size_t length) { in resolveUnicodeExtension() argument 232 const char* pos = std::search(buf, buf + length, kPrefix, kPrefix + strlen(kPrefix)); in resolveUnicodeExtension() 233 if (pos != buf + length) { in resolveUnicodeExtension() 235 const size_t remainingLength = length - (pos - buf); in resolveUnicodeExtension() 242 EmojiStyle Locale::resolveEmojiStyle(const char* buf, size_t length) { in resolveEmojiStyle() argument 248 const char* pos = std::search(buf, buf + length, kPrefix, kPrefix + strlen(kPrefix)); in resolveEmojiStyle() [all …]
|
/frameworks/base/tools/aapt/ |
D | Utils.cpp | 31 char* buf = s.lockBuffer(len); in convertToResPath() local 32 for (char* end = buf + len; buf < end; ++buf) { in convertToResPath() 33 if (*buf == OS_PATH_SEPARATOR) *buf = RES_PATH_SEPARATOR; in convertToResPath() 43 const char* buf = str; in walkPath() local 45 cp = strchr(buf, OS_PATH_SEPARATOR); in walkPath() 46 if (cp == buf) { in walkPath() 48 buf = buf + 1; in walkPath() 49 cp = strchr(buf, OS_PATH_SEPARATOR); in walkPath() 53 String8 res = buf != str ? String8(buf) : path; in walkPath() 58 String8 res(buf, cp - buf); in walkPath()
|
D | ZipEntry.cpp | 377 unsigned char buf[kLFHLen]; in read() local 382 if (fread(buf, 1, kLFHLen, fp) != kLFHLen) { in read() 387 if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) { in read() 393 mVersionToExtract = ZipEntry::getShortLE(&buf[0x04]); in read() 394 mGPBitFlag = ZipEntry::getShortLE(&buf[0x06]); in read() 395 mCompressionMethod = ZipEntry::getShortLE(&buf[0x08]); in read() 396 mLastModFileTime = ZipEntry::getShortLE(&buf[0x0a]); in read() 397 mLastModFileDate = ZipEntry::getShortLE(&buf[0x0c]); in read() 398 mCRC32 = ZipEntry::getLongLE(&buf[0x0e]); in read() 399 mCompressedSize = ZipEntry::getLongLE(&buf[0x12]); in read() [all …]
|
/frameworks/base/libs/protoutil/tests/ |
D | protobuf_test.cpp | 28 uint8_t buf[11]; in TEST() local 29 memset(buf, UNSET_BYTE, sizeof(buf)); in TEST() 30 EXPECT_EQ(write_raw_varint(buf, UINT64_C(150)) - buf, 2); in TEST() 31 EXPECT_EQ(buf[0], 0x96); in TEST() 32 EXPECT_EQ(buf[1], 0x01); in TEST() 33 EXPECT_EQ(buf[2], UNSET_BYTE); in TEST() 35 memset(buf, UNSET_BYTE, sizeof(buf)); in TEST() 36 EXPECT_EQ(write_raw_varint(buf, UINT64_C(-2)) - buf, 10); in TEST() 37 EXPECT_EQ(buf[0], 0xfe); in TEST() 39 EXPECT_EQ(buf[i], 0xff); in TEST() [all …]
|
/frameworks/libs/binary_translation/runtime/ |
D | run_guest_call_riscv64.cc | 66 void RunGuestCall(GuestAddr pc, GuestArgumentBuffer* buf) { in RunGuestCall() argument 75 memcpy(&(state->cpu.x[A0]), buf->argv, buf->argc * sizeof(buf->argv[0])); in RunGuestCall() 76 memcpy(&(state->cpu.f[FA0]), buf->fp_argv, buf->fp_argc * sizeof(buf->fp_argv[0])); in RunGuestCall() 79 SetXReg<SP>(state->cpu, GetXReg<SP>(state->cpu) - buf->stack_argc); in RunGuestCall() 85 memcpy(ToHostAddr<void>(GetXReg<SP>(state->cpu)), buf->stack_argv, buf->stack_argc); in RunGuestCall() 98 memcpy(buf->argv, &(state->cpu.x[A0]), buf->resc * sizeof(buf->argv[0])); in RunGuestCall() 99 memcpy(buf->fp_argv, &(state->cpu.f[FA0]), buf->fp_resc * sizeof(buf->fp_argv[0])); in RunGuestCall()
|
/frameworks/compile/libbcc/bcinfo/include/bcinfo/Wrap/ |
D | BCHeaderField.h | 48 bool Write(uint8_t* buf, size_t buf_len) { in Write() argument 57 WriteFixedSubfield(static_cast<FixedSubfield>(ID_), buf); in Write() 59 buf + sizeof(FixedSubfield)); in Write() 60 memcpy(buf + kTagLenSize, data_, len_); in Write() 63 memset(buf + fields_len, 0, pad_len); in Write() 68 bool Read(const uint8_t* buf, size_t buf_len) { in Read() argument 71 ReadFixedSubfield(&field, buf); in Read() 73 ReadFixedSubfield(&field, buf + sizeof(FixedSubfield)); in Read() 76 memcpy(data_, buf + kTagLenSize, len_); in Read() 89 static size_t GetDataSizeFromSerialized(const uint8_t* buf) { in GetDataSizeFromSerialized() argument [all …]
|
/frameworks/av/media/mtp/tests/MtpFfsHandleTest/ |
D | MtpFfsHandle_test.cpp | 120 char buf[TEST_PACKET_SIZE + 1]; in TYPED_TEST() local 121 buf[TEST_PACKET_SIZE] = '\0'; in TYPED_TEST() 122 EXPECT_EQ(this->handle->read(buf, TEST_PACKET_SIZE), TEST_PACKET_SIZE); in TYPED_TEST() 123 EXPECT_STREQ(buf, dummyDataStr.c_str()); in TYPED_TEST() 129 char buf[size + 1]; in TYPED_TEST() local 130 buf[size] = '\0'; in TYPED_TEST() 136 EXPECT_EQ(this->handle->read(buf, size), size); in TYPED_TEST() 138 EXPECT_STREQ(buf, ss.str().c_str()); in TYPED_TEST() 142 char buf[TEST_PACKET_SIZE + 1]; in TYPED_TEST() local 143 buf[TEST_PACKET_SIZE] = '\0'; in TYPED_TEST() [all …]
|
/frameworks/base/packages/DynamicSystemInstallationService/src/com/android/dynsystem/ |
D | SparseInputStream.java | 56 byte[] buf = new byte[size]; in readFull() 58 if ((n = in.read(buf, done, size - done)) < 0) { in readFull() 62 return buf; in readFull() 71 ByteBuffer buf = readBuffer(in, CHUNK_HDR_SIZE); in readChunk() local 72 chunk.mChunkType = buf.getShort(); in readChunk() 73 buf.getShort(); in readChunk() 74 chunk.mChunkSize = buf.getInt(); in readChunk() 75 chunk.mTotalSize = buf.getInt(); in readChunk() 91 ByteBuffer buf = readBuffer(mIn, FILE_HDR_SIZE); in SparseInputStream() local 92 mIsSparse = (buf.getInt() == 0xed26ff3a); in SparseInputStream() [all …]
|
/frameworks/libs/binary_translation/runtime_primitives/ |
D | profiler_interface.cc | 61 char buf[160]; in ProfilerOpenLogFile() local 65 FormatBuffer(buf, sizeof(buf), "/data/data/%s/perf-%u.map", app, pid); in ProfilerOpenLogFile() 67 FormatBuffer(buf, sizeof(buf), "/data/local/tmp/perf-%u.map", pid); in ProfilerOpenLogFile() 70 int fd = open(buf, O_WRONLY | O_CREAT | O_CLOEXEC, S_IWUSR); in ProfilerOpenLogFile() 72 TRACE("Profiling Error: Failed to open map file %s", buf); in ProfilerOpenLogFile() 74 TRACE("Probfiling to %s", buf); in ProfilerOpenLogFile() 91 char buf[80]; in ProfilerLogGeneratedCode() local 94 size_t n = FormatBuffer(buf, in ProfilerLogGeneratedCode() 95 sizeof(buf), in ProfilerLogGeneratedCode() 102 UNUSED(write(fd, buf, n)); in ProfilerLogGeneratedCode()
|
/frameworks/opt/telephony/src/java/com/android/internal/telephony/cat/ |
D | ResponseData.java | 44 public abstract void format(ByteArrayOutputStream buf); in format() argument 46 public static void writeLength(ByteArrayOutputStream buf, int length) { in writeLength() argument 51 buf.write(0x81); in writeLength() 53 buf.write(length); in writeLength() 67 public void format(ByteArrayOutputStream buf) { in format() argument 70 buf.write(tag); // tag in format() 71 buf.write(1); // length in format() 72 buf.write(mId); // identifier of item chosen in format() 106 public void format(ByteArrayOutputStream buf) { in format() argument 107 if (buf == null) { in format() [all …]
|
/frameworks/base/libs/androidfw/ |
D | ZipUtils.cpp | 43 bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const override { in ReadAtOffset() argument 55 size_t read = fread(buf, 1, len, mFp); in ReadAtOffset() 74 bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const override { in ReadAtOffset() argument 75 return android::base::ReadFullyAtOffset(mFd, buf, len, offset); in ReadAtOffset() 89 bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const override { in ReadAtOffset() argument 99 memcpy(buf, pos.unsafe_ptr(), len); in ReadAtOffset() 114 bool Append(uint8_t* buf, size_t bufSize) override { in Append() argument 119 memcpy(mOutput + mBytesWritten, buf, bufSize); in Append() 130 /*static*/ bool ZipUtils::inflateToBuffer(FILE* fp, void* buf, in inflateToBuffer() argument 134 BufferWriter writer(buf, uncompressedLen); in inflateToBuffer() [all …]
|
/frameworks/base/tools/powermodel/src/com/android/powermodel/ |
D | CsvParser.java | 60 final byte[] buf = new byte[MAX_FIELD_SIZE+1]; in parse() 70 int amt = input.read(buf, readPos, buf.length-readPos); in parse() 86 byte c = buf[index]; in parse() 91 fields.add(new String(buf, fieldStart, escapeIndex-fieldStart)); in parse() 96 fields.add(new String(buf, fieldStart, index-fieldStart)); in parse() 114 buf[escapeIndex] = buf[index]; in parse() 122 fields.add(new String(buf, fieldStart, escapeIndex-fieldStart)); in parse() 128 buf[escapeIndex] = buf[index]; in parse() 135 fields.add(new String(buf, fieldStart, index-fieldStart)); in parse() 149 if (fieldStart == 0 && index == buf.length) { in parse() [all …]
|
/frameworks/minikin/tests/unittest/ |
D | WordBreakerTests.cpp | 34 uint16_t buf[] = {'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'}; in TEST() local 36 breaker.setText(buf, NELEM(buf)); in TEST() 44 EXPECT_EQ((ssize_t)NELEM(buf), breaker.next()); // end in TEST() 52 uint16_t buf[] = {'h', 'e', 'l', 0x00AD, 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'}; in TEST() local 56 breaker.setText(buf, NELEM(buf)); in TEST() 63 EXPECT_EQ((ssize_t)NELEM(buf), breaker.next()); // end in TEST() 71 uint16_t buf[] = {'s', 'u', 'g', 'a', 'r', '-', 'f', 'r', 'e', 'e'}; in TEST() local 75 breaker.setText(buf, NELEM(buf)); in TEST() 77 EXPECT_EQ((ssize_t)NELEM(buf), in TEST() 80 EXPECT_EQ((ssize_t)NELEM(buf), breaker.wordEnd()); in TEST() [all …]
|
/frameworks/libs/binary_translation/tests/ndk_program_tests/ |
D | file_test.cc | 68 char buf[5]; in TEST() local 69 ASSERT_EQ(fread(&buf, 1, 5, f.get()), 5U); in TEST() 70 EXPECT_EQ(buf[0], 'H'); in TEST() 71 EXPECT_EQ(buf[4], 'o'); in TEST() 78 char buf[5]; in TEST() local 79 ASSERT_EQ(pread(f.fd(), buf, 4, 1), 4); in TEST() 80 buf[4] = '\0'; in TEST() 81 EXPECT_STREQ(buf, "ello"); in TEST() 142 void TestStatBuf(const struct stat& buf, int file_size, const char* msg) { in TestStatBuf() argument 143 EXPECT_EQ(buf.st_size, file_size) << msg; in TestStatBuf() [all …]
|