/frameworks/base/core/tests/coretests/src/android/os/ |
D | RedactingFileDescriptorTest.java | 53 final byte[] buf = new byte[1_000_000]; in setUp() 54 Arrays.fill(buf, (byte) 64); in setUp() 55 out.write(buf); in setUp() 69 final byte[] buf = new byte[1_000]; in testSingleByte() 70 assertEquals(buf.length, Os.read(fd, buf, 0, buf.length)); in testSingleByte() 71 for (int i = 0; i < buf.length; i++) { in testSingleByte() 73 assertEquals(0, buf[i]); in testSingleByte() 75 assertEquals(64, buf[i]); in testSingleByte() 85 final byte[] buf = new byte[10]; in testRanges() 86 assertEquals(buf.length, Os.pread(fd, buf, 0, 10, 90)); in testRanges() [all …]
|
/frameworks/native/opengl/libs/EGL/ |
D | BlobCache_test.cpp | 56 unsigned char buf[4] = { 0xee, 0xee, 0xee, 0xee }; in TEST_F() local 58 ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4)); in TEST_F() 59 ASSERT_EQ('e', buf[0]); in TEST_F() 60 ASSERT_EQ('f', buf[1]); in TEST_F() 61 ASSERT_EQ('g', buf[2]); in TEST_F() 62 ASSERT_EQ('h', buf[3]); in TEST_F() 66 unsigned char buf[2] = { 0xee, 0xee }; in TEST_F() local 69 ASSERT_EQ(size_t(2), mBC->get("ab", 2, buf, 2)); in TEST_F() 70 ASSERT_EQ('c', buf[0]); in TEST_F() 71 ASSERT_EQ('d', buf[1]); in TEST_F() [all …]
|
D | FileBlobCache.cpp | 32 static uint32_t crc32c(const uint8_t* buf, size_t len) { in crc32c() argument 36 r ^= buf[i]; in crc32c() 80 uint8_t* buf = reinterpret_cast<uint8_t*>(mmap(nullptr, fileSize, in FileBlobCache() local 82 if (buf == MAP_FAILED) { in FileBlobCache() 91 if (memcmp(buf, cacheFileMagic, 4) != 0) { in FileBlobCache() 96 uint32_t* crc = reinterpret_cast<uint32_t*>(buf + 4); in FileBlobCache() 97 if (crc32c(buf + headerSize, cacheSize) != *crc) { in FileBlobCache() 103 int err = unflatten(buf + headerSize, cacheSize); in FileBlobCache() 107 munmap(buf, fileSize); in FileBlobCache() 112 munmap(buf, fileSize); in FileBlobCache() [all …]
|
/frameworks/ml/nn/driver/cache/nnCache/ |
D | nnCache_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/native/libs/gui/tests/ |
D | SurfaceTextureClient_test.cpp | 220 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(1, buf->width); in TEST_F() 223 EXPECT_EQ(1, buf->height); in TEST_F() 224 EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format); in TEST_F() 225 ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf, -1)); in TEST_F() 230 ANativeWindowBuffer* buf; in TEST_F() local 233 ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); in TEST_F() 234 EXPECT_EQ(16, buf->width); in TEST_F() 235 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/tests/EGLTest/ |
D | egl_cache_test.cpp | 48 uint8_t buf[4] = { 0xee, 0xee, 0xee, 0xee }; in TEST_F() local 50 ASSERT_EQ(0, mCache->getBlob("abcd", 4, buf, 4)); in TEST_F() 51 ASSERT_EQ(0xee, buf[0]); in TEST_F() 52 ASSERT_EQ(0xee, buf[1]); in TEST_F() 53 ASSERT_EQ(0xee, buf[2]); in TEST_F() 54 ASSERT_EQ(0xee, buf[3]); in TEST_F() 58 uint8_t buf[4] = { 0xee, 0xee, 0xee, 0xee }; in TEST_F() local 61 ASSERT_EQ(4, mCache->getBlob("abcd", 4, buf, 4)); in TEST_F() 62 ASSERT_EQ('e', buf[0]); in TEST_F() 63 ASSERT_EQ('f', buf[1]); in TEST_F() [all …]
|
/frameworks/ml/nn/driver/cache/BlobCache/ |
D | BlobCache_test.cpp | 70 unsigned char buf[4] = { 0xee, 0xee, 0xee, 0xee }; in TEST_P() local 72 ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4)); in TEST_P() 73 ASSERT_EQ('e', buf[0]); in TEST_P() 74 ASSERT_EQ('f', buf[1]); in TEST_P() 75 ASSERT_EQ('g', buf[2]); in TEST_P() 76 ASSERT_EQ('h', buf[3]); in TEST_P() 80 unsigned char buf[2] = { 0xee, 0xee }; in TEST_P() local 83 ASSERT_EQ(size_t(2), mBC->get("ab", 2, buf, 2)); in TEST_P() 84 ASSERT_EQ('c', buf[0]); in TEST_P() 85 ASSERT_EQ('d', buf[1]); in TEST_P() [all …]
|
/frameworks/base/core/java/android/net/util/ |
D | IpUtils.java | 46 private static int checksum(ByteBuffer buf, int seed, int start, int end) { in checksum() argument 48 final int bufPosition = buf.position(); in checksum() 52 buf.position(start); in checksum() 53 ShortBuffer shortBuf = buf.asShortBuffer(); in checksum() 56 buf.position(bufPosition); in checksum() 66 short b = buf.get(start); in checksum() 83 ByteBuffer buf, int headerOffset, int protocol, int transportLen) { in pseudoChecksumIPv4() argument 85 partial += intAbs(buf.getShort(headerOffset + 12)); in pseudoChecksumIPv4() 86 partial += intAbs(buf.getShort(headerOffset + 14)); in pseudoChecksumIPv4() 87 partial += intAbs(buf.getShort(headerOffset + 16)); in pseudoChecksumIPv4() [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/minikin/libs/minikin/ |
D | Locale.cpp | 39 static bool isSubtag(const char* buf, size_t bufLen, const char* subtag, size_t subtagLen) { in isSubtag() argument 43 if (strncmp(buf, subtag, subtagLen) != 0) { in isSubtag() 46 return (bufLen == subtagLen || buf[subtagLen] == '\0' || buf[subtagLen] == '-' || in isSubtag() 47 buf[subtagLen] == '_'); in isSubtag() 218 void Locale::resolveUnicodeExtension(const char* buf, size_t length) { in resolveUnicodeExtension() argument 220 const char* pos = std::search(buf, buf + length, kPrefix, kPrefix + strlen(kPrefix)); in resolveUnicodeExtension() 221 if (pos != buf + length) { in resolveUnicodeExtension() 223 const size_t remainingLength = length - (pos - buf); in resolveUnicodeExtension() 231 LineBreakStyle Locale::resolveLineBreakStyle(const char* buf, size_t length) { in resolveLineBreakStyle() argument 237 const char* pos = std::search(buf, buf + length, kPrefix, kPrefix + strlen(kPrefix)); in resolveLineBreakStyle() [all …]
|
/frameworks/base/core/java/android/net/ |
D | NattKeepalivePacketData.java | 59 ByteBuffer buf = ByteBuffer.allocate(length); in nattKeepalivePacket() local 60 buf.order(ByteOrder.BIG_ENDIAN); in nattKeepalivePacket() 61 buf.putShort((short) 0x4500); // IP version and TOS in nattKeepalivePacket() 62 buf.putShort((short) length); in nattKeepalivePacket() 63 buf.putInt(0); // ID, flags, offset in nattKeepalivePacket() 64 buf.put((byte) 64); // TTL in nattKeepalivePacket() 65 buf.put((byte) OsConstants.IPPROTO_UDP); in nattKeepalivePacket() 66 int ipChecksumOffset = buf.position(); in nattKeepalivePacket() 67 buf.putShort((short) 0); // IP checksum in nattKeepalivePacket() 68 buf.put(srcAddress.getAddress()); in nattKeepalivePacket() [all …]
|
/frameworks/base/tools/aapt/ |
D | ZipEntry.cpp | 388 unsigned char buf[kLFHLen]; in read() local 393 if (fread(buf, 1, kLFHLen, fp) != kLFHLen) { in read() 398 if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) { in read() 404 mVersionToExtract = ZipEntry::getShortLE(&buf[0x04]); in read() 405 mGPBitFlag = ZipEntry::getShortLE(&buf[0x06]); in read() 406 mCompressionMethod = ZipEntry::getShortLE(&buf[0x08]); in read() 407 mLastModFileTime = ZipEntry::getShortLE(&buf[0x0a]); in read() 408 mLastModFileDate = ZipEntry::getShortLE(&buf[0x0c]); in read() 409 mCRC32 = ZipEntry::getLongLE(&buf[0x0e]); in read() 410 mCompressedSize = ZipEntry::getLongLE(&buf[0x12]); in read() [all …]
|
/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/base/libs/androidfw/ |
D | ZipUtils.cpp | 43 bool ReadAtOffset(uint8_t* buf, size_t len, uint32_t offset) const { in ReadAtOffset() argument 55 size_t read = fread(buf, 1, len, mFp); in ReadAtOffset() 74 bool ReadAtOffset(uint8_t* buf, size_t len, uint32_t offset) const { in ReadAtOffset() argument 75 return android::base::ReadFullyAtOffset(mFd, buf, len, static_cast<off_t>(offset)); in ReadAtOffset() 89 bool ReadAtOffset(uint8_t* buf, size_t len, uint32_t offset) const { in ReadAtOffset() argument 94 memcpy(buf, mInput + offset, len); in ReadAtOffset() 109 bool Append(uint8_t* buf, size_t bufSize) override { in Append() argument 114 memcpy(mOutput + mBytesWritten, buf, bufSize); in Append() 125 /*static*/ bool ZipUtils::inflateToBuffer(FILE* fp, void* buf, in inflateToBuffer() argument 129 BufferWriter writer(buf, uncompressedLen); in inflateToBuffer() [all …]
|
/frameworks/minikin/tests/unittest/ |
D | WordBreakerTests.cpp | 36 uint16_t buf[] = {'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'}; in TEST() local 38 breaker.setText(buf, NELEM(buf)); in TEST() 45 EXPECT_EQ((ssize_t)NELEM(buf), breaker.next()); // end in TEST() 53 uint16_t buf[] = {'h', 'e', 'l', 0x00AD, 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'}; in TEST() local 55 breaker.setText(buf, NELEM(buf)); in TEST() 62 EXPECT_EQ((ssize_t)NELEM(buf), breaker.next()); // end in TEST() 70 uint16_t buf[] = {'s', 'u', 'g', 'a', 'r', '-', 'f', 'r', 'e', 'e'}; in TEST() local 72 breaker.setText(buf, NELEM(buf)); in TEST() 74 EXPECT_EQ((ssize_t)NELEM(buf), breaker.followingWithLocale(Locale("en-US"), 0)); in TEST() 76 EXPECT_EQ((ssize_t)NELEM(buf), breaker.wordEnd()); in TEST() [all …]
|
/frameworks/av/media/mtp/tests/ |
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/opt/gamesdk/third_party/protobuf-3.0.0/conformance/ |
D | ConformanceJavaLite.java | 8 private boolean readFromStdin(byte[] buf, int len) throws Exception { in readFromStdin() argument 11 int read = System.in.read(buf, ofs, len); in readFromStdin() 22 private void writeToStdout(byte[] buf) throws Exception { in writeToStdout() argument 23 System.out.write(buf); in writeToStdout() 28 byte[] buf = new byte[4]; in readLittleEndianIntFromStdin() 29 if (!readFromStdin(buf, 4)) { in readLittleEndianIntFromStdin() 32 return (buf[0] & 0xff) in readLittleEndianIntFromStdin() 33 | ((buf[1] & 0xff) << 8) in readLittleEndianIntFromStdin() 34 | ((buf[2] & 0xff) << 16) in readLittleEndianIntFromStdin() 35 | ((buf[3] & 0xff) << 24); in readLittleEndianIntFromStdin() [all …]
|
D | ConformanceJava.java | 11 private boolean readFromStdin(byte[] buf, int len) throws Exception { in readFromStdin() argument 14 int read = System.in.read(buf, ofs, len); in readFromStdin() 25 private void writeToStdout(byte[] buf) throws Exception { in writeToStdout() argument 26 System.out.write(buf); in writeToStdout() 31 byte[] buf = new byte[4]; in readLittleEndianIntFromStdin() 32 if (!readFromStdin(buf, 4)) { in readLittleEndianIntFromStdin() 35 return (buf[0] & 0xff) in readLittleEndianIntFromStdin() 36 | ((buf[1] & 0xff) << 8) in readLittleEndianIntFromStdin() 37 | ((buf[2] & 0xff) << 16) in readLittleEndianIntFromStdin() 38 | ((buf[3] & 0xff) << 24); in readLittleEndianIntFromStdin() [all …]
|
/frameworks/base/tests/touchlag/ |
D | touchlag.cpp | 50 void clearBuffer(Buffer* buf, uint32_t pixel) { in clearBuffer() argument 51 android_memset32(buf->pixels, pixel, buf->s * buf->h * 4); in clearBuffer() 54 void drawTwoPixels(Buffer* buf, uint32_t pixel, ssize_t x, ssize_t y, size_t w) { in drawTwoPixels() argument 55 if (y>0 && y<ssize_t(buf->h)) { in drawTwoPixels() 56 uint32_t* bits = buf->pixels + y * buf->s; in drawTwoPixels() 57 if (x>=0 && x<ssize_t(buf->w)) { in drawTwoPixels() 61 if ((x+W)>=0 && (x+W)<ssize_t(buf->w)) { in drawTwoPixels() 67 void drawHLine(Buffer* buf, uint32_t pixel, ssize_t x, ssize_t y, size_t w) { in drawHLine() argument 68 if (y>0 && y<ssize_t(buf->h)) { in drawHLine() 74 if (x+w > buf->w) { in drawHLine() [all …]
|
/frameworks/opt/telephony/src/java/com/android/internal/telephony/cat/ |
D | ResponseData.java | 38 public abstract void format(ByteArrayOutputStream buf); in format() argument 40 public static void writeLength(ByteArrayOutputStream buf, int length) { in writeLength() argument 45 buf.write(0x81); in writeLength() 47 buf.write(length); in writeLength() 61 public void format(ByteArrayOutputStream buf) { in format() argument 64 buf.write(tag); // tag in format() 65 buf.write(1); // length in format() 66 buf.write(mId); // identifier of item chosen in format() 100 public void format(ByteArrayOutputStream buf) { in format() argument 101 if (buf == null) { in format() [all …]
|
/frameworks/base/services/net/java/android/net/ |
D | TcpKeepalivePacketData.java | 107 ByteBuffer buf = ByteBuffer.allocate(length); in buildV4Packet() local 108 buf.order(ByteOrder.BIG_ENDIAN); in buildV4Packet() 109 buf.put((byte) 0x45); // IP version and IHL in buildV4Packet() 110 buf.put((byte) tcpDetails.tos); // TOS in buildV4Packet() 111 buf.putShort((short) length); in buildV4Packet() 112 buf.putInt(0x00004000); // ID, flags=DF, offset in buildV4Packet() 113 buf.put((byte) tcpDetails.ttl); // TTL in buildV4Packet() 114 buf.put((byte) OsConstants.IPPROTO_TCP); in buildV4Packet() 115 final int ipChecksumOffset = buf.position(); in buildV4Packet() 116 buf.putShort((short) 0); // IP checksum in buildV4Packet() [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/native/libs/ui/ |
D | HdrCapabilities.cpp | 44 int32_t* const buf = static_cast<int32_t*>(buffer); in flatten() local 45 reinterpret_cast<float&>(buf[0]) = mMaxLuminance; in flatten() 46 reinterpret_cast<float&>(buf[1]) = mMaxAverageLuminance; in flatten() 47 reinterpret_cast<float&>(buf[2]) = mMinLuminance; in flatten() 48 buf[3] = static_cast<int32_t>(mSupportedHdrTypes.size()); in flatten() 50 buf[4 + i] = static_cast<int32_t>(mSupportedHdrTypes[i]); in flatten() 66 int32_t const * const buf = static_cast<int32_t const *>(buffer); in unflatten() local 67 const size_t itemCount = size_t(buf[3]); in unflatten() 74 mMaxLuminance = reinterpret_cast<float const&>(buf[0]); in unflatten() 75 mMaxAverageLuminance = reinterpret_cast<float const&>(buf[1]); in unflatten() [all …]
|