forked from mtimjones/HashSet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.c
40 lines (28 loc) · 885 Bytes
/
test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <stdio.h>
#include <stdlib.h>
#include "hashset.h"
void main()
{
void *map;
map = HashSetCreate( 10 );
if ( HashSetContains( map, "Violet" ) ) exit( -1 );
HashSetAdd( map, "Albert" );
HashSetAdd( map, "Violet" );
HashSetAdd( map, "Josh" );
if ( HashSetContains( map, "Mangum" ) ) exit( -1 );
if ( !HashSetContains( map, "Albert" ) ) exit( -1 );
if ( !HashSetContains( map, "Violet" ) ) exit( -1 );
if ( !HashSetContains( map, "Josh" ) ) exit( -1 );
HashSetAdd( map, "Mangum" );
if ( !HashSetContains( map, "Mangum" ) ) exit( -1 );
HashSetAdd( map, "Kai" );
if ( !HashSetContains( map, "Kai" ) ) exit( -1 );
HashSetAdd( map, "Chris" );
HashSetAdd( map, "Lost" );
HashSetAdd( map, "Hilton" );
HashSetAdd( map, "Broken" );
printf( "Passed.\n" );
HashSetPrint( map );
HashSetDestroy( map );
return;
}