Embedded Artistry Framework
Embedded Systems C++ Framework
Functions | Variables
heapsort.c File Reference
#include "stdlib_tests.h"
#include <stdlib.h>
#include <string.h>
#include <test/test.h>
#include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#include <cmocka.h>
Include dependency graph for heapsort.c:

Functions

static int scmp (const void *a, const void *b)
 
static int icmp (const void *a, const void *b)
 
static int ccmp (const void *a, const void *b)
 
static int cmp64 (const void *a, const void *b)
 
static void heapsort_string_test (void **state)
 
static void heapsort_int_test (void **state)
 
static void char_test (const char *a, const char *a_sorted, void **state)
 
static void heapsort_char_test (void **state)
 
static void uint64_gen (uint64_t *p, uint64_t *p_sorted, size_t num)
 
static void uint64_test (uint64_t *a, uint64_t *a_sorted, size_t len, void **state)
 
static void heapsort_uint64_test (void **state)
 
int heapsort_tests (void)
 

Variables

static const char * s []
 
static const char * s_sorted []
 
static int n []
 
static int n_sorted []
 

Function Documentation

◆ ccmp()

static int ccmp ( const void *  a,
const void *  b 
)
static

References a, and b.

Referenced by char_test().

◆ char_test()

static void char_test ( const char *  a,
const char *  a_sorted,
void **  state 
)
static

◆ cmp64()

static int cmp64 ( const void *  a,
const void *  b 
)
static

References a, and b.

Referenced by uint64_test().

◆ heapsort_char_test()

static void heapsort_char_test ( void **  state)
static

References char_test().

Referenced by heapsort_tests().

◆ heapsort_int_test()

static void heapsort_int_test ( void **  state)
static

References heapsort(), icmp(), n, and n_sorted.

Referenced by heapsort_tests().

◆ heapsort_string_test()

static void heapsort_string_test ( void **  state)
static

References heapsort(), s, s_sorted, scmp(), and strcmp().

Referenced by heapsort_tests().

◆ heapsort_tests()

int heapsort_tests ( void  )

References heapsort_char_test(), heapsort_int_test(), heapsort_string_test(), heapsort_tests(), heapsort_uint64_test(), and NULL.

Referenced by heapsort_tests(), and stdlib_tests().

Here is the caller graph for this function:

◆ heapsort_uint64_test()

static void heapsort_uint64_test ( void **  state)
static

References p, uint64_gen(), and uint64_test().

Referenced by heapsort_tests().

◆ icmp()

static int icmp ( const void *  a,
const void *  b 
)
static

References a, and b.

Referenced by heapsort_int_test().

◆ scmp()

static int scmp ( const void *  a,
const void *  b 
)
static

References a, b, and strcmp().

Referenced by heapsort_string_test().

◆ uint64_gen()

static void uint64_gen ( uint64_t p,
uint64_t p_sorted,
size_t  num 
)
static

◆ uint64_test()

static void uint64_test ( uint64_t a,
uint64_t a_sorted,
size_t  len,
void **  state 
)
static

References a, cmp64(), and heapsort().

Referenced by heapsort_uint64_test().

Variable Documentation

◆ n

int n[]
static

◆ n_sorted

int n_sorted[]
static
Initial value:
= {22, 233, 324, 343, 343, 394, 454, 3434,
3535, 4334, 4334, 5454, 33434, 34344, 45345, 45545,
93994, 232323, 848405, 879045, 2230404, 3434344, 99405644}

Referenced by heapsort_int_test().

◆ s

const char* s[]
static
Initial value:
= {"Bob", "Alice", "John", "Ceres", "Helga", "Drepper", "Emeralda",
"Zoran", "Momo", "Frank", "Pema", "Xavier", "Yeva", "Gedun",
"Irina", "Nono", "Wiener", "Vincent", "Tsering", "Karnica", "Lulu",
"Quincy", "Osama", "Riley", "Ursula", "Sam"}

Referenced by __attribute__(), __ieee754_acos(), __ieee754_acosf(), __ieee754_asin(), __ieee754_asinf(), __ieee754_j0(), __ieee754_j0f(), __ieee754_j1(), __ieee754_j1f(), __ieee754_log(), __ieee754_logf(), __ieee754_pow(), __ieee754_powf(), __ieee754_sqrtf(), __ieee754_y0(), __ieee754_y0f(), __ieee754_y1(), __ieee754_y1f(), __kernel_sincosdf(), __kernel_sindf(), __kernel_tan(), __kernel_tandf(), __kernel_tanl(), __memrchr(), __scan_nan(), __strchrnul(), __strtok_r(), _cchsh(), _cchshf(), _strnlen_s(), acosl(), embvm::TimerManager< 0, std::mutex >::adjustScheduledTimerCount(), asinl(), atof_test(), cbrt(), cbrtl(), cchsh(), cchshf(), cchshl(), ctanh(), ctanhf(), dd_add(), dtoa(), erf(), erfc(), erfcf(), erfcl(), erff(), erfl(), freedtoa(), g__fmt(), g_ddfmt(), g_dfmt(), g_ffmt(), g_Qfmt(), g_xfmt(), g_xLfmt(), gdtoa(), gethex(), heapsort_string_test(), hexnan(), htinit(), j0_test(), j1_test(), jn_test(), k_log1p(), k_log1pf(), log1p(), log1pf(), log1pl(), memchr(), memcmp_test(), memmem(), nan(), nanf(), nanl(), nrv_alloc(), pone(), ponef(), powil(), powl(), pzero(), pzerof(), qone(), qonef(), qzero(), qzerof(), embdrv::vl53l1x::rangeStatusCb(), s2b(), sec2mps(), sincos(), sincosf(), sincosl(), sinl(), os::freertos::Thread::state(), strchr(), strcmp_test(), strcpy_test(), strcspn(), strerror(), strnstr(), strpbrk(), strrchr(), strspn(), strtod(), strtod_test(), strtodg(), strtodI(), strtof(), strtof_test(), strtoId(), strtoIdd(), strtoIf(), strtoIQ(), strtoIx(), strtoIxL(), strtok(), strtok_test(), strtol(), strtol_test(), strtoll(), strtoll_test(), strtopd(), strtopdd(), strtopf(), strtopQ(), strtopx(), strtopxL(), strtord(), strtordd(), strtorf(), strtorQ(), strtorx(), strtorxL(), strtoul(), strtoul_test(), strtoull(), strtoull_test(), tanl(), test_align(), test_randseed(), wctype(), y0_test(), y1_test(), and yn_test().

◆ s_sorted

const char* s_sorted[]
static
Initial value:
= {
"Alice", "Bob", "Ceres", "Drepper", "Emeralda", "Frank", "Gedun", "Helga", "Irina",
"John", "Karnica", "Lulu", "Momo", "Nono", "Osama", "Pema", "Quincy", "Riley",
"Sam", "Tsering", "Ursula", "Vincent", "Wiener", "Xavier", "Yeva", "Zoran"}

Referenced by heapsort_string_test().