• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

thetic / mutiny / 24299345226

12 Apr 2026 05:15AM UTC coverage: 98.145% (-0.8%) from 98.944%
24299345226

Pull #46

github

web-flow
Merge 8ec489b05 into 6bef603bd
Pull Request #46: Replace typed mock virtuals with template NVI

192 of 212 new or added lines in 9 files covered. (90.57%)

25 existing lines in 2 files now uncovered.

5503 of 5607 relevant lines covered (98.15%)

3448.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.23
/src/mock/NamedValue.cpp
1
#include "mutiny/mock/NamedValue.hpp"
2

3
#include "mutiny/mock/NamedValueComparatorsAndCopiersRepository.hpp"
4

5
#include "mutiny/test/Shell.hpp"
6

7
namespace mu {
8
namespace tiny {
9
namespace mock {
10

11
NamedValueComparatorsAndCopiersRepository* NamedValue::default_repository_ =
12
    nullptr;
13
const double NamedValue::default_double_tolerance = 0.005;
14

15
void NamedValue::set_default_comparators_and_copiers_repository(
2,182✔
16
    NamedValueComparatorsAndCopiersRepository* repository
17
)
18
{
19
  default_repository_ = repository;
2,182✔
20
}
2,182✔
21

22
NamedValueComparatorsAndCopiersRepository* NamedValue::
58✔
23
    get_default_comparators_and_copiers_repository()
24
{
25
  return default_repository_;
58✔
26
}
27

28
NamedValue::NamedValue(const String& name)
1,340✔
29
  : name_(name)
1,340✔
30
  , type_("int")
1,340✔
31

32
{
33
  value_.int_value = 0;
1,340✔
34
}
1,340✔
35

36
NamedValue::NamedValue(NamedValue&& other) noexcept
252✔
37
  : name_(static_cast<String&&>(other.name_))
252✔
38
  , type_(static_cast<String&&>(other.type_))
252✔
39
  , is_const_object_(other.is_const_object_)
252✔
40
  , value_(other.value_)
252✔
41
  , size_(other.size_)
252✔
42
  , comparator_(other.comparator_)
252✔
43
  , copier_(other.copier_)
252✔
44
{
45
}
252✔
46

47
void NamedValue::set_value(bool value)
25✔
48
{
49
  type_ = "bool";
25✔
50
  value_.bool_value = value;
25✔
51
}
25✔
52

53
void NamedValue::set_value(unsigned int value)
31✔
54
{
55
  type_ = "unsigned int";
31✔
56
  value_.unsigned_int_value = value;
31✔
57
}
31✔
58

59
void NamedValue::set_value(int value)
183✔
60
{
61
  type_ = "int";
183✔
62
  value_.int_value = value;
183✔
63
}
183✔
64

65
void NamedValue::set_value(long int value)
19✔
66
{
67
  type_ = "long int";
19✔
68
  value_.long_int_value = value;
19✔
69
}
19✔
70

71
void NamedValue::set_value(unsigned long int value)
19✔
72
{
73
  type_ = "unsigned long int";
19✔
74
  value_.unsigned_long_int_value = value;
19✔
75
}
19✔
76

77
void NamedValue::set_value(long long value)
62✔
78
{
79
  type_ = "long long int";
62✔
80
  value_.long_long_int_value = value;
62✔
81
}
62✔
82

83
void NamedValue::set_value(unsigned long long value)
56✔
84
{
85
  type_ = "unsigned long long int";
56✔
86
  value_.unsigned_long_long_int_value = value;
56✔
87
}
56✔
88

89
void NamedValue::set_value(double value)
37✔
90
{
91
  set_value(value, default_double_tolerance);
37✔
92
}
37✔
93

94
void NamedValue::set_value(double value, double tolerance)
45✔
95
{
96
  type_ = "double";
45✔
97
  value_.double_value.value = value;
45✔
98
  value_.double_value.tolerance = tolerance;
45✔
99
}
45✔
100

101
void NamedValue::set_value(void* value)
44✔
102
{
103
  type_ = "void*";
44✔
104
  value_.pointer_value = value;
44✔
105
}
44✔
106

107
void NamedValue::set_value(const void* value)
54✔
108
{
109
  type_ = "const void*";
54✔
110
  value_.const_pointer_value = value;
54✔
111
}
54✔
112

113
void NamedValue::set_value(NamedValue::FunctionPointerValue value)
18✔
114
{
115
  type_ = "void (*)()";
18✔
116
  value_.function_pointer_value = value;
18✔
117
}
18✔
118

119
void NamedValue::set_value(const char* value)
37✔
120
{
121
  type_ = "const char*";
37✔
122
  value_.string_value = value;
37✔
123
}
37✔
124

125
void NamedValue::set_memory_buffer(const unsigned char* value, size_t size)
15✔
126
{
127
  type_ = "const unsigned char*";
15✔
128
  value_.memory_buffer_value = value;
15✔
129
  size_ = size;
15✔
130
}
15✔
131

132
void NamedValue::set_const_object_pointer(
101✔
133
    const String& type,
134
    const void* object_ptr
135
)
136
{
137
  type_ = type;
101✔
138
  is_const_object_ = true;
101✔
139
  value_.const_object_pointer_value = object_ptr;
101✔
140
  if (default_repository_) {
101✔
141
    comparator_ = default_repository_->get_comparator_for_type(type);
88✔
142
    copier_ = default_repository_->get_copier_for_type(type);
88✔
143
  }
144
}
101✔
145

146
void NamedValue::set_object_pointer(const String& type, void* object_ptr)
49✔
147
{
148
  type_ = type;
49✔
149
  is_const_object_ = false;
49✔
150
  value_.object_pointer_value = object_ptr;
49✔
151
  if (default_repository_) {
49✔
152
    comparator_ = default_repository_->get_comparator_for_type(type);
49✔
153
    copier_ = default_repository_->get_copier_for_type(type);
49✔
154
  }
155
}
49✔
156

157
void NamedValue::set_size(size_t size)
37✔
158
{
159
  size_ = size;
37✔
160
}
37✔
161

162
void NamedValue::set_name(const char* name)
118✔
163
{
164
  name_ = name;
118✔
165
}
118✔
166

167
String NamedValue::get_name() const
2,760✔
168
{
169
  return name_;
2,760✔
170
}
171

172
String NamedValue::get_type() const
1,084✔
173
{
174
  return type_;
1,084✔
175
}
176

177
bool NamedValue::get_bool_value() const
25✔
178
{
179
  STRCMP_EQUAL("bool", type_.c_str());
25✔
180
  return value_.bool_value;
25✔
181
}
182

UNCOV
183
unsigned int NamedValue::get_unsigned_int_value() const
×
184
{
UNCOV
185
  if (type_ == "int" && value_.int_value >= 0)
×
UNCOV
186
    return static_cast<unsigned int>(value_.int_value);
×
NEW
187
  else if (type_ == "unsigned int")
×
UNCOV
188
    return value_.unsigned_int_value;
×
NEW
189
  else if (type_ == "long long int" && value_.long_long_int_value >= 0)
×
NEW
190
    return static_cast<unsigned int>(value_.long_long_int_value);
×
191
  else {
NEW
192
    STRCMP_EQUAL("unsigned long long int", type_.c_str());
×
NEW
193
    return static_cast<unsigned int>(value_.unsigned_long_long_int_value);
×
194
  }
195
}
196

UNCOV
197
int NamedValue::get_int_value() const
×
198
{
NEW
199
  if (type_ == "int")
×
NEW
200
    return value_.int_value;
×
201
  else {
NEW
202
    STRCMP_EQUAL("long long int", type_.c_str());
×
NEW
203
    return static_cast<int>(value_.long_long_int_value);
×
204
  }
205
}
206

UNCOV
207
long int NamedValue::get_long_int_value() const
×
208
{
UNCOV
209
  if (type_ == "int")
×
UNCOV
210
    return value_.int_value;
×
UNCOV
211
  else if (type_ == "unsigned int")
×
UNCOV
212
    return static_cast<long int>(value_.unsigned_int_value);
×
NEW
213
  else if (type_ == "long int")
×
UNCOV
214
    return value_.long_int_value;
×
NEW
215
  else if (type_ == "long long int")
×
NEW
216
    return static_cast<long int>(value_.long_long_int_value);
×
217
  else {
NEW
218
    STRCMP_EQUAL("unsigned long long int", type_.c_str());
×
NEW
219
    return static_cast<long int>(value_.unsigned_long_long_int_value);
×
220
  }
221
}
222

UNCOV
223
unsigned long int NamedValue::get_unsigned_long_int_value() const
×
224
{
UNCOV
225
  if (type_ == "unsigned int")
×
UNCOV
226
    return value_.unsigned_int_value;
×
UNCOV
227
  else if (type_ == "int" && value_.int_value >= 0)
×
UNCOV
228
    return static_cast<unsigned long int>(value_.int_value);
×
UNCOV
229
  else if (type_ == "long int" && value_.long_int_value >= 0)
×
UNCOV
230
    return static_cast<unsigned long int>(value_.long_int_value);
×
NEW
231
  else if (type_ == "long long int" && value_.long_long_int_value >= 0)
×
NEW
232
    return static_cast<unsigned long int>(value_.long_long_int_value);
×
NEW
233
  else if (type_ == "unsigned long int")
×
UNCOV
234
    return value_.unsigned_long_int_value;
×
235
  else {
NEW
236
    STRCMP_EQUAL("unsigned long long int", type_.c_str());
×
NEW
237
    return static_cast<unsigned long int>(value_.unsigned_long_long_int_value);
×
238
  }
239
}
240

241
long long NamedValue::get_long_long_int_value() const
92✔
242
{
243
  if (type_ == "int")
92✔
244
    return value_.int_value;
12✔
245
  else if (type_ == "unsigned int")
80✔
UNCOV
246
    return static_cast<long long int>(value_.unsigned_int_value);
×
247
  else if (type_ == "long int")
80✔
248
    return value_.long_int_value;
3✔
249
  else if (type_ == "unsigned long int")
77✔
UNCOV
250
    return static_cast<long long int>(value_.unsigned_long_int_value);
×
251
  else if (type_ == "long long int")
77✔
252
    return value_.long_long_int_value;
74✔
253
  else {
254
    STRCMP_EQUAL("unsigned long long int", type_.c_str());
3✔
255
    return static_cast<long long int>(value_.unsigned_long_long_int_value);
3✔
256
  }
257
}
258

259
unsigned long long NamedValue::get_unsigned_long_long_int_value() const
86✔
260
{
261
  if (type_ == "unsigned int")
86✔
262
    return value_.unsigned_int_value;
4✔
263
  else if (type_ == "int" && value_.int_value >= 0)
82✔
UNCOV
264
    return static_cast<unsigned long long int>(value_.int_value);
×
265
  else if (type_ == "long int" && value_.long_int_value >= 0)
82✔
UNCOV
266
    return static_cast<unsigned long long int>(value_.long_int_value);
×
267
  else if (type_ == "unsigned long int")
82✔
268
    return value_.unsigned_long_int_value;
3✔
269
  else if (type_ == "long long int" && value_.long_long_int_value >= 0)
79✔
270
    return static_cast<unsigned long long int>(value_.long_long_int_value);
6✔
271
  else {
272
    STRCMP_EQUAL("unsigned long long int", type_.c_str());
73✔
273
    return value_.unsigned_long_long_int_value;
73✔
274
  }
275
}
276

277
double NamedValue::get_double_value() const
19✔
278
{
279
  STRCMP_EQUAL("double", type_.c_str());
19✔
280
  return value_.double_value.value;
19✔
281
}
282

283
double NamedValue::get_double_tolerance() const
3✔
284
{
285
  STRCMP_EQUAL("double", type_.c_str());
3✔
286
  return value_.double_value.tolerance;
3✔
287
}
288

289
const char* NamedValue::get_string_value() const
17✔
290
{
291
  STRCMP_EQUAL("const char*", type_.c_str());
17✔
292
  return value_.string_value;
17✔
293
}
294

295
void* NamedValue::get_pointer_value() const
17✔
296
{
297
  STRCMP_EQUAL("void*", type_.c_str());
17✔
298
  return value_.pointer_value;
17✔
299
}
300

301
const void* NamedValue::get_const_pointer_value() const
38✔
302
{
303
  STRCMP_EQUAL("const void*", type_.c_str());
38✔
304
  return value_.pointer_value;
38✔
305
}
306

307
NamedValue::FunctionPointerValue NamedValue::get_function_pointer_value() const
16✔
308
{
309
  STRCMP_EQUAL("void (*)()", type_.c_str());
16✔
310
  return value_.function_pointer_value;
16✔
311
}
312

313
const unsigned char* NamedValue::get_memory_buffer() const
3✔
314
{
315
  STRCMP_EQUAL("const unsigned char*", type_.c_str());
3✔
316
  return value_.memory_buffer_value;
3✔
317
}
318

319
const void* NamedValue::get_const_object_pointer() const
21✔
320
{
321
  return value_.const_object_pointer_value;
21✔
322
}
323

324
void* NamedValue::get_object_pointer() const
478✔
325
{
326
  return value_.object_pointer_value;
478✔
327
}
328

329
bool NamedValue::is_const_object() const
5✔
330
{
331
  return is_const_object_;
5✔
332
}
333

334
size_t NamedValue::get_size() const
24✔
335
{
336
  return size_;
24✔
337
}
338

339
NamedValueComparator* NamedValue::get_comparator() const
19✔
340
{
341
  return comparator_;
19✔
342
}
343

344
NamedValueCopier* NamedValue::get_copier() const
44✔
345
{
346
  return copier_;
44✔
347
}
348

349
bool NamedValue::equals(const NamedValue& p) const
193✔
350
{
351
  if ((type_ == "long int") && (p.type_ == "int"))
193✔
352
    return value_.long_int_value == p.value_.int_value;
1✔
353
  else if ((type_ == "int") && (p.type_ == "long int"))
192✔
354
    return value_.int_value == p.value_.long_int_value;
1✔
355
  else if ((type_ == "unsigned int") && (p.type_ == "int"))
191✔
356
    return (p.value_.int_value >= 0) &&
2✔
357
           (value_.unsigned_int_value ==
1✔
358
            static_cast<unsigned int>(p.value_.int_value));
2✔
359
  else if ((type_ == "int") && (p.type_ == "unsigned int"))
190✔
360
    return (value_.int_value >= 0) &&
2✔
361
           (static_cast<unsigned int>(value_.int_value) ==
1✔
362
            p.value_.unsigned_int_value);
2✔
363
  else if ((type_ == "unsigned long int") && (p.type_ == "int"))
189✔
364
    return (p.value_.int_value >= 0) &&
2✔
365
           (value_.unsigned_long_int_value ==
1✔
366
            static_cast<unsigned long>(p.value_.int_value));
2✔
367
  else if ((type_ == "int") && (p.type_ == "unsigned long int"))
188✔
368
    return (value_.int_value >= 0) &&
2✔
369
           (static_cast<unsigned long>(value_.int_value) ==
1✔
370
            p.value_.unsigned_long_int_value);
2✔
371
  else if ((type_ == "unsigned int") && (p.type_ == "long int"))
187✔
372
    return (p.value_.long_int_value >= 0) &&
2✔
373
           (value_.unsigned_int_value ==
1✔
374
            static_cast<unsigned long>(p.value_.long_int_value));
2✔
375
  else if ((type_ == "long int") && (p.type_ == "unsigned int"))
186✔
376
    return (value_.long_int_value >= 0) &&
2✔
377
           (static_cast<unsigned long>(value_.long_int_value) ==
1✔
378
            p.value_.unsigned_int_value);
2✔
379
  else if ((type_ == "unsigned int") && (p.type_ == "unsigned long int"))
185✔
380
    return value_.unsigned_int_value == p.value_.unsigned_long_int_value;
1✔
381
  else if ((type_ == "unsigned long int") && (p.type_ == "unsigned int"))
184✔
382
    return value_.unsigned_long_int_value == p.value_.unsigned_int_value;
1✔
383
  else if ((type_ == "long int") && (p.type_ == "unsigned long int"))
183✔
384
    return (value_.long_int_value >= 0) &&
3✔
385
           (static_cast<unsigned long>(value_.long_int_value) ==
1✔
386
            p.value_.unsigned_long_int_value);
3✔
387
  else if ((type_ == "unsigned long int") && (p.type_ == "long int"))
181✔
388
    return (p.value_.long_int_value >= 0) &&
3✔
389
           (value_.unsigned_long_int_value ==
1✔
390
            static_cast<unsigned long>(p.value_.long_int_value));
3✔
391
  else if ((type_ == "long long int") && (p.type_ == "int"))
179✔
392
    return value_.long_long_int_value == p.value_.int_value;
1✔
393
  else if ((type_ == "int") && (p.type_ == "long long int"))
178✔
394
    return value_.int_value == p.value_.long_long_int_value;
1✔
395
  else if ((type_ == "long long int") && (p.type_ == "long int"))
177✔
396
    return value_.long_long_int_value == p.value_.long_int_value;
1✔
397
  else if ((type_ == "long int") && (p.type_ == "long long int"))
176✔
398
    return value_.long_int_value == p.value_.long_long_int_value;
1✔
399
  else if ((type_ == "long long int") && (p.type_ == "unsigned int"))
175✔
400
    return (value_.long_long_int_value >= 0) &&
2✔
401
           (static_cast<unsigned long long>(value_.long_long_int_value) ==
1✔
402
            p.value_.unsigned_int_value);
2✔
403
  else if ((type_ == "unsigned int") && (p.type_ == "long long int"))
174✔
404
    return (p.value_.long_long_int_value >= 0) &&
2✔
405
           (value_.unsigned_int_value ==
1✔
406
            static_cast<unsigned long long>(p.value_.long_long_int_value));
2✔
407
  else if ((type_ == "long long int") && (p.type_ == "unsigned long int"))
173✔
408
    return (value_.long_long_int_value >= 0) &&
2✔
409
           (static_cast<unsigned long long>(value_.long_long_int_value) ==
1✔
410
            p.value_.unsigned_long_int_value);
2✔
411
  else if ((type_ == "unsigned long int") && (p.type_ == "long long int"))
172✔
412
    return (p.value_.long_long_int_value >= 0) &&
2✔
413
           (value_.unsigned_long_int_value ==
1✔
414
            static_cast<unsigned long long>(p.value_.long_long_int_value));
2✔
415
  else if ((type_ == "long long int") && (p.type_ == "unsigned long long int"))
171✔
416
    return (value_.long_long_int_value >= 0) &&
2✔
417
           (static_cast<unsigned long long>(value_.long_long_int_value) ==
1✔
418
            p.value_.unsigned_long_long_int_value);
2✔
419
  else if ((type_ == "unsigned long long int") && (p.type_ == "long long int"))
170✔
420
    return (p.value_.long_long_int_value >= 0) &&
2✔
421
           (value_.unsigned_long_long_int_value ==
1✔
422
            static_cast<unsigned long long>(p.value_.long_long_int_value));
2✔
423
  else if ((type_ == "unsigned long long int") && (p.type_ == "int"))
169✔
424
    return (p.value_.int_value >= 0) &&
2✔
425
           (value_.unsigned_long_long_int_value ==
1✔
426
            static_cast<unsigned long long>(p.value_.int_value));
2✔
427
  else if ((type_ == "int") && (p.type_ == "unsigned long long int"))
168✔
428
    return (value_.int_value >= 0) &&
2✔
429
           (static_cast<unsigned long long>(value_.int_value) ==
1✔
430
            p.value_.unsigned_long_long_int_value);
2✔
431
  else if ((type_ == "unsigned long long int") && (p.type_ == "unsigned int"))
167✔
432
    return value_.unsigned_long_long_int_value == p.value_.unsigned_int_value;
1✔
433
  else if ((type_ == "unsigned int") && (p.type_ == "unsigned long long int"))
166✔
434
    return value_.unsigned_int_value == p.value_.unsigned_long_long_int_value;
1✔
435
  else if ((type_ == "unsigned long long int") && (p.type_ == "long int"))
165✔
436
    return (p.value_.long_int_value >= 0) &&
2✔
437
           (value_.unsigned_long_long_int_value ==
1✔
438
            static_cast<unsigned long long>(p.value_.long_int_value));
2✔
439
  else if ((type_ == "long int") && (p.type_ == "unsigned long long int"))
164✔
440
    return (value_.long_int_value >= 0) &&
2✔
441
           (static_cast<unsigned long long>(value_.long_int_value) ==
1✔
442
            p.value_.unsigned_long_long_int_value);
2✔
443
  else if (
163✔
444
      (type_ == "unsigned long long int") && (p.type_ == "unsigned long int")
163✔
445
  )
446
    return value_.unsigned_long_long_int_value ==
1✔
447
           p.value_.unsigned_long_int_value;
1✔
448
  else if (
162✔
449
      (type_ == "unsigned long int") && (p.type_ == "unsigned long long int")
162✔
450
  )
451
    return value_.unsigned_long_int_value ==
1✔
452
           p.value_.unsigned_long_long_int_value;
1✔
453

454
  if (type_ != p.type_)
161✔
455
    return false;
2✔
456

457
  if (type_ == "bool")
159✔
458
    return value_.bool_value == p.value_.bool_value;
6✔
459
  else if (type_ == "int")
153✔
460
    return value_.int_value == p.value_.int_value;
76✔
461
  else if (type_ == "unsigned int")
77✔
462
    return value_.unsigned_int_value == p.value_.unsigned_int_value;
6✔
463
  else if (type_ == "long int")
71✔
464
    return value_.long_int_value == p.value_.long_int_value;
2✔
465
  else if (type_ == "unsigned long int")
69✔
466
    return value_.unsigned_long_int_value == p.value_.unsigned_long_int_value;
2✔
467
  else if (type_ == "long long int")
67✔
468
    return value_.long_long_int_value == p.value_.long_long_int_value;
3✔
469
  else if (type_ == "unsigned long long int")
64✔
470
    return value_.unsigned_long_long_int_value ==
3✔
471
           p.value_.unsigned_long_long_int_value;
3✔
472
  else if (type_ == "const char*")
61✔
473
    return String(value_.string_value) == String(p.value_.string_value);
7✔
474
  else if (type_ == "void*")
54✔
475
    return value_.pointer_value == p.value_.pointer_value;
4✔
476
  else if (type_ == "const void*")
50✔
477
    return value_.const_pointer_value == p.value_.const_pointer_value;
3✔
478
  else if (type_ == "void (*)()")
47✔
479
    return value_.function_pointer_value == p.value_.function_pointer_value;
4✔
480
  else if (type_ == "double")
43✔
481
    return (test::approx_equal(
36✔
482
        value_.double_value.value,
18✔
483
        p.value_.double_value.value,
18✔
484
        value_.double_value.tolerance
18✔
485
    ));
18✔
486
  else if (type_ == "const unsigned char*") {
25✔
487
    if (size_ != p.size_) {
6✔
488
      return false;
1✔
489
    }
490
    return memcmp(
10✔
491
               value_.memory_buffer_value, p.value_.memory_buffer_value, size_
5✔
492
           ) == 0;
5✔
493
  }
494

495
  if (comparator_)
19✔
496
    return comparator_->is_equal(
32✔
497
        value_.const_object_pointer_value, p.value_.const_object_pointer_value
16✔
498
    );
16✔
499

500
  return false;
3✔
501
}
502

503
bool NamedValue::compatible_for_copying(const NamedValue& p) const
51✔
504
{
505
  if (type_ == p.type_)
51✔
506
    return true;
24✔
507

508
  if ((type_ == "const void*") && (p.type_ == "void*"))
27✔
509
    return true;
25✔
510

511
  return false;
2✔
512
}
513

514
String NamedValue::to_string() const
103✔
515
{
516
  if (type_ == "bool")
103✔
517
    return string_from(value_.bool_value);
1✔
518
  else if (type_ == "int")
102✔
519
    return string_from(value_.int_value) + " " +
72✔
520
           brackets_formatted_hex_string_from(value_.int_value);
108✔
521
  else if (type_ == "unsigned int")
66✔
522
    return string_from(value_.unsigned_int_value) + " " +
20✔
523
           brackets_formatted_hex_string_from(value_.unsigned_int_value);
30✔
524
  else if (type_ == "long int")
56✔
525
    return string_from(value_.long_int_value) + " " +
8✔
526
           brackets_formatted_hex_string_from(value_.long_int_value);
12✔
527
  else if (type_ == "unsigned long int")
52✔
528
    return string_from(value_.unsigned_long_int_value) + " " +
8✔
529
           brackets_formatted_hex_string_from(value_.unsigned_long_int_value);
12✔
530
  else if (type_ == "long long int")
48✔
531
    return string_from(value_.long_long_int_value) + " " +
2✔
532
           brackets_formatted_hex_string_from(value_.long_long_int_value);
3✔
533
  else if (type_ == "unsigned long long int")
47✔
534
    return string_from(value_.unsigned_long_long_int_value) + " " +
2✔
535
           brackets_formatted_hex_string_from(
1✔
536
               value_.unsigned_long_long_int_value
1✔
537
           );
1✔
538
  else if (type_ == "const char*")
46✔
539
    return value_.string_value;
17✔
540
  else if (type_ == "void*")
29✔
541
    return string_from(value_.pointer_value);
1✔
542
  else if (type_ == "void (*)()")
28✔
543
    return string_from(value_.function_pointer_value);
1✔
544
  else if (type_ == "const void*")
27✔
545
    return string_from(value_.const_pointer_value);
1✔
546
  else if (type_ == "double")
26✔
547
    return string_from(value_.double_value.value);
6✔
548
  else if (type_ == "const unsigned char*")
20✔
549
    return string_from_binary_with_size_or_null(
550
        value_.memory_buffer_value, size_
12✔
551
    );
12✔
552

553
  if (comparator_)
8✔
554
    return comparator_->value_to_string(value_.const_object_pointer_value);
5✔
555

556
  return string_from_format(
557
      "No comparator found for type: \"%s\"", type_.c_str()
558
  );
3✔
559
}
560

561
} // namespace mock
562
} // namespace tiny
563
} // namespace mu
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc