MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / utest_assert_string

Function utest_assert_string

components/utilities/utest/utest.c:469–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467}
468
469void utest_assert_string(const char *a, const char *b, rt_bool_t equal, const char *file, int line, const char *func, const char *msg)
470{
471 rt_bool_t rst = RT_FALSE;
472
473 if (a == RT_NULL || b == RT_NULL)
474 {
475 rst = utest_assert(0, file, line, func, msg);
476 }
477 else
478 {
479 if (equal)
480 {
481 if (rt_strcmp(a, b) == 0)
482 {
483 rst = utest_assert(1, file, line, func, msg);
484 }
485 else
486 {
487 rst = utest_assert(0, file, line, func, msg);
488 }
489 }
490 else
491 {
492 if (rt_strcmp(a, b) == 0)
493 {
494 rst = utest_assert(0, file, line, func, msg);
495 }
496 else
497 {
498 rst = utest_assert(1, file, line, func, msg);
499 }
500 }
501 }
502
503 if (!rst)
504 {
505 LOG_E("[ ASSERT ] [ unit ] str-a: (%s); str-b: (%s)", a, b);
506 }
507}
508
509void utest_assert_buf(const char *a, const char *b, rt_size_t sz, rt_bool_t equal, const char *file, int line, const char *func, const char *msg)
510{

Callers

nothing calls this directly

Calls 2

utest_assertFunction · 0.85
rt_strcmpFunction · 0.85

Tested by

no test coverage detected