1 #include "android/hardware/tests/msgq/1.0/TestMsgQ.vts.h"
2 #include "vts_measurement.h"
3 #include <android-base/logging.h>
4 #include <android/hidl/allocator/1.0/IAllocator.h>
5 #include <fcntl.h>
6 #include <fmq/MessageQueue.h>
7 #include <sys/stat.h>
8 #include <unistd.h>
9 
10 
11 using namespace android::hardware::tests::msgq::V1_0;
12 namespace android {
13 namespace vts {
MessageTo__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(const VariableSpecificationMessage & var_msg,::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits * arg,const string & callback_socket_name)14 extern "C" void MessageTo__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(const VariableSpecificationMessage& var_msg __attribute__((__unused__)), ::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits* arg __attribute__((__unused__)), const string& callback_socket_name __attribute__((__unused__))) {
15     *arg = (::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits)var_msg.scalar_value().uint32_t();
16 }
Random__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits()17 uint32_t Random__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits() {
18     uint32_t choice = (uint32_t) rand() / 2;
19     if (choice == (uint32_t) 1UL) return static_cast<uint32_t>(::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits::FMQ_NOT_EMPTY);
20     if (choice == (uint32_t) 2UL) return static_cast<uint32_t>(::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits::FMQ_NOT_FULL);
21     return static_cast<uint32_t>(::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits::FMQ_NOT_EMPTY);
22 }
Verify__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(const VariableSpecificationMessage & expected_result,const VariableSpecificationMessage & actual_result)23 bool Verify__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(const VariableSpecificationMessage& expected_result __attribute__((__unused__)), const VariableSpecificationMessage& actual_result __attribute__((__unused__))){
24     if (actual_result.scalar_value().uint32_t() != expected_result.scalar_value().uint32_t()) { return false; }
25     return true;
26 }
27 
SetResult__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(VariableSpecificationMessage * result_msg,::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits result_value)28 extern "C" void SetResult__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(VariableSpecificationMessage* result_msg, ::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits result_value __attribute__((__unused__))){
29     result_msg->set_type(TYPE_ENUM);
30     result_msg->set_scalar_type("uint32_t");
31     result_msg->mutable_scalar_value()->set_uint32_t(static_cast<uint32_t>(result_value));
32 }
33 
GetService(bool get_stub,const char * service_name)34 bool FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ::GetService(bool get_stub, const char* service_name) {
35     static bool initialized = false;
36     if (!initialized) {
37         LOG(INFO) << "HIDL getService";
38         if (service_name) {
39           LOG(INFO) << "  - service name: " << service_name;
40         }
41         hw_binder_proxy_ = ::android::hardware::tests::msgq::V1_0::ITestMsgQ::getService(service_name, get_stub);
42         if (hw_binder_proxy_ == nullptr) {
43             LOG(ERROR) << "getService() returned a null pointer.";
44             return false;
45         }
46         LOG(DEBUG) << "hw_binder_proxy_ = " << hw_binder_proxy_.get();
47         initialized = true;
48     }
49     return true;
50 }
51 
52 
configureFmqSyncReadWrite(const::android::hardware::MQDescriptorSync<uint16_t> & arg0)53 ::android::hardware::Return<bool> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::configureFmqSyncReadWrite(
54     const ::android::hardware::MQDescriptorSync<uint16_t>& arg0 __attribute__((__unused__))) {
55     LOG(INFO) << "configureFmqSyncReadWrite called";
56     AndroidSystemCallbackRequestMessage callback_message;
57     callback_message.set_id(GetCallbackID("configureFmqSyncReadWrite"));
58     callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::configureFmqSyncReadWrite");
59     VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
60     var_msg0->set_type(TYPE_FMQ_SYNC);
61     VariableSpecificationMessage* var_msg0_item = var_msg0->add_fmq_value();
62     var_msg0_item->set_type(TYPE_SCALAR);
63     var_msg0_item->set_scalar_type("uint16_t");
64     var_msg0_item->set_fmq_desc_address(reinterpret_cast<size_t>(new (std::nothrow) ::android::hardware::MQDescriptorSync<uint16_t>(arg0)));
65     RpcCallToAgent(callback_message, callback_socket_name_);
66     return static_cast<bool>(0);
67 }
68 
getFmqUnsyncWrite(bool arg0,std::function<void (bool arg0,const::android::hardware::MQDescriptorUnsync<uint16_t> & arg1)> cb)69 ::android::hardware::Return<void> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::getFmqUnsyncWrite(
70     bool arg0 __attribute__((__unused__)), std::function<void(bool arg0,const ::android::hardware::MQDescriptorUnsync<uint16_t>& arg1)> cb) {
71     LOG(INFO) << "getFmqUnsyncWrite called";
72     AndroidSystemCallbackRequestMessage callback_message;
73     callback_message.set_id(GetCallbackID("getFmqUnsyncWrite"));
74     callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::getFmqUnsyncWrite");
75     VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
76     var_msg0->set_type(TYPE_SCALAR);
77     var_msg0->set_scalar_type("bool_t");
78     var_msg0->mutable_scalar_value()->set_bool_t(arg0);
79     RpcCallToAgent(callback_message, callback_socket_name_);
80     cb(static_cast<bool>(0), ::android::hardware::MQDescriptorUnsync<uint16_t>());
81     return ::android::hardware::Void();
82 }
83 
requestWriteFmqSync(int32_t arg0)84 ::android::hardware::Return<bool> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestWriteFmqSync(
85     int32_t arg0 __attribute__((__unused__))) {
86     LOG(INFO) << "requestWriteFmqSync called";
87     AndroidSystemCallbackRequestMessage callback_message;
88     callback_message.set_id(GetCallbackID("requestWriteFmqSync"));
89     callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestWriteFmqSync");
90     VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
91     var_msg0->set_type(TYPE_SCALAR);
92     var_msg0->set_scalar_type("int32_t");
93     var_msg0->mutable_scalar_value()->set_int32_t(arg0);
94     RpcCallToAgent(callback_message, callback_socket_name_);
95     return static_cast<bool>(0);
96 }
97 
requestReadFmqSync(int32_t arg0)98 ::android::hardware::Return<bool> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestReadFmqSync(
99     int32_t arg0 __attribute__((__unused__))) {
100     LOG(INFO) << "requestReadFmqSync called";
101     AndroidSystemCallbackRequestMessage callback_message;
102     callback_message.set_id(GetCallbackID("requestReadFmqSync"));
103     callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestReadFmqSync");
104     VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
105     var_msg0->set_type(TYPE_SCALAR);
106     var_msg0->set_scalar_type("int32_t");
107     var_msg0->mutable_scalar_value()->set_int32_t(arg0);
108     RpcCallToAgent(callback_message, callback_socket_name_);
109     return static_cast<bool>(0);
110 }
111 
requestWriteFmqUnsync(int32_t arg0)112 ::android::hardware::Return<bool> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestWriteFmqUnsync(
113     int32_t arg0 __attribute__((__unused__))) {
114     LOG(INFO) << "requestWriteFmqUnsync called";
115     AndroidSystemCallbackRequestMessage callback_message;
116     callback_message.set_id(GetCallbackID("requestWriteFmqUnsync"));
117     callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestWriteFmqUnsync");
118     VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
119     var_msg0->set_type(TYPE_SCALAR);
120     var_msg0->set_scalar_type("int32_t");
121     var_msg0->mutable_scalar_value()->set_int32_t(arg0);
122     RpcCallToAgent(callback_message, callback_socket_name_);
123     return static_cast<bool>(0);
124 }
125 
requestReadFmqUnsync(int32_t arg0)126 ::android::hardware::Return<bool> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestReadFmqUnsync(
127     int32_t arg0 __attribute__((__unused__))) {
128     LOG(INFO) << "requestReadFmqUnsync called";
129     AndroidSystemCallbackRequestMessage callback_message;
130     callback_message.set_id(GetCallbackID("requestReadFmqUnsync"));
131     callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestReadFmqUnsync");
132     VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
133     var_msg0->set_type(TYPE_SCALAR);
134     var_msg0->set_scalar_type("int32_t");
135     var_msg0->mutable_scalar_value()->set_int32_t(arg0);
136     RpcCallToAgent(callback_message, callback_socket_name_);
137     return static_cast<bool>(0);
138 }
139 
requestBlockingRead(int32_t arg0)140 ::android::hardware::Return<void> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestBlockingRead(
141     int32_t arg0 __attribute__((__unused__))) {
142     LOG(INFO) << "requestBlockingRead called";
143     AndroidSystemCallbackRequestMessage callback_message;
144     callback_message.set_id(GetCallbackID("requestBlockingRead"));
145     callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestBlockingRead");
146     VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
147     var_msg0->set_type(TYPE_SCALAR);
148     var_msg0->set_scalar_type("int32_t");
149     var_msg0->mutable_scalar_value()->set_int32_t(arg0);
150     RpcCallToAgent(callback_message, callback_socket_name_);
151     return ::android::hardware::Void();
152 }
153 
requestBlockingReadDefaultEventFlagBits(int32_t arg0)154 ::android::hardware::Return<void> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestBlockingReadDefaultEventFlagBits(
155     int32_t arg0 __attribute__((__unused__))) {
156     LOG(INFO) << "requestBlockingReadDefaultEventFlagBits called";
157     AndroidSystemCallbackRequestMessage callback_message;
158     callback_message.set_id(GetCallbackID("requestBlockingReadDefaultEventFlagBits"));
159     callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestBlockingReadDefaultEventFlagBits");
160     VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
161     var_msg0->set_type(TYPE_SCALAR);
162     var_msg0->set_scalar_type("int32_t");
163     var_msg0->mutable_scalar_value()->set_int32_t(arg0);
164     RpcCallToAgent(callback_message, callback_socket_name_);
165     return ::android::hardware::Void();
166 }
167 
requestBlockingReadRepeat(int32_t arg0,int32_t arg1)168 ::android::hardware::Return<void> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestBlockingReadRepeat(
169     int32_t arg0 __attribute__((__unused__)),
170     int32_t arg1 __attribute__((__unused__))) {
171     LOG(INFO) << "requestBlockingReadRepeat called";
172     AndroidSystemCallbackRequestMessage callback_message;
173     callback_message.set_id(GetCallbackID("requestBlockingReadRepeat"));
174     callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestBlockingReadRepeat");
175     VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
176     var_msg0->set_type(TYPE_SCALAR);
177     var_msg0->set_scalar_type("int32_t");
178     var_msg0->mutable_scalar_value()->set_int32_t(arg0);
179     VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
180     var_msg1->set_type(TYPE_SCALAR);
181     var_msg1->set_scalar_type("int32_t");
182     var_msg1->mutable_scalar_value()->set_int32_t(arg1);
183     RpcCallToAgent(callback_message, callback_socket_name_);
184     return ::android::hardware::Void();
185 }
186 
VtsFuzzerCreateVts_android_hardware_tests_msgq_V1_0_ITestMsgQ(const string & callback_socket_name)187 sp<::android::hardware::tests::msgq::V1_0::ITestMsgQ> VtsFuzzerCreateVts_android_hardware_tests_msgq_V1_0_ITestMsgQ(const string& callback_socket_name) {
188     static sp<::android::hardware::tests::msgq::V1_0::ITestMsgQ> result;
189     result = new Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ(callback_socket_name);
190     return result;
191 }
192 
Fuzz(FunctionSpecificationMessage *,void **,const string &)193 bool FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ::Fuzz(
194     FunctionSpecificationMessage* /*func_msg*/,
195     void** /*result*/, const string& /*callback_socket_name*/) {
196     return true;
197 }
GetAttribute(FunctionSpecificationMessage *,void **)198 bool FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ::GetAttribute(
199     FunctionSpecificationMessage* /*func_msg*/,
200     void** /*result*/) {
201     LOG(ERROR) << "attribute not found.";
202     return false;
203 }
CallFunction(const FunctionSpecificationMessage & func_msg,const string & callback_socket_name,FunctionSpecificationMessage * result_msg)204 bool FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ::CallFunction(
205     const FunctionSpecificationMessage& func_msg,
206     const string& callback_socket_name __attribute__((__unused__)),
207     FunctionSpecificationMessage* result_msg) {
208     const char* func_name = func_msg.name().c_str();
209     if (hw_binder_proxy_ == nullptr) {
210         LOG(ERROR) << "hw_binder_proxy_ is null. ";
211         return false;
212     }
213     if (!strcmp(func_name, "configureFmqSyncReadWrite")) {
214         const ::android::hardware::MQDescriptorSync<uint16_t>* arg0;
215         if (func_msg.arg(0).fmq_value_size() > 0 && func_msg.arg(0).fmq_value(0).has_fmq_desc_address()) {
216             arg0 = reinterpret_cast<::android::hardware::MQDescriptorSync<uint16_t>*>(func_msg.arg(0).fmq_value(0).fmq_desc_address());
217         } else {
218             ::android::hardware::MessageQueue<uint16_t, ::android::hardware::kSynchronizedReadWrite> arg0_sync_q(1024);
219             for (int i = 0; i < (int)func_msg.arg(0).fmq_value_size(); i++) {
220                 uint16_t arg0_sync_q_item;
221                 arg0_sync_q_item = func_msg.arg(0).fmq_value(i).scalar_value().uint16_t();
222                 arg0_sync_q.write(&arg0_sync_q_item);
223             }
224             arg0 = arg0_sync_q.getDesc();
225         }
226         LOG(DEBUG) << "local_device = " << hw_binder_proxy_.get();
227         bool result0 = hw_binder_proxy_->configureFmqSyncReadWrite(*arg0);
228         result_msg->set_name("configureFmqSyncReadWrite");
229         VariableSpecificationMessage* result_val_0 = result_msg->add_return_type_hidl();
230         result_val_0->set_type(TYPE_SCALAR);
231         result_val_0->set_scalar_type("bool_t");
232         result_val_0->mutable_scalar_value()->set_bool_t(result0);
233         return true;
234     }
235     if (!strcmp(func_name, "getFmqUnsyncWrite")) {
236         bool arg0 = 0;
237         arg0 = func_msg.arg(0).scalar_value().bool_t();
238         LOG(DEBUG) << "local_device = " << hw_binder_proxy_.get();
239         hw_binder_proxy_->getFmqUnsyncWrite(arg0, [&](bool arg0 __attribute__((__unused__)),const ::android::hardware::MQDescriptorUnsync<uint16_t>& arg1 __attribute__((__unused__))){
240             LOG(INFO) << "callback getFmqUnsyncWrite called";
241             result_msg->set_name("getFmqUnsyncWrite");
242             VariableSpecificationMessage* result_val_0 = result_msg->add_return_type_hidl();
243             result_val_0->set_type(TYPE_SCALAR);
244             result_val_0->set_scalar_type("bool_t");
245             result_val_0->mutable_scalar_value()->set_bool_t(arg0);
246             VariableSpecificationMessage* result_val_1 = result_msg->add_return_type_hidl();
247             result_val_1->set_type(TYPE_FMQ_UNSYNC);
248             VariableSpecificationMessage* result_val_1_item = result_val_1->add_fmq_value();
249             result_val_1_item->set_type(TYPE_SCALAR);
250             result_val_1_item->set_scalar_type("uint16_t");
251             result_val_1_item->set_fmq_desc_address(reinterpret_cast<size_t>(new (std::nothrow) ::android::hardware::MQDescriptorUnsync<uint16_t>(arg1)));
252         });
253         return true;
254     }
255     if (!strcmp(func_name, "requestWriteFmqSync")) {
256         int32_t arg0 = 0;
257         arg0 = func_msg.arg(0).scalar_value().int32_t();
258         LOG(DEBUG) << "local_device = " << hw_binder_proxy_.get();
259         bool result0 = hw_binder_proxy_->requestWriteFmqSync(arg0);
260         result_msg->set_name("requestWriteFmqSync");
261         VariableSpecificationMessage* result_val_0 = result_msg->add_return_type_hidl();
262         result_val_0->set_type(TYPE_SCALAR);
263         result_val_0->set_scalar_type("bool_t");
264         result_val_0->mutable_scalar_value()->set_bool_t(result0);
265         return true;
266     }
267     if (!strcmp(func_name, "requestReadFmqSync")) {
268         int32_t arg0 = 0;
269         arg0 = func_msg.arg(0).scalar_value().int32_t();
270         LOG(DEBUG) << "local_device = " << hw_binder_proxy_.get();
271         bool result0 = hw_binder_proxy_->requestReadFmqSync(arg0);
272         result_msg->set_name("requestReadFmqSync");
273         VariableSpecificationMessage* result_val_0 = result_msg->add_return_type_hidl();
274         result_val_0->set_type(TYPE_SCALAR);
275         result_val_0->set_scalar_type("bool_t");
276         result_val_0->mutable_scalar_value()->set_bool_t(result0);
277         return true;
278     }
279     if (!strcmp(func_name, "requestWriteFmqUnsync")) {
280         int32_t arg0 = 0;
281         arg0 = func_msg.arg(0).scalar_value().int32_t();
282         LOG(DEBUG) << "local_device = " << hw_binder_proxy_.get();
283         bool result0 = hw_binder_proxy_->requestWriteFmqUnsync(arg0);
284         result_msg->set_name("requestWriteFmqUnsync");
285         VariableSpecificationMessage* result_val_0 = result_msg->add_return_type_hidl();
286         result_val_0->set_type(TYPE_SCALAR);
287         result_val_0->set_scalar_type("bool_t");
288         result_val_0->mutable_scalar_value()->set_bool_t(result0);
289         return true;
290     }
291     if (!strcmp(func_name, "requestReadFmqUnsync")) {
292         int32_t arg0 = 0;
293         arg0 = func_msg.arg(0).scalar_value().int32_t();
294         LOG(DEBUG) << "local_device = " << hw_binder_proxy_.get();
295         bool result0 = hw_binder_proxy_->requestReadFmqUnsync(arg0);
296         result_msg->set_name("requestReadFmqUnsync");
297         VariableSpecificationMessage* result_val_0 = result_msg->add_return_type_hidl();
298         result_val_0->set_type(TYPE_SCALAR);
299         result_val_0->set_scalar_type("bool_t");
300         result_val_0->mutable_scalar_value()->set_bool_t(result0);
301         return true;
302     }
303     if (!strcmp(func_name, "requestBlockingRead")) {
304         int32_t arg0 = 0;
305         arg0 = func_msg.arg(0).scalar_value().int32_t();
306         LOG(DEBUG) << "local_device = " << hw_binder_proxy_.get();
307         hw_binder_proxy_->requestBlockingRead(arg0);
308         result_msg->set_name("requestBlockingRead");
309         return true;
310     }
311     if (!strcmp(func_name, "requestBlockingReadDefaultEventFlagBits")) {
312         int32_t arg0 = 0;
313         arg0 = func_msg.arg(0).scalar_value().int32_t();
314         LOG(DEBUG) << "local_device = " << hw_binder_proxy_.get();
315         hw_binder_proxy_->requestBlockingReadDefaultEventFlagBits(arg0);
316         result_msg->set_name("requestBlockingReadDefaultEventFlagBits");
317         return true;
318     }
319     if (!strcmp(func_name, "requestBlockingReadRepeat")) {
320         int32_t arg0 = 0;
321         arg0 = func_msg.arg(0).scalar_value().int32_t();
322         int32_t arg1 = 0;
323         arg1 = func_msg.arg(1).scalar_value().int32_t();
324         LOG(DEBUG) << "local_device = " << hw_binder_proxy_.get();
325         hw_binder_proxy_->requestBlockingReadRepeat(arg0, arg1);
326         result_msg->set_name("requestBlockingReadRepeat");
327         return true;
328     }
329     if (!strcmp(func_name, "notifySyspropsChanged")) {
330         LOG(INFO) << "Call notifySyspropsChanged";
331         hw_binder_proxy_->notifySyspropsChanged();
332         result_msg->set_name("notifySyspropsChanged");
333         return true;
334     }
335     return false;
336 }
337 
VerifyResults(const FunctionSpecificationMessage & expected_result,const FunctionSpecificationMessage & actual_result)338 bool FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ::VerifyResults(const FunctionSpecificationMessage& expected_result __attribute__((__unused__)),
339     const FunctionSpecificationMessage& actual_result __attribute__((__unused__))) {
340     if (!strcmp(actual_result.name().c_str(), "configureFmqSyncReadWrite")) {
341         if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
342         if (actual_result.return_type_hidl(0).scalar_value().bool_t() != expected_result.return_type_hidl(0).scalar_value().bool_t()) { return false; }
343         return true;
344     }
345     if (!strcmp(actual_result.name().c_str(), "getFmqUnsyncWrite")) {
346         if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
347         if (actual_result.return_type_hidl(0).scalar_value().bool_t() != expected_result.return_type_hidl(0).scalar_value().bool_t()) { return false; }
348         LOG(ERROR) << "TYPE_FMQ_UNSYNC is not supported yet. ";
349         return true;
350     }
351     if (!strcmp(actual_result.name().c_str(), "requestWriteFmqSync")) {
352         if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
353         if (actual_result.return_type_hidl(0).scalar_value().bool_t() != expected_result.return_type_hidl(0).scalar_value().bool_t()) { return false; }
354         return true;
355     }
356     if (!strcmp(actual_result.name().c_str(), "requestReadFmqSync")) {
357         if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
358         if (actual_result.return_type_hidl(0).scalar_value().bool_t() != expected_result.return_type_hidl(0).scalar_value().bool_t()) { return false; }
359         return true;
360     }
361     if (!strcmp(actual_result.name().c_str(), "requestWriteFmqUnsync")) {
362         if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
363         if (actual_result.return_type_hidl(0).scalar_value().bool_t() != expected_result.return_type_hidl(0).scalar_value().bool_t()) { return false; }
364         return true;
365     }
366     if (!strcmp(actual_result.name().c_str(), "requestReadFmqUnsync")) {
367         if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
368         if (actual_result.return_type_hidl(0).scalar_value().bool_t() != expected_result.return_type_hidl(0).scalar_value().bool_t()) { return false; }
369         return true;
370     }
371     if (!strcmp(actual_result.name().c_str(), "requestBlockingRead")) {
372         if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
373         return true;
374     }
375     if (!strcmp(actual_result.name().c_str(), "requestBlockingReadDefaultEventFlagBits")) {
376         if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
377         return true;
378     }
379     if (!strcmp(actual_result.name().c_str(), "requestBlockingReadRepeat")) {
380         if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
381         return true;
382     }
383     return false;
384 }
385 
386 extern "C" {
vts_func_4_android_hardware_tests_msgq_V1_0_ITestMsgQ_()387 android::vts::DriverBase* vts_func_4_android_hardware_tests_msgq_V1_0_ITestMsgQ_() {
388     return (android::vts::DriverBase*) new android::vts::FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ();
389 }
390 
vts_func_4_android_hardware_tests_msgq_V1_0_ITestMsgQ_with_arg(uint64_t hw_binder_proxy)391 android::vts::DriverBase* vts_func_4_android_hardware_tests_msgq_V1_0_ITestMsgQ_with_arg(uint64_t hw_binder_proxy) {
392     ::android::hardware::tests::msgq::V1_0::ITestMsgQ* arg = nullptr;
393     if (hw_binder_proxy) {
394         arg = reinterpret_cast<::android::hardware::tests::msgq::V1_0::ITestMsgQ*>(hw_binder_proxy);
395     } else {
396         LOG(INFO) << " Creating DriverBase with null proxy.";
397     }
398     android::vts::DriverBase* result =
399         new android::vts::FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ(
400             arg);
401     if (arg != nullptr) {
402         arg->decStrong(arg);
403     }
404     return result;
405 }
406 
407 }
408 }  // namespace vts
409 }  // namespace android
410