Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-03-14 14:55:59 +0400
committerFelix Fietkau <nbd@openwrt.org>2012-03-14 14:55:59 +0400
commitb1ea9afd605f867409913e10a1bb6d95390dd25b (patch)
tree9e0f888b731bc60963005076c1166bcb93a8665a /examples
parent92da3a9bcc4934c04766e6e60aff254c04e92e97 (diff)
remove uhtbl-test.c, it is obsolete
Diffstat (limited to 'examples')
-rw-r--r--examples/uhtbl-test.c99
1 files changed, 0 insertions, 99 deletions
diff --git a/examples/uhtbl-test.c b/examples/uhtbl-test.c
deleted file mode 100644
index d8f2f32..0000000
--- a/examples/uhtbl-test.c
+++ /dev/null
@@ -1,99 +0,0 @@
-#include "../hash.h"
-#include "../uhtbl.h"
-#include <stdio.h>
-#include <string.h>
-
-struct mybucket {
- uhtbl_head_t __head;
- long double mydata;
-};
-
-int main() {
- printf("%i\n", (int)sizeof(struct mybucket));
-
- uhtbl_t tbl;
- uhtbl_init(&tbl, sizeof(struct mybucket), 16, hash_murmur2, NULL);
- struct mybucket *bucket;
-
- const char *t[] = {"null", "eins", "zwei", "drei", "vier", "fünf", "sechs",
- "sieben", "acht", "neun", "zehn", "elf", "zwölf", "dreizehn",
- "vierzehn", "fünfzehn", "sechzehn", "siebzehn", "achtzehn",
- "neunzehn", "zwanzig", "einundzwanzig", "zweiundzwanzig",
- "dreiundzwanzig", "virundzwanzig", "fünfundzwanzig", "sechsundzwanzig",
- "siebenundzwanzig", "achtundzwanzig", "neunundzwanzig", "dreißig",
- "einunddreißig", "zweiunddreißig"};
- for (int i = 0; i < 33; i++) {
- bucket = (struct mybucket*)uhtbl_set(&tbl, t[i], strlen(t[i]));
- bucket->mydata = i;
- }
-
- uint32_t iter = 0;
- while ((bucket = (struct mybucket*)uhtbl_next(&tbl, &iter))) {
- printf("%i\t", (int)bucket->mydata);
- }
- printf("\nSize: %i, Used: %i\n\n", tbl.size, tbl.used);
-
- for (int i = 0; i < 33; i++) {
- bucket = (struct mybucket*)uhtbl_set(&tbl, 0, i);
- bucket->mydata = i;
- }
-
- iter = 0;
- while ((bucket = (struct mybucket*)uhtbl_next(&tbl, &iter))) {
- printf("%i\t", (int)bucket->mydata);
- }
- printf("\nSize: %i, Used: %i\n\n", tbl.size, tbl.used);
-
- for (int i = 0; i < 33; i++) {
- if (uhtbl_unset(&tbl, 0, i)) {
- printf("Unset failed %i\n", i);
- }
- if (uhtbl_unset(&tbl, t[i], strlen(t[i]))) {
- printf("Unset failed %s\n", t[i]);
- }
- }
-
- iter = 0;
- while ((bucket = (struct mybucket*)uhtbl_next(&tbl, &iter))) {
- printf("%i\t", (int)bucket->mydata);
- }
- printf("\nSize: %i, Used: %i\n\n", tbl.size, tbl.used);
-
- for (int i = 0; i < 33; i++) {
- bucket = (struct mybucket*)uhtbl_set(&tbl, t[i], strlen(t[i]));
- bucket->mydata = i;
- }
-
- for (int i = 0; i < 33; i++) {
- bucket =(struct mybucket*) uhtbl_set(&tbl, 0, i);
- bucket->mydata = i;
- }
-
- for (int i = 0; i < 33; i++) {
- bucket = (struct mybucket*)uhtbl_set(&tbl, t[i], strlen(t[i]));
- bucket->mydata = i;
- }
-
- for (int i = 0; i < 33; i++) {
- bucket = (struct mybucket*)uhtbl_set(&tbl, 0, i);
- bucket->mydata = i;
- }
-
- iter = 0;
- while ((bucket = (struct mybucket*)uhtbl_next(&tbl, &iter))) {
- printf("%i\t", (int)bucket->mydata);
- }
- printf("\nSize: %i, Used: %i\n\n", tbl.size, tbl.used);
-
- for (int i = 0; i < 33; i++) {
- bucket = (struct mybucket*)uhtbl_get(&tbl, t[i], strlen(t[i]));
- printf("%i\t", (int)bucket->mydata);
- bucket = (struct mybucket*)uhtbl_get(&tbl, 0, i);
- printf("%i\t", (int)bucket->mydata);
- }
- printf("\nSize: %i, Used: %i\n\n", tbl.size, tbl.used);
-
- uhtbl_finalize(&tbl);
-
- return 0;
-}