Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

libtest.cc File Reference

#include "copyright.h"
#include "libtest.h"
#include "bitmap.h"
#include "list.h"
#include "hash.h"
#include "sysdep.h"

Go to the source code of this file.

Functions

int IntCompare (int x, int y)
unsigned int HashInt (int key)
int HashKey (char *str)
void LibSelfTest ()

Variables

int listTestVector [] = { 9, 5, 7 }
char* hashTestVector []


Function Documentation

unsigned int HashInt ( int key ) [static]
 

HashInt, HashKey Compute a hash function on an integer. Serves as the hashing function for testing HashTables.

Definition at line 36 of file libtest.cc.

int HashKey ( char * str ) [static]
 

HashKey Convert a string into an integer. Serves as the function to retrieve the key from the item in the hash table, for testing HashTables. Should be able to use "atoi" directly, but some compilers complain about that.

Definition at line 49 of file libtest.cc.

int IntCompare ( int x,
int y ) [static]
 

IntCompare Compare two integers together. Serves as the comparison function for testing SortedLists

Definition at line 23 of file libtest.cc.

void LibSelfTest ( )
 

LibSelfTest Run self tests on bitmaps, lists, sorted lists, and hash tables.

Definition at line 68 of file libtest.cc.

Referenced by ThreadedKernel::SelfTest().


Variable Documentation

char * hashTestVector [static]
 

Initial value:

 { "0", "1", "2", "3", "4", "5", "6",
         "7", "8", "9", "10", "11", "12", "13", "14"}

Definition at line 58 of file libtest.cc.

int listTestVector = { 9, 5, 7 } [static]
 

Definition at line 54 of file libtest.cc.


Generated at Wed Jul 4 11:32:22 2001 for Nachos by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001