Crossfire Server, Trunk
check_minheap.cpp File Reference
#include <stdint.h>
#include <global.h>
#include "minheap.h"
#include "compat.h"
#include "define.h"
#include <check.h>
#include <stdlib.h>
#include <string.h>
#include <toolkit_common.h>
+ Include dependency graph for check_minheap.cpp:

Go to the source code of this file.

Data Structures

struct  Pos
 

Macros

#define HEAP_SIZE   50
 

Functions

int int_measure (const void *ob)
 
int main (void)
 
int measure_pos_distance (const void *ob)
 
static END_TEST Suite * minheap_suite (void)
 
int qsort_comp_int (const void *a, const void *b)
 
int qsort_pos_check (const void *a, const void *b)
 
static void setup (void)
 
 START_TEST (test_minheap_allocate)
 
END_TEST START_TEST (test_minheap_empty_remove)
 
END_TEST START_TEST (test_minheap_insert_remove)
 
END_TEST START_TEST (test_minheap_overfill)
 
END_TEST START_TEST (test_minheap_static_alloc)
 
 START_TEST (test_minheap_with_struct)
 
static void teardown (void)
 

Variables

static MinHeaptest_heap
 

Macro Definition Documentation

◆ HEAP_SIZE

#define HEAP_SIZE   50

Function Documentation

◆ int_measure()

int int_measure ( const void *  ob)

Definition at line 32 of file check_minheap.cpp.

References guildjoin::ob.

Referenced by START_TEST().

+ Here is the caller graph for this function:

◆ main()

int main ( void  )

Definition at line 199 of file check_minheap.cpp.

References minheap_suite().

+ Here is the call graph for this function:

◆ measure_pos_distance()

int measure_pos_distance ( const void *  ob)

Definition at line 107 of file check_minheap.cpp.

References FABS, MAX, MIN, guildjoin::ob, Pos::x, and Pos::y.

Referenced by qsort_pos_check(), and START_TEST().

+ Here is the caller graph for this function:

◆ minheap_suite()

static END_TEST Suite* minheap_suite ( void  )
static

Definition at line 180 of file check_minheap.cpp.

References setup(), and teardown().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qsort_comp_int()

int qsort_comp_int ( const void *  a,
const void *  b 
)

Definition at line 38 of file check_minheap.cpp.

References disinfect::a, and Ice::b.

Referenced by START_TEST().

+ Here is the caller graph for this function:

◆ qsort_pos_check()

int qsort_pos_check ( const void *  a,
const void *  b 
)

Definition at line 114 of file check_minheap.cpp.

References disinfect::a, Ice::b, and measure_pos_distance().

Referenced by START_TEST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setup()

static void setup ( void  )
static

Definition at line 20 of file check_minheap.cpp.

References cctk_setlog().

Referenced by minheap_suite().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ START_TEST() [1/6]

START_TEST ( test_minheap_allocate  )

Definition at line 43 of file check_minheap.cpp.

References MinHeap::capacity, FAIL_UNLESS, int_measure(), MinHeap::len, minheap_init(), and test_heap.

+ Here is the call graph for this function:

◆ START_TEST() [2/6]

END_TEST START_TEST ( test_minheap_empty_remove  )

Definition at line 62 of file check_minheap.cpp.

References FAIL_UNLESS, int_measure(), MinHeap::len, minheap_init(), minheap_insert(), minheap_remove(), rotate-tower::result, and test_heap.

+ Here is the call graph for this function:

◆ START_TEST() [3/6]

END_TEST START_TEST ( test_minheap_insert_remove  )

Definition at line 78 of file check_minheap.cpp.

References FAIL_UNLESS, int_measure(), minheap_init(), minheap_insert(), minheap_remove(), qsort_comp_int(), rotate-tower::result, and test_heap.

+ Here is the call graph for this function:

◆ START_TEST() [4/6]

END_TEST START_TEST ( test_minheap_overfill  )

Definition at line 51 of file check_minheap.cpp.

References FAIL_UNLESS, int_measure(), minheap_init(), minheap_insert(), rotate-tower::result, and test_heap.

+ Here is the call graph for this function:

◆ START_TEST() [5/6]

END_TEST START_TEST ( test_minheap_static_alloc  )

Definition at line 149 of file check_minheap.cpp.

References FAIL_UNLESS, HEAP_SIZE, int_measure(), MinHeap::len, minheap_init_static(), minheap_insert(), minheap_remove(), qsort_comp_int(), and altar_valkyrie::res.

+ Here is the call graph for this function:

◆ START_TEST() [6/6]

START_TEST ( test_minheap_with_struct  )

◆ teardown()

static void teardown ( void  )
static

Definition at line 24 of file check_minheap.cpp.

References minheap_free(), and test_heap.

Referenced by minheap_suite().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ test_heap

MinHeap* test_heap
static

Definition at line 18 of file check_minheap.cpp.

Referenced by START_TEST(), and teardown().