/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 | 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 | FileBlobCache.cpp | 34 static uint32_t crc32c(const uint8_t* buf, size_t len) { in crc32c() argument 38 r ^= buf[i]; in crc32c() 82 uint8_t* buf = reinterpret_cast<uint8_t*>(mmap(nullptr, fileSize, in FileBlobCache() local 84 if (buf == MAP_FAILED) { in FileBlobCache() 93 if (memcmp(buf, cacheFileMagic, 4) != 0) { in FileBlobCache() 98 uint32_t* crc = reinterpret_cast<uint32_t*>(buf + 4); in FileBlobCache() 99 if (crc32c(buf + headerSize, cacheSize) != *crc) { in FileBlobCache() 105 int err = unflatten(buf + headerSize, cacheSize); in FileBlobCache() 109 munmap(buf, fileSize); in FileBlobCache() 114 munmap(buf, fileSize); in FileBlobCache() [all …]
|
/frameworks/native/libs/gui/tests/ |
D | SurfaceTextureClient_test.cpp | 218 ANativeWindowBuffer* buf; in TEST_F() local 219 ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); in TEST_F() 220 EXPECT_EQ(1, buf->width); in TEST_F() 221 EXPECT_EQ(1, buf->height); in TEST_F() 222 EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format); in TEST_F() 223 ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf, -1)); in TEST_F() 228 ANativeWindowBuffer* buf; in TEST_F() local 231 ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); in TEST_F() 232 EXPECT_EQ(16, buf->width); in TEST_F() 233 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/libs/net/common/framework/com/android/net/module/util/ |
D | IpUtils.java | 45 private static int checksum(ByteBuffer buf, int seed, int start, int end) { in checksum() argument 47 final int bufPosition = buf.position(); in checksum() 51 buf.position(start); in checksum() 52 ShortBuffer shortBuf = buf.asShortBuffer(); in checksum() 55 buf.position(bufPosition); in checksum() 65 short b = buf.get(start); in checksum() 82 ByteBuffer buf, int headerOffset, int protocol, int transportLen) { in pseudoChecksumIPv4() argument 84 partial += intAbs(buf.getShort(headerOffset + 12)); in pseudoChecksumIPv4() 85 partial += intAbs(buf.getShort(headerOffset + 14)); in pseudoChecksumIPv4() 86 partial += intAbs(buf.getShort(headerOffset + 16)); in pseudoChecksumIPv4() [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/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/net/common/device/com/android/net/module/util/netlink/ |
D | NduseroptMessage.java | 66 NduseroptMessage(@NonNull StructNlMsgHdr header, @NonNull ByteBuffer buf) in NduseroptMessage() argument 71 buf.order(ByteOrder.nativeOrder()); // Restored in the finally clause inside parse(). in NduseroptMessage() 72 final int start = buf.position(); in NduseroptMessage() 73 family = buf.get(); in NduseroptMessage() 74 buf.get(); // Skip 1 byte of padding. in NduseroptMessage() 75 opts_len = Short.toUnsignedInt(buf.getShort()); in NduseroptMessage() 76 ifindex = buf.getInt(); in NduseroptMessage() 77 icmp_type = buf.get(); in NduseroptMessage() 78 icmp_code = buf.get(); in NduseroptMessage() 79 buf.position(buf.position() + 6); // Skip 6 bytes of padding. in NduseroptMessage() [all …]
|
D | NdOption.java | 55 public static NdOption parse(@NonNull ByteBuffer buf) { in parse() argument 56 if (buf.remaining() < STRUCT_SIZE) return null; in parse() 59 byte type = buf.get(buf.position()); in parse() 60 int length = Byte.toUnsignedInt(buf.get(buf.position() + 1)); in parse() 65 return StructNdOptPref64.parse(buf); in parse() 68 return StructNdOptRdnss.parse(buf); in parse() 71 int newPosition = Math.min(buf.limit(), buf.position() + length * 8); in parse() 72 buf.position(newPosition); in parse() 77 void writeToByteBuffer(ByteBuffer buf) { in writeToByteBuffer() argument 78 buf.put(type); in writeToByteBuffer() [all …]
|
D | StructNdOptPref64.java | 112 private StructNdOptPref64(@NonNull ByteBuffer buf) { in StructNdOptPref64() argument 113 super(buf.get(), Byte.toUnsignedInt(buf.get())); in StructNdOptPref64() 117 int scaledLifetimePlc = Short.toUnsignedInt(buf.getShort()); in StructNdOptPref64() 121 buf.get(addressBytes, 0, 12); in StructNdOptPref64() 139 public static StructNdOptPref64 parse(@NonNull ByteBuffer buf) { in parse() argument 140 if (buf.remaining() < STRUCT_SIZE) return null; in parse() 142 return new StructNdOptPref64(buf); in parse() 152 protected void writeToByteBuffer(ByteBuffer buf) { in writeToByteBuffer() argument 153 super.writeToByteBuffer(buf); in writeToByteBuffer() 154 buf.putShort(getScaledLifetimePlc(lifetime, prefixLengthToPlc(prefix.getPrefixLength()))); in writeToByteBuffer() [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/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/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/libs/net/common/tests/unit/src/com/android/net/module/util/netlink/ |
D | StructNdOptPref64Test.java | 75 ByteBuffer buf = ByteBuffer.allocate(16) in makeNdOptPref64() local 81 buf.flip(); in makeNdOptPref64() 82 return buf; in makeNdOptPref64() 107 ByteBuffer buf = makeNdOptPref64(600, prefixBytes(PREFIX1), 0); in testParsing() local 108 StructNdOptPref64 opt = StructNdOptPref64.parse(buf); in testParsing() 112 buf = makeNdOptPref64(0, prefixBytes(PREFIX1), 1); in testParsing() 113 opt = StructNdOptPref64.parse(buf); in testParsing() 117 buf = makeNdOptPref64(8, prefixBytes(PREFIX2), 2); in testParsing() 118 opt = StructNdOptPref64.parse(buf); in testParsing() 123 buf = makeNdOptPref64(65528, prefixBytes(PREFIX2), 5); in testParsing() [all …]
|
D | NduseroptMessageTest.java | 97 ByteBuffer buf = toBuffer(hexBytes); in testParseWithinNetlinkMessage() local 98 assertEquals(68, buf.limit()); in testParseWithinNetlinkMessage() 99 buf.order(ByteOrder.nativeOrder()); in testParseWithinNetlinkMessage() 101 NetlinkMessage nlMsg = NetlinkMessage.parse(buf, NETLINK_ROUTE); in testParseWithinNetlinkMessage() 126 ByteBuffer buf = toBuffer(hexBytes); in testParseRdnssOptionWithinNetlinkMessage() local 127 assertEquals(76, buf.limit()); in testParseRdnssOptionWithinNetlinkMessage() 128 buf.order(ByteOrder.nativeOrder()); in testParseRdnssOptionWithinNetlinkMessage() 130 NetlinkMessage nlMsg = NetlinkMessage.parse(buf, NETLINK_ROUTE); in testParseRdnssOptionWithinNetlinkMessage() 148 ByteBuffer buf = toBuffer(truncatedHexBytes); in testParseTruncatedRdnssOptionWithinNetlinkMessage() local 149 buf.order(ByteOrder.nativeOrder()); in testParseTruncatedRdnssOptionWithinNetlinkMessage() [all …]
|
D | StructNdOptRdnssTest.java | 75 final ByteBuffer buf = ByteBuffer.allocate(8 + servers.length * 16) in makeRdnssOption() local 83 buf.put(rawBytes); in makeRdnssOption() 85 buf.flip(); in makeRdnssOption() 86 return buf; in makeRdnssOption() 128 final ByteBuffer buf = makeRdnssOption((byte) 38, (byte) 5 /* length */, in testParsing_invalidType() local 130 assertNull(StructNdOptRdnss.parse(buf)); in testParsing_invalidType() 135 final ByteBuffer buf = makeRdnssOption((byte) ICMPV6_ND_OPTION_RDNSS, in testParsing_smallOptionLength() local 137 assertNull(StructNdOptRdnss.parse(buf)); in testParsing_smallOptionLength() 142 final ByteBuffer buf = makeRdnssOption((byte) ICMPV6_ND_OPTION_RDNSS, in testParsing_oddOptionLength() local 144 assertNull(StructNdOptRdnss.parse(buf)); in testParsing_oddOptionLength() [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/native/libs/ui/ |
D | HdrCapabilities.cpp | 40 int32_t* const buf = static_cast<int32_t*>(buffer); in flatten() local 41 reinterpret_cast<float&>(buf[0]) = mMaxLuminance; in flatten() 42 reinterpret_cast<float&>(buf[1]) = mMaxAverageLuminance; in flatten() 43 reinterpret_cast<float&>(buf[2]) = mMinLuminance; in flatten() 44 buf[3] = static_cast<int32_t>(mSupportedHdrTypes.size()); in flatten() 46 buf[4 + i] = static_cast<int32_t>(mSupportedHdrTypes[i]); in flatten() 62 int32_t const * const buf = static_cast<int32_t const *>(buffer); in unflatten() local 63 const size_t itemCount = size_t(buf[3]); in unflatten() 70 mMaxLuminance = reinterpret_cast<float const&>(buf[0]); in unflatten() 71 mMaxAverageLuminance = reinterpret_cast<float const&>(buf[1]); in unflatten() [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() 46 EXPECT_EQ((ssize_t)NELEM(buf), breaker.next()); // end in TEST() 54 uint16_t buf[] = {'h', 'e', 'l', 0x00AD, 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'}; in TEST() local 58 breaker.setText(buf, NELEM(buf)); in TEST() 65 EXPECT_EQ((ssize_t)NELEM(buf), breaker.next()); // end in TEST() 73 uint16_t buf[] = {'s', 'u', 'g', 'a', 'r', '-', 'f', 'r', 'e', 'e'}; in TEST() local 77 breaker.setText(buf, NELEM(buf)); in TEST() 79 EXPECT_EQ((ssize_t)NELEM(buf), in TEST() 82 EXPECT_EQ((ssize_t)NELEM(buf), breaker.wordEnd()); in TEST() [all …]
|