Skip to content

Commit fdc4b23

Browse files
author
Dakshit Babbar
committed
Added a definition of the qpaque pointer MQTTVec_t for CMock
1 parent 0cf5b91 commit fdc4b23

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
7+
* this software and associated documentation files (the "Software"), to deal in
8+
* the Software without restriction, including without limitation the rights to
9+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10+
* the Software, and to permit persons to whom the Software is furnished to do so,
11+
* subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
*/
23+
24+
#ifndef CMOCK_OPAQUE_TYPES_H_
25+
#define CMOCK_OPAQUE_TYPES_H_
26+
27+
/* CMock does not support opaque types so needs concrete definitions for them.
28+
* This file is included in CMock .c files. */
29+
30+
struct MQTTVec
31+
{
32+
void * a;
33+
int b;
34+
};
35+
36+
#endif /* ifndef CMOCK_OPAQUE_TYPES_H_ */

tools/cmock/project.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
:includes: # This will add these includes to each mock.
2222
- <stdbool.h>
2323
- <stdint.h>
24+
:includes_c_post_header:
25+
- <cmock_opaque_types.h>
2426
:treat_externs: :exclude # Now the extern-ed functions will be mocked.
2527
:weak: __attribute__((weak))
2628
:treat_externs: :include

0 commit comments

Comments
 (0)