/test/vts/utils/native/trace_processor/ |
D | VtsTraceProcessor.h | 43 void CleanupTraces(const std::string& path); 45 void ProcessTraceForLatencyProfiling(const std::string& trace_file); 48 void DedupTraces(const std::string& trace_dir); 58 const std::string& coverage_file_dir, const std::string& trace_file_dir, 61 void ParseTrace(const std::string& trace_file); 64 void ConvertTrace(const std::string& trace_file); 69 void GetTestListForHal(const std::string& test_trace_dir, 70 const std::string& output_file, 76 bool ParseBinaryTrace(const std::string& trace_file, bool ignore_timestamp, 82 bool ParseTextTrace(const std::string& trace_file, [all …]
|
/test/vts-testcase/kernel/encryption/ |
D | utils.cpp | 54 std::string Errno() { return std::string(": ") + strerror(errno); } in Errno() 57 void DeleteRecursively(const std::string &path) { in DeleteRecursively() 61 std::unique_ptr<DIR, int (*)(DIR *)> dirp(opendir(path.c_str()), closedir); in DeleteRecursively() 68 std::string filename(entry->d_name); in DeleteRecursively() 78 void RandomBytesForTesting(std::vector<uint8_t> &bytes) { in RandomBytesForTesting() 85 std::vector<uint8_t> GenerateTestKey(size_t size) { in GenerateTestKey() 86 std::vector<uint8_t> key(size); in GenerateTestKey() 91 std::string BytesToHex(const std::vector<uint8_t> &bytes) { in BytesToHex() 92 std::ostringstream o; in BytesToHex() 94 o << std::hex << std::setw(2) << std::setfill('0') << (int)b; in BytesToHex() [all …]
|
D | file_based_encryption_tests.cpp | 130 std::vector<uint8_t> plaintext; 131 std::vector<uint8_t> actual_ciphertext; 136 static bool GetInodeNumber(const std::string &path, uint64_t *inode_number) { in GetInodeNumber() 164 static bool IsFscryptV2Supported(const std::string &mountpoint) { in IsFscryptV2Supported() 220 static bool ReadRawDataOfFile(int fd, const std::string &blk_device, in ReadRawDataOfFile() 222 std::vector<uint8_t> *raw_data) { in ReadRawDataOfFile() 238 std::unique_ptr<struct fiemap> map( in ReadRawDataOfFile() 252 std::unique_ptr<void, void (*)(void *)> buf_mem( in ReadRawDataOfFile() 276 << std::hex << extent.fe_flags << std::dec; in ReadRawDataOfFile() 279 ADD_FAILURE() << "Unsupported extent flags: 0x" << std::hex in ReadRawDataOfFile() [all …]
|
D | vts_kernel_encryption.h | 30 bool Encrypt(const std::vector<uint8_t> &key, const uint8_t *iv, in Encrypt() 76 std::string Errno(); 78 void DeleteRecursively(const std::string &path); 80 void RandomBytesForTesting(std::vector<uint8_t> &bytes); 82 std::vector<uint8_t> GenerateTestKey(size_t size); 84 std::string BytesToHex(const std::vector<uint8_t> &bytes); 87 static inline std::string BytesToHex(const uint8_t (&array)[N]) { in BytesToHex() 88 return BytesToHex(std::vector<uint8_t>(&array[0], &array[N])); in BytesToHex() 100 std::string fs_blk_device; 101 std::string type; [all …]
|
D | Keymaster.cpp | 40 static void zeroize_vector(std::vector<uint8_t>& vec) { in zeroize_vector() 46 const std::string& func_name) { in logKeystore2ExceptionIfPresent() 88 std::string* key) { in generateKey() 91 .alias = std::nullopt, in generateKey() 93 .blob = std::nullopt, in generateKey() 97 in_key, std::nullopt, inParams.vector_data(), 0, {}, &keyMetadata); in generateKey() 101 if (keyMetadata.key.blob == std::nullopt) { in generateKey() 107 std::string(keyMetadata.key.blob->begin(), keyMetadata.key.blob->end()); in generateKey() 114 const std::string& key, std::string* outKeyBlob) { in importKey() 117 .alias = std::nullopt, in importKey() [all …]
|
D | metadata_encryption_tests.cpp | 99 static bool ReadBlockDevice(const std::string &blk_device, size_t count, in ReadBlockDevice() 100 std::vector<uint8_t> *data) { in ReadBlockDevice() 102 std::unique_ptr<void, void (*)(void *)> buf_mem( in ReadBlockDevice() 121 *data = std::vector<uint8_t>(buffer, buffer + count); in ReadBlockDevice() 148 bool CreateTestDevice(const std::string &cipher, 149 const std::vector<uint8_t> &key, bool is_wrapped_key); 150 void VerifyDecryption(const std::vector<uint8_t> &key, const Cipher &cipher); 151 void DoTest(const std::string &cipher_string, const Cipher &cipher); 154 std::string raw_blk_device_; 155 std::string dm_device_path_; [all …]
|
/test/vts/compilation_tools/vtsc/code_gen/profiler/ |
D | ProfilerCodeGenBase.h | 59 const VariableSpecificationMessage& val, const std::string& arg_name, 60 const std::string& arg_value) = 0; 64 const VariableSpecificationMessage& val, const std::string& arg_name, 65 const std::string& arg_value) = 0; 69 const VariableSpecificationMessage& val, const std::string& arg_name, 70 const std::string& arg_value) = 0; 74 const VariableSpecificationMessage& val, const std::string& arg_name, 75 const std::string& arg_value) = 0; 79 const VariableSpecificationMessage& val, const std::string& arg_name, 80 const std::string& arg_value) = 0; [all …]
|
D | HalHidlProfilerCodeGen.h | 33 const VariableSpecificationMessage& val, const std::string& arg_name, 34 const std::string& arg_value) override; 37 const VariableSpecificationMessage& val, const std::string& arg_name, 38 const std::string& arg_value) override; 41 const VariableSpecificationMessage& val, const std::string& arg_name, 42 const std::string& arg_value) override; 45 const VariableSpecificationMessage& val, const std::string& arg_name, 46 const std::string& arg_value) override; 49 const VariableSpecificationMessage& val, const std::string& arg_name, 50 const std::string& arg_value) override; [all …]
|
D | HalHidlProfilerCodeGen.cpp | 27 const std::string& arg_name, const std::string& arg_value) { in GenerateProfilerForScalarVariable() 35 const std::string& arg_name, const std::string& arg_value) { in GenerateProfilerForStringVariable() 45 const std::string& arg_name, const std::string& arg_value) { in GenerateProfilerForEnumVariable() 50 std::string predefined_type = val.predefined_type(); in GenerateProfilerForEnumVariable() 55 const std::string scalar_type = val.enum_value().scalar_type(); in GenerateProfilerForEnumVariable() 64 const std::string& arg_name, const std::string& arg_value) { in GenerateProfilerForVectorVariable() 67 std::string index_name = GetVarString(arg_name) + "_index"; in GenerateProfilerForVectorVariable() 71 std::string vector_element_name = in GenerateProfilerForVectorVariable() 85 const std::string& arg_name, const std::string& arg_value) { in GenerateProfilerForArrayVariable() 88 std::string index_name = GetVarString(arg_name) + "_index"; in GenerateProfilerForArrayVariable() [all …]
|
/test/mlts/benchmark/jni/ |
D | run_tflite.h | 42 std::vector<InferenceOutput> outputs; 43 std::function<bool(uint8_t*, size_t)> createInput; 47 using InferenceInOutSequence = std::vector<InferenceInOut>; 53 std::vector<float> meanSquareErrors; 55 std::vector<float> maxSingleErrors; 57 std::vector<std::vector<uint8_t>> inferenceOutputs; 63 std::vector<float> compileWithoutCacheTimeSec; 65 std::optional<std::vector<float>> saveToCacheTimeSec; 66 std::optional<std::vector<float>> prepareFromCacheTimeSec; 103 bool resizeInputTensors(std::vector<int> shape); [all …]
|
D | random_graph_test_jni.cpp | 55 FuzzerLogRAII(const std::string& nnapiLogPath) { in FuzzerLogRAII() 65 std::ofstream os; in FuzzerLogRAII() 91 std::vector<test_helper::TestOperationType> getOperationsInModel( in getOperationsInModel() 93 std::vector<test_helper::TestOperationType> result; in getOperationsInModel() 107 std::string deviceNameStr(deviceName); in findDeviceByName() 144 const std::string& deviceName, in RandomGraphGenerator() 145 const std::string& testName, uint32_t numOperations, in RandomGraphGenerator() 146 uint32_t dimensionRange, std::string nnapiLogPath, in RandomGraphGenerator() 147 std::string failedModelDumpPath) in RandomGraphGenerator() 183 std::optional<test_helper::TestModel> testModel = in runRandomModel() [all …]
|
/test/vts-testcase/security/avb/ |
D | VtsSecurityAvbTest.cpp | 62 static bool HexToBytes(const std::string &hex, std::vector<uint8_t> *bytes) { in HexToBytes() 136 static std::unique_ptr<ShaHasher> CreateShaHasher( in CreateShaHasher() 137 const std::string &algorithm) { in CreateShaHasher() 139 return std::make_unique<ShaHasherImpl<SHA_CTX>>( in CreateShaHasher() 143 return std::make_unique<ShaHasherImpl<SHA256_CTX>>( in CreateShaHasher() 147 return std::make_unique<ShaHasherImpl<SHA512_CTX>>( in CreateShaHasher() 157 const std::vector<uint8_t> buffer(size, 0); in CalculateZeroDigest() 199 std::vector<uint8_t> calculating_hash_block; 222 static std::string VerifyHashtree(int image_fd, uint64_t image_size, in VerifyHashtree() 223 const std::vector<uint8_t> &salt, in VerifyHashtree() [all …]
|
/test/mlts/benchmark/native/ |
D | multi_process_test.cpp | 68 std::string modelFileName(path); in canReadInputFile() 69 std::ifstream fstream(modelFileName); in canReadInputFile() 70 std::stringstream readBuffer; in canReadInputFile() 75 bool readInputData(const char* inputDataFileName, std::vector<int> input_shape, in readInputData() 77 std::vector<InferenceInOutSequence>* result) { in readInputData() 79 std::for_each( in readInputData() 84 std::ifstream dataFile; in readInputData() 90 std::function<bool(uint8_t*, size_t)> failToGenerateData = in readInputData() 93 std::unique_ptr<uint8_t[]> dataBuffer = in readInputData() 94 std::make_unique<uint8_t[]>(inputDataSizeBytes); in readInputData() [all …]
|
/test/vts-testcase/kernel/bow/ |
D | BowTest.cpp | 68 template <void (*Prepare)(std::string)> 79 loop_device_ = std::string("/dev/block/loop") + std::to_string(i); in SetUp() 96 const static std::string loop_file_; 101 std::string loop_device_; 104 template <void (*Prepare)(std::string)> 105 const std::string LoopbackTestFixture<Prepare>::loop_file_ = 108 void PrepareBowDefault(std::string) {} in PrepareBowDefault() 110 template <void (*PrepareLoop)(std::string), 111 void (*PrepareBow)(std::string) = PrepareBowDefault> 113 std::string GetTableStatus() { in GetTableStatus() [all …]
|
/test/vts-testcase/hal/treble/vintf/ |
D | VtsTrebleVintfTestBase.cpp | 74 using std::cout; 75 using std::endl; 76 using std::map; 77 using std::set; 78 using std::string; 79 using std::vector; 97 const std::string instance_name = manifest_instance.instance(); in ForEachHidlHalInstance() 100 std::async([&]() { fn(fq_name, instance_name, transport); }); in ForEachHidlHalInstance() 101 auto timeout = std::chrono::seconds(1); in ForEachHidlHalInstance() 102 std::future_status status = future_result.wait_for(timeout); in ForEachHidlHalInstance() [all …]
|
D | utils.h | 57 using std::cout; 58 using std::endl; 59 using std::map; 60 using std::multimap; 61 using std::optional; 62 using std::set; 63 using std::string; 65 using std::vector; 67 using HidlVerifyFn = std::function<void( 70 std::function<void(const std::string& package, uint64_t version, [all …]
|
D | SingleManifestTest.cpp | 52 void FailureHalMissing(const FQName &fq_name, const std::string &instance) { in FailureHalMissing() 84 static string RangeInstancesToString(const std::pair<It, It> &range) { in RangeInstancesToString() 85 std::stringstream ss; in RangeInstancesToString() 95 std::stringstream ss; in InstancesToString() 172 static bool IsApexUpdated(const std::string &apex_name) { in IsApexUpdated() 178 std::vector<ApexInfo> list; in IsApexUpdated() 202 instances.emplace(transport, std::move(fqInstance)); in TEST_P() 210 << static_cast<std::underlying_type_t<Transport>>(it->first) << ")" in TEST_P() 217 std::transform( in TEST_P() 219 std::inserter(passthrough_declared, passthrough_declared.begin()), in TEST_P() [all …]
|
/test/vts-testcase/hal/thermal/V1_0/target_stress/ |
D | thermal_hidl_stress_test.cpp | 49 inline std::cv_status wait() { in wait() 50 std::unique_lock<std::mutex> lock(mtx_); in wait() 52 std::cv_status status = std::cv_status::no_timeout; in wait() 53 auto now = std::chrono::system_clock::now(); in wait() 55 status = cv_.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD)); in wait() 56 if (status == std::cv_status::timeout) return status; in wait() 64 std::mutex mtx_; 65 std::condition_variable cv_; 76 std::unique_lock<std::mutex> lock(mtx_); in TEST_F() 80 EXPECT_EQ(std::cv_status::no_timeout, wait()); in TEST_F() [all …]
|
/test/vts-testcase/kernel/loop/ |
D | vts_kernel_loopconfig_test.cpp | 34 : first_api_level_(std::stoi( in KernelLoopConfigTest() 47 std::array<char, 256> line; in TEST_F() 49 std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(kCmd, "r"), pclose); in TEST_F() 55 auto minCountStr = std::string(read); in TEST_F() 58 ASSERT_NE(pos, std::string::npos); in TEST_F() 61 int minCountValue = std::stoi(minCountStr.substr(pos + 1)); in TEST_F() 68 std::ifstream max_loop("/sys/module/loop/parameters/max_loop"); in TEST_F() 69 std::ifstream max_part("/sys/module/loop/parameters/max_part"); in TEST_F() 71 std::string max_loop_str; in TEST_F() 72 std::string max_part_str; in TEST_F() [all …]
|
/test/vts-testcase/fuzz/iface_fuzzer/ |
D | ProtoFuzzerMutator.cpp | 20 using std::cerr; 21 using std::cout; 22 using std::endl; 23 using std::make_unique; 24 using std::unordered_map; 25 using namespace std::placeholders; 47 std::bind(&ProtoFuzzerMutator::ArrayRandomGen, this, _1); in ProtoFuzzerMutator() 49 std::bind(&ProtoFuzzerMutator::ArrayMutate, this, _1); in ProtoFuzzerMutator() 52 std::bind(&ProtoFuzzerMutator::EnumRandomGen, this, _1); in ProtoFuzzerMutator() 53 mutate_fns_[TYPE_ENUM] = std::bind(&ProtoFuzzerMutator::EnumMutate, this, _1); in ProtoFuzzerMutator() [all …]
|
D | ProtoFuzzerStats.cpp | 24 using std::endl; 25 using std::map; 26 using std::string; 27 using std::unordered_map; 38 touched_ifaces_.insert(std::move(iface_name)); in RegisterTouch() 42 std::map<string, uint64_t> ordered_result{touch_count_.cbegin(), in StatsString() 45 std::stringstream ss{}; in StatsString() 48 ss << std::left << std::setfill(' ') << std::setw(40) << entry.first in StatsString() 49 << std::setw(40) << entry.second << endl; in StatsString()
|
/test/vts/runners/target/gtest/ |
D | gtest_main.cpp | 104 static int GetDeadlineInfo(const std::string& /*test_name*/) { in GetDeadlineInfo() 109 static int GetWarnlineInfo(const std::string& /*test_name*/) { in GetWarnlineInfo() 149 const std::string& GetName() const { return name_; } in GetName() 161 void AppendTestOutput(const std::string& s) { output_ += s; } in AppendTestOutput() 163 const std::string& GetTestOutput() const { return output_; } in GetTestOutput() 166 const std::string name_; 169 std::string output_; 177 const std::string& GetName() const { return name_; } in GetName() 185 std::string GetTestName(size_t test_id) const { in GetTestName() 230 const std::string name_; [all …]
|
/test/vts-testcase/kernel/gki/ |
D | cpio.cpp | 34 std::vector<char*> ToCStringArray(std::vector<std::string>* args) { in ToCStringArray() 35 std::vector<char*> ret; in ToCStringArray() 46 android::base::Result<void> Exec(std::vector<std::string>* args, in Exec() 47 std::string_view working_directory) { in Exec() 80 android::base::Result<std::unique_ptr<TemporaryDir>> CpioExtract( in CpioExtract() 81 std::string_view archive_path) { in CpioExtract() 82 std::vector<std::string> args{"cpio", "-i", "-F", archive_path.data()}; in CpioExtract() 84 auto extracted_ramdisk = std::make_unique<TemporaryDir>(); in CpioExtract()
|
D | generic_boot_image_test.cpp | 44 std::shared_ptr<const RuntimeInfo> runtime_info; 56 const std::string& release = runtime_info->osRelease(); in TEST_F() 75 using std::filesystem::recursive_directory_iterator; in TEST_F() 77 std::string slot_suffix = GetProperty("ro.boot.slot_suffix", ""); in TEST_F() 78 std::string boot_path = "/dev/block/by-name/boot" + slot_suffix; in TEST_F() 87 std::set<std::string> actual_files; in TEST_F() 88 std::filesystem::path extracted_ramdisk_path((*extracted_ramdisk)->path); in TEST_F() 97 std::set<std::string> generic_ramdisk_allowlist{ in TEST_F() 104 std::set<std::string> debuggable_allowlist{ in TEST_F()
|
/test/vts-testcase/fuzz/iface_fuzzer/include/ |
D | ProtoFuzzerMutator.h | 32 using BiasedRandomScalarGen = std::function<uint64_t(Random &rand)>; 33 using Odds = std::pair<uint64_t, uint64_t>; 34 using VarMutateFn = std::function<VarInstance(const VarInstance &)>; 35 using VarRandomGenFn = std::function<VarInstance(const VarSpec &)>; 36 using VarTransformFn = std::function<VariableSpecificationMessage( 56 ProtoFuzzerMutator(Random &, std::unordered_map<std::string, TypeSpec>, 92 ScalarData RandomGen(const ScalarData &, const std::string &); 108 const TypeSpec &FindPredefinedType(std::string); 113 std::unordered_map<std::string, TypeSpec> predefined_types_; 117 std::unordered_map<VariableType, VarMutateFn> mutate_fns_; [all …]
|