| CS318 - Pintos
    Pintos source browser for JHU CS318 course | 
 
 
 
Go to the documentation of this file.
   16 #include "threads/test.h" 
   21 static void shuffle (
int[], 
size_t);
 
   32   printf (
"testing various size arrays:");
 
   33   for (cnt = 0; cnt < 
MAX_CNT; cnt = cnt * 4 / 3 + 1)
 
   38       for (repeat = 0; repeat < 10; repeat++) 
 
   44           for (i = 0; i < cnt; i++)
 
   65   for (i = 0; i < cnt; i++)
 
   83   return *a < *b ? -1 : *a > *b;
 
   92   for (i = 0; (
size_t) i < cnt; i++) 
 
  105   for (i = 0; (
size_t) i < cnt; i++) 
 
  110   not_in_array[0] = cnt;
 
  111   for (i = 0; (
size_t) i < 
sizeof not_in_array / 
sizeof *not_in_array; i++) 
 
  
void qsort(void *array, size_t cnt, size_t size, int(*compare)(const void *, const void *))
Sorts ARRAY, which contains CNT elements of SIZE bytes each, using COMPARE.
__SIZE_TYPE__ size_t
lib/stddef.h
static void verify_bsearch(const int[], size_t)
unsigned long random_ulong(void)
Returns a pseudo-random unsigned long.
void * bsearch(const void *key, const void *array, size_t cnt, size_t size, int(*compare)(const void *, const void *))
Searches ARRAY, which contains CNT elements of SIZE bytes each, for the given KEY.
static void shuffle(int[], size_t)
void test(void)
Test sorting and searching implementations.
static int compare_ints(const void *, const void *)
Returns 1 if *A is greater than *B, 0 if *A equals *B, -1 if *A is less than *B.
#define MAX_CNT
Test program for sorting and searching in lib/stdlib.c.
int printf(const char *format,...)
Writes formatted output to the console.
static void verify_order(const int[], size_t)
#define ASSERT(CONDITION)
This is outside the header guard so that debug.h may be included multiple times with different settin...