|
From: <enl...@li...> - 2001-06-12 19:42:12
|
Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewd
Dir : e17/libs/ewd/test
Modified Files:
ewd_hash_test.c ewd_list_test.c
Log Message:
Hash table should be working now, fixed a few issues in the debugging macros,
fixed up the thread code a bit, and lots of small fixes and tweaks. Still need
to work out some performance issues in the hash table.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewd/test/ewd_hash_test.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewd_hash_test.c 2001/05/01 18:57:45 1.1
+++ ewd_hash_test.c 2001/06/12 19:42:11 1.2
@@ -45,20 +45,13 @@
}
/* printf("Got through the first loop\n"); */
- times(&end_buf);
- sys_use = end_buf.tms_stime - start_buf.tms_stime;
- user_use = end_buf.tms_utime - start_buf.tms_utime;
-
- printf("Used %ld ms of system time at halfway point\n", sys_use);
- printf("Used %ld ms of user time at halfway point\n", user_use);
-
while (--i) {
int value;
- printf("Key: %d\t", i);
+/* printf("Key: %d\t", i); */
value = (int)HASH_GET(hash, (void *)i);
- printf("Value: %d\n", value);
- fflush(stdout);
+/* printf("Value: %d\n", value); */
+/* fflush(stdout); */
}
/* printf("Got through the second loop\n"); */
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewd/test/ewd_list_test.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewd_list_test.c 2001/05/03 21:49:03 1.3
+++ ewd_list_test.c 2001/06/12 19:42:11 1.4
@@ -2,7 +2,31 @@
#include <stdlib.h>
#include "Ewd.h"
-#define MAX_VAL 10
+/* #define USE_GLIB */
+
+#ifdef USE_GLIB
+
+#include <glib.h>
+#define LIST GSList
+#define LIST_NEW(arg1, arg2) g_slist_new(arg1, arg2)
+#define LIST_SET(list, key, value) g_list_prepend(hash, value)
+#define LIST_GET(hash, key) g_hash_table_lookup(hash, key)
+#define LIST_REMOVE(hash, key) g_hash_table_remove(hash, key)
+#define LIST_DESTROY(hash) g_hash_table_destroy(hash)
+
+#else
+
+#include "Ewd.h"
+#define LIST Ewd_Hash
+#define LIST_NEW(arg1, arg2) ewd_hash_new(arg1, arg2)
+#define LIST_SET(hash, key, value) ewd_hash_set(hash, key, value)
+#define LIST_GET(hash, key) ewd_hash_get(hash, key)
+#define LIST_REMOVE(hash, key) ewd_hash_remove(hash, key)
+#define LIST_DESTROY(hash) ewd_hash_destroy(hash)
+
+#endif
+
+#define MAX_VAL 100
int main()
{
|