taskrambler  v0.1.8
Web server and task management solution.
testers/hash.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 
4 #include "class.h"
5 #include "commons.h"
6 #include "utils/memory.h"
7 
8 #include "hash.h"
9 #include "utils/memory.h"
10 
11 
12 /**
13  * =======================================================================
14  */
15 int
16 main(int argc, char * argv[])
17 {
18  Hash hash = new(Hash);
19  HashValue deleted;
20 
21  hashAdd(hash, new(HashValue, CSTRA("foo"), CSTRA("bar")));
22  hashAdd(hash, new(HashValue, CSTRA("hjkfdd"), CSTRA("bar")));
23  hashAdd(hash, new(HashValue, CSTRA("j8frheff"), CSTRA("bar")));
24  hashAdd(hash, new(HashValue, CSTRA("f9e0g"), CSTRA("bar")));
25  hashAdd(hash, new(HashValue, CSTRA("gfrk9e0"), CSTRA("bar")));
26  hashAdd(hash, new(HashValue, CSTRA("fr09ie"), CSTRA("bar")));
27  hashAdd(hash, new(HashValue, CSTRA("fu8de9"), CSTRA("bar")));
28  hashAdd(hash, new(HashValue, CSTRA("rehw78"), CSTRA("bar")));
29  hashAdd(hash, new(HashValue, CSTRA("fcrne9"), CSTRA("bar")));
30  hashAdd(hash, new(HashValue, CSTRA("new8"), CSTRA("bar")));
31  hashAdd(hash, new(HashValue, CSTRA("fdhe78"), CSTRA("bar")));
32  hashAdd(hash, new(HashValue, CSTRA("dhew8"), CSTRA("bar")));
33  hashAdd(hash, new(HashValue, CSTRA("jfde9w8"), CSTRA("bar")));
34  hashAdd(hash, new(HashValue, CSTRA("dhe7w89"), CSTRA("bar")));
35  hashAdd(hash, new(HashValue, CSTRA("fduew89"), CSTRA("bar")));
36 
37  deleted = hashDelete(hash, CSTRA("f9e0g"));
38  delete(deleted);
39  deleted = hashDelete(hash, CSTRA("fcrne9"));
40  delete(deleted);
41  deleted = hashDelete(hash, CSTRA("fr09ie"));
42  delete(deleted);
43  deleted = hashDelete(hash, CSTRA("jfde9w8"));
44  delete(deleted);
45  deleted = hashDelete(hash, CSTRA("j8frheff"));
46  delete(deleted);
47 
48  delete(hash);
49  memCleanup();
50 
51  return 0;
52 }
53 
54 // vim: set et ts=4 sw=4:
#define CSTRA(val)
Const STRing Argument.
Definition: memory.h:26
int main(int argc, char *argv[])
Definition: testers/hash.c:16
void * hashDelete(Hash, const char *, size_t)
Definition: hash/delete.c:48
void * hashAdd(Hash, void *)
Definition: add.c:48
void memCleanup()
Definition: memory.c:862