RDK Documentation (Open Sourced RDK Components)
ionMemoryMocks.h
1 /*
2  * If not stated otherwise in this file or this component's license file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2022 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef AAMP_ION_MOCKS_H
21 #define AAMP_ION_MOCKS_H
22 
23 #include <stddef.h>
24 #include <sys/types.h>
25 #include <gmock/gmock.h>
26 
27 #define __BEGIN_DECLS extern "C" {
28 #define __END_DECLS }
29 
30 #include <ion/ion.h>
31 
33 {
34  public:
35  MOCK_METHOD(int, ion_open, ());
36  MOCK_METHOD(int, ion_close, (int fd));
37  MOCK_METHOD(int, ion_alloc, (int fd, size_t len, size_t align, unsigned int heap_mask, unsigned int flags, ion_user_handle_t *handle));
38  MOCK_METHOD(int, ion_free, (int fd, ion_user_handle_t handle));
39  MOCK_METHOD(int, ion_share, (int fd, ion_user_handle_t handle, int *share_fd));
40  MOCK_METHOD(int, ion_phys, (int fd, ion_user_handle_t handle, unsigned long *addr, unsigned int *size));
41 };
42 
43 extern AampMockIon *g_mockIon;
44 
45 #endif /* AAMP_ION_MOCKS_H */
AampMockIon
Definition: ionMemoryMocks.h:32