blob: 156f7a410273ecf6d439a1e1371948b7c19066ee [file] [log] [blame]
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include "libusb.hpp"
#include <gmock/gmock.h>
namespace google
{
namespace hoth
{
class LibusbMock : public LibusbIntf
{
public:
MOCK_METHOD2(release_interface, int(libusb_device_handle*, int));
MOCK_METHOD2(claim_interface, int(libusb_device_handle*, int));
MOCK_METHOD6(bulk_transfer, int(libusb_device_handle*, unsigned char,
unsigned char*, int, int*, unsigned int));
MOCK_METHOD1(close, void(libusb_device_handle*));
MOCK_METHOD2(get_active_config_descriptor,
int(libusb_device*, libusb_config_descriptor**));
MOCK_METHOD1(get_bus_number, int(libusb_device*));
MOCK_METHOD3(get_port_numbers, int(libusb_device*, uint8_t*, int));
MOCK_METHOD2(open, int(libusb_device*, libusb_device_handle**));
MOCK_METHOD1(ref_device, libusb_device*(libusb_device*));
MOCK_METHOD1(unref_device, void(libusb_device*));
MOCK_METHOD2(get_device_list, ssize_t(libusb_context*, libusb_device***));
MOCK_METHOD2(free_device_list, void(libusb_device**, int));
MOCK_METHOD1(exit, void(libusb_context* ctx));
MOCK_METHOD1(init, int(libusb_context** ctx));
};
} // namespace hoth
} // namespace google