19 lines
497 B
C
Raw Normal View History

2025-03-16 05:49:29 +01:00
// Written by retoor@molodetz.nl
// This code demonstrates the creation and testing of a hashtable with random keys and ensures the correct retrieval of values.
// Importing rhashtable.h, rtest.h, and rstring.h
// The content is licensed under MIT License.
2025-01-14 18:53:15 +01:00
#include "rhashtable.h"
#include "rtest.h"
#include "rstring.h"
int main() {
for (int i = 0; i < 1000; i++) {
char *key = rgenerate_key();
2025-03-16 05:49:29 +01:00
rset(key, "test");
rasserts(strcmp(rget(key), "test") == 0);
2025-01-14 18:53:15 +01:00
}
}