Pass args from the host when calling a HAL API and package the return
message
Change-Id: I2cae0d235431df8783013872d7c0cc91dcda6650
diff --git a/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp b/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp
index 2ca4eaa..5a7513f 100644
--- a/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp
+++ b/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp
@@ -37,14 +37,17 @@
FuzzerBase::~FuzzerBase() {}
-bool FuzzerBase::LoadTargetComponent(const char* target_dll_path) {
+bool FuzzerBase::LoadTargetComponent(
+ const char* target_dll_path, const char* module_name) {
+ cout << __FUNCTION__ << ":" << __LINE__ << " " << "LoadTargetCompooent entry" << endl;
target_dll_path_ = target_dll_path;
if (!target_loader_.Load(target_dll_path_)) return false;
- if (target_class_ != LEGACY_HAL) {
- return (device_ = target_loader_.GetHWDevice()) != NULL;
- } else {
- return true;
- }
+ cout << __FUNCTION__ << ":" << __LINE__ << " " << "LoadTargetCompooent loaded the target" << endl;
+ if (target_class_ == LEGACY_HAL) return true;
+ cout << __FUNCTION__ << ": loaded a non-legacy HAL file." << endl;
+ device_ = target_loader_.GetHWDevice(module_name);
+ cout << __FUNCTION__ << ": device_ " << device_ << endl;
+ return (device_ != NULL);
}
diff --git a/sysfuzzer/common/fuzz_tester/FuzzerBase.h b/sysfuzzer/common/fuzz_tester/FuzzerBase.h
index d92f4b2..77a33b1 100644
--- a/sysfuzzer/common/fuzz_tester/FuzzerBase.h
+++ b/sysfuzzer/common/fuzz_tester/FuzzerBase.h
@@ -34,7 +34,8 @@
// Loads a target component where the argument is the file path.
// Returns true iff successful.
- bool LoadTargetComponent(const char* target_dll_path);
+ bool LoadTargetComponent(const char* target_dll_path,
+ const char* module_name = NULL);
// Fuzz tests the loaded component using the provided interface specification.
// Returns true iff the testing is conducted completely.