pintos/src/tests/internal/stdlib.c File Reference

#include <debug.h>
#include <limits.h>
#include <random.h>
#include <stdlib.h>
#include <stdio.h>
#include "threads/test.h"

Go to the source code of this file.

Defines

#define MAX_CNT   4096

Functions

static void shuffle (int[], size_t)
static int compare_ints (const void *, const void *)
static void verify_order (const int[], size_t)
static void verify_bsearch (const int[], size_t)
void test (void)
static void shuffle (int *array, size_t cnt)
static void verify_order (const int *array, size_t cnt)
static void verify_bsearch (const int *array, size_t cnt)


Define Documentation

#define MAX_CNT   4096

Definition at line 19 of file stdlib.c.

Referenced by test(), and verify_bsearch().


Function Documentation

static int compare_ints ( const void *  a_,
const void *  b_ 
) [static]

Definition at line 78 of file stdlib.c.

Referenced by test(), and verify_bsearch().

static void shuffle ( int *  array,
size_t  cnt 
) [static]

Definition at line 61 of file stdlib.c.

References random_ulong().

static void shuffle ( int  [],
size_t   
) [static]

void test ( void   ) 

Definition at line 28 of file stdlib.c.

References compare_ints(), MAX_CNT, printf(), qsort(), shuffle(), verify_bsearch(), and verify_order().

static void verify_bsearch ( const int *  array,
size_t  cnt 
) [static]

Definition at line 99 of file stdlib.c.

References ASSERT, bsearch(), compare_ints(), INT_MAX, MAX_CNT, and NULL.

static void verify_bsearch ( const   int[],
size_t   
) [static]

Referenced by test().

static void verify_order ( const int *  array,
size_t  cnt 
) [static]

Definition at line 88 of file stdlib.c.

References ASSERT.

static void verify_order ( const   int[],
size_t   
) [static]

Referenced by test().


Generated on Mon Jan 10 16:43:58 2011 for Pintos by  doxygen 1.5.6