1616do { \
1717 const char *func_name = "bt_bap_stream_ops.configured"; \
1818 \
19- zexpect_equal(1, mock_bap_stream_configured_cb_fake.call_count, \
20- "'%s()' was called %u times, but expected once", \
21- func_name, mock_bap_stream_configured_cb_fake.call_count); \
19+ zexpect_call_count(func_name, 1, mock_bap_stream_configured_cb_fake.call_count); \
2220 \
2321 if (mock_bap_stream_configured_cb_fake.call_count > 0) { \
2422 IF_NOT_EMPTY(_stream, ( \
@@ -36,17 +34,14 @@ static inline void expect_bt_bap_stream_ops_configured_not_called(void)
3634{
3735 const char * func_name = "bt_bap_stream_ops.configured" ;
3836
39- zexpect_equal (0 , mock_bap_stream_configured_cb_fake .call_count ,
40- "'%s()' was called unexpectedly" , func_name );
37+ zexpect_call_count (func_name , 0 , mock_bap_stream_configured_cb_fake .call_count );
4138}
4239
4340static inline void expect_bt_bap_stream_ops_qos_set_called_once (struct bt_bap_stream * stream )
4441{
4542 const char * func_name = "bt_bap_stream_ops.qos_set" ;
4643
47- zexpect_equal (1 , mock_bap_stream_qos_set_cb_fake .call_count ,
48- "'%s()' was called %u times, but expected once" ,
49- func_name , mock_bap_stream_qos_set_cb_fake .call_count );
44+ zexpect_call_count (func_name , 1 , mock_bap_stream_qos_set_cb_fake .call_count );
5045
5146 if (mock_bap_stream_qos_set_cb_fake .call_count > 0 ) {
5247 zexpect_equal_ptr (stream , mock_bap_stream_qos_set_cb_fake .arg0_val ,
@@ -58,17 +53,14 @@ static inline void expect_bt_bap_stream_ops_qos_set_not_called(void)
5853{
5954 const char * func_name = "bt_bap_stream_ops.qos_set" ;
6055
61- zexpect_equal (0 , mock_bap_stream_qos_set_cb_fake .call_count ,
62- "'%s()' was called unexpectedly" , func_name );
56+ zexpect_call_count (func_name , 0 , mock_bap_stream_qos_set_cb_fake .call_count );
6357}
6458
6559static inline void expect_bt_bap_stream_ops_enabled_called_once (struct bt_bap_stream * stream )
6660{
6761 const char * func_name = "bt_bap_stream_ops.enabled" ;
6862
69- zexpect_equal (1 , mock_bap_stream_enabled_cb_fake .call_count ,
70- "'%s()' was called %u times, but expected once" ,
71- func_name , mock_bap_stream_enabled_cb_fake .call_count );
63+ zexpect_call_count (func_name , 1 , mock_bap_stream_enabled_cb_fake .call_count );
7264
7365 if (mock_bap_stream_enabled_cb_fake .call_count > 0 ) {
7466 zexpect_equal_ptr (stream , mock_bap_stream_enabled_cb_fake .arg0_val ,
@@ -80,18 +72,15 @@ static inline void expect_bt_bap_stream_ops_enabled_not_called(void)
8072{
8173 const char * func_name = "bt_bap_stream_ops.enabled" ;
8274
83- zexpect_equal (0 , mock_bap_stream_enabled_cb_fake .call_count ,
84- "'%s()' was called unexpectedly" , func_name );
75+ zexpect_call_count (func_name , 0 , mock_bap_stream_enabled_cb_fake .call_count );
8576}
8677
8778static inline void expect_bt_bap_stream_ops_metadata_updated_called_once (
8879 struct bt_bap_stream * stream )
8980{
9081 const char * func_name = "bt_bap_stream_ops.metadata_updated" ;
9182
92- zexpect_equal (1 , mock_bap_stream_metadata_updated_cb_fake .call_count ,
93- "'%s()' was called %u times, but expected once" ,
94- func_name , mock_bap_stream_metadata_updated_cb_fake .call_count );
83+ zexpect_call_count (func_name , 1 , mock_bap_stream_metadata_updated_cb_fake .call_count );
9584
9685 if (mock_bap_stream_metadata_updated_cb_fake .call_count > 0 ) {
9786 zexpect_equal_ptr (stream , mock_bap_stream_metadata_updated_cb_fake .arg0_val ,
@@ -103,17 +92,14 @@ static inline void expect_bt_bap_stream_ops_metadata_updated_not_called(void)
10392{
10493 const char * func_name = "bt_bap_stream_ops.metadata_updated" ;
10594
106- zexpect_equal (0 , mock_bap_stream_metadata_updated_cb_fake .call_count ,
107- "'%s()' was called unexpectedly" , func_name );
95+ zexpect_call_count (func_name , 0 , mock_bap_stream_metadata_updated_cb_fake .call_count );
10896}
10997
11098static inline void expect_bt_bap_stream_ops_disabled_called_once (struct bt_bap_stream * stream )
11199{
112100 const char * func_name = "bt_bap_stream_ops.disabled" ;
113101
114- zexpect_equal (1 , mock_bap_stream_disabled_cb_fake .call_count ,
115- "'%s()' was called %u times, but expected once" ,
116- func_name , mock_bap_stream_disabled_cb_fake .call_count );
102+ zexpect_call_count (func_name , 1 , mock_bap_stream_disabled_cb_fake .call_count );
117103
118104 if (mock_bap_stream_disabled_cb_fake .call_count > 0 ) {
119105 zexpect_equal_ptr (stream , mock_bap_stream_disabled_cb_fake .arg0_val ,
@@ -125,18 +111,15 @@ static inline void expect_bt_bap_stream_ops_disabled_not_called(void)
125111{
126112 const char * func_name = "bt_bap_stream_ops.disabled" ;
127113
128- zexpect_equal (0 , mock_bap_stream_disabled_cb_fake .call_count ,
129- "'%s()' was called unexpectedly" , func_name );
114+ zexpect_call_count (func_name , 0 , mock_bap_stream_disabled_cb_fake .call_count );
130115}
131116
132117static inline void expect_bt_bap_stream_ops_released_called_twice (
133118 const struct bt_bap_stream * streams [2 ])
134119{
135120 const char * func_name = "bt_bap_stream_ops.released" ;
136121
137- zexpect_equal (2 , mock_bap_stream_released_cb_fake .call_count ,
138- "'%s()' was called %u times, but expected once" ,
139- func_name , mock_bap_stream_released_cb_fake .call_count );
122+ zexpect_call_count (func_name , 2 , mock_bap_stream_released_cb_fake .call_count );
140123
141124 if (mock_bap_stream_released_cb_fake .call_count > 0 ) {
142125 zexpect_equal_ptr (streams [0 ], mock_bap_stream_released_cb_fake .arg0_history [0 ],
@@ -153,9 +136,7 @@ static inline void expect_bt_bap_stream_ops_released_called_once(struct bt_bap_s
153136{
154137 const char * func_name = "bt_bap_stream_ops.released" ;
155138
156- zexpect_equal (1 , mock_bap_stream_released_cb_fake .call_count ,
157- "'%s()' was called %u times, but expected once" ,
158- func_name , mock_bap_stream_released_cb_fake .call_count );
139+ zexpect_call_count (func_name , 1 , mock_bap_stream_released_cb_fake .call_count );
159140
160141 if (mock_bap_stream_released_cb_fake .call_count > 0 ) {
161142 zexpect_equal_ptr (stream , mock_bap_stream_released_cb_fake .arg0_val ,
@@ -175,9 +156,7 @@ static inline void expect_bt_bap_stream_ops_started_called_once(struct bt_bap_st
175156{
176157 const char * func_name = "bt_bap_stream_ops.started" ;
177158
178- zexpect_equal (1 , mock_bap_stream_started_cb_fake .call_count ,
179- "'%s()' was called %u times, but expected once" ,
180- func_name , mock_bap_stream_started_cb_fake .call_count );
159+ zexpect_call_count (func_name , 1 , mock_bap_stream_started_cb_fake .call_count );
181160
182161 if (mock_bap_stream_started_cb_fake .call_count > 0 ) {
183162 zexpect_equal_ptr (stream , mock_bap_stream_started_cb_fake .arg0_val ,
@@ -189,17 +168,14 @@ static inline void expect_bt_bap_stream_ops_started_not_called(void)
189168{
190169 const char * func_name = "bt_bap_stream_ops.started" ;
191170
192- zexpect_equal (0 , mock_bap_stream_started_cb_fake .call_count ,
193- "'%s()' was called unexpectedly" , func_name );
171+ zexpect_call_count (func_name , 0 , mock_bap_stream_started_cb_fake .call_count );
194172}
195173
196174#define expect_bt_bap_stream_ops_stopped_called_once (_stream , _reason ) \
197175do { \
198176 const char *func_name = "bt_bap_stream_ops.stopped"; \
199177 \
200- zexpect_equal(1, mock_bap_stream_stopped_cb_fake.call_count, \
201- "'%s()' was called %u times, but expected once", \
202- func_name, mock_bap_stream_stopped_cb_fake.call_count); \
178+ zexpect_call_count(func_name, 1, mock_bap_stream_stopped_cb_fake.call_count); \
203179 \
204180 if (mock_bap_stream_stopped_cb_fake.call_count > 0) { \
205181 IF_NOT_EMPTY(_stream, ( \
@@ -218,8 +194,7 @@ static inline void expect_bt_bap_stream_ops_stopped_not_called(void)
218194{
219195 const char * func_name = "bt_bap_stream_ops.stopped" ;
220196
221- zexpect_equal (0 , mock_bap_stream_stopped_cb_fake .call_count ,
222- "'%s()' was called unexpectedly" , func_name );
197+ zexpect_call_count (func_name , 0 , mock_bap_stream_stopped_cb_fake .call_count );
223198}
224199
225200static inline void expect_bt_bap_stream_ops_recv_called_once (struct bt_bap_stream * stream ,
@@ -228,9 +203,7 @@ static inline void expect_bt_bap_stream_ops_recv_called_once(struct bt_bap_strea
228203{
229204 const char * func_name = "bt_bap_stream_ops.recv" ;
230205
231- zexpect_equal (1 , mock_bap_stream_recv_cb_fake .call_count ,
232- "'%s()' was called %u times, but expected once" ,
233- func_name , mock_bap_stream_recv_cb_fake .call_count );
206+ zexpect_call_count (func_name , 1 , mock_bap_stream_recv_cb_fake .call_count );
234207
235208 if (mock_bap_stream_recv_cb_fake .call_count > 0 ) {
236209 zexpect_equal_ptr (stream , mock_bap_stream_recv_cb_fake .arg0_val ,
@@ -244,17 +217,14 @@ static inline void expect_bt_bap_stream_ops_recv_not_called(void)
244217{
245218 const char * func_name = "bt_bap_stream_ops.recv" ;
246219
247- zexpect_equal (0 , mock_bap_stream_recv_cb_fake .call_count ,
248- "'%s()' was called unexpectedly" , func_name );
220+ zexpect_call_count (func_name , 0 , mock_bap_stream_recv_cb_fake .call_count );
249221}
250222
251223static inline void expect_bt_bap_stream_ops_sent_called_once (struct bt_bap_stream * stream )
252224{
253225 const char * func_name = "bt_bap_stream_ops.sent" ;
254226
255- zexpect_equal (1 , mock_bap_stream_sent_cb_fake .call_count ,
256- "'%s()' was called %u times, but expected once" ,
257- func_name , mock_bap_stream_sent_cb_fake .call_count );
227+ zexpect_call_count (func_name , 1 , mock_bap_stream_sent_cb_fake .call_count );
258228
259229 if (mock_bap_stream_sent_cb_fake .call_count > 0 ) {
260230 zexpect_equal_ptr (stream , mock_bap_stream_sent_cb_fake .arg0_val ,
@@ -266,8 +236,7 @@ static inline void expect_bt_bap_stream_ops_sent_not_called(void)
266236{
267237 const char * func_name = "bt_bap_stream_ops.sent" ;
268238
269- zexpect_equal (0 , mock_bap_stream_sent_cb_fake .call_count ,
270- "'%s()' was called unexpectedly" , func_name );
239+ zexpect_call_count (func_name , 0 , mock_bap_stream_sent_cb_fake .call_count );
271240}
272241
273242#endif /* MOCKS_BAP_STREAM_EXPECTS_H_ */
0 commit comments