couchbase-memcached 1.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +2 -0
- data/BENCHMARKS +134 -0
- data/CHANGELOG +127 -0
- data/LICENSE +184 -0
- data/Manifest +535 -0
- data/README +118 -0
- data/Rakefile +83 -0
- data/TODO +4 -0
- data/couchbase-memcached.gemspec +33 -0
- data/ext/extconf-make.rb +25 -0
- data/ext/extconf.rb +91 -0
- data/ext/libmemcached-0.50/AUTHORS +11 -0
- data/ext/libmemcached-0.50/COPYING +33 -0
- data/ext/libmemcached-0.50/ChangeLog +392 -0
- data/ext/libmemcached-0.50/Makefile.am +114 -0
- data/ext/libmemcached-0.50/Makefile.in +4232 -0
- data/ext/libmemcached-0.50/NEWS +1 -0
- data/ext/libmemcached-0.50/README +43 -0
- data/ext/libmemcached-0.50/README.FIRST +31 -0
- data/ext/libmemcached-0.50/README.win32 +25 -0
- data/ext/libmemcached-0.50/THANKS +14 -0
- data/ext/libmemcached-0.50/TODO +11 -0
- data/ext/libmemcached-0.50/aclocal.m4 +1077 -0
- data/ext/libmemcached-0.50/clients/client_options.h +45 -0
- data/ext/libmemcached-0.50/clients/execute.cc +131 -0
- data/ext/libmemcached-0.50/clients/execute.h +30 -0
- data/ext/libmemcached-0.50/clients/generator.cc +96 -0
- data/ext/libmemcached-0.50/clients/generator.h +36 -0
- data/ext/libmemcached-0.50/clients/include.am +116 -0
- data/ext/libmemcached-0.50/clients/memaslap.c +908 -0
- data/ext/libmemcached-0.50/clients/memcapable.cc +2094 -0
- data/ext/libmemcached-0.50/clients/memcat.cc +242 -0
- data/ext/libmemcached-0.50/clients/memcp.cc +317 -0
- data/ext/libmemcached-0.50/clients/memdump.cc +183 -0
- data/ext/libmemcached-0.50/clients/memerror.cc +102 -0
- data/ext/libmemcached-0.50/clients/memflush.cc +154 -0
- data/ext/libmemcached-0.50/clients/memparse.cc +68 -0
- data/ext/libmemcached-0.50/clients/memrm.cc +177 -0
- data/ext/libmemcached-0.50/clients/memslap.cc +495 -0
- data/ext/libmemcached-0.50/clients/memstat.cc +349 -0
- data/ext/libmemcached-0.50/clients/ms_atomic.h +69 -0
- data/ext/libmemcached-0.50/clients/ms_conn.c +3413 -0
- data/ext/libmemcached-0.50/clients/ms_conn.h +241 -0
- data/ext/libmemcached-0.50/clients/ms_memslap.h +132 -0
- data/ext/libmemcached-0.50/clients/ms_setting.c +1068 -0
- data/ext/libmemcached-0.50/clients/ms_setting.h +181 -0
- data/ext/libmemcached-0.50/clients/ms_sigsegv.c +126 -0
- data/ext/libmemcached-0.50/clients/ms_sigsegv.h +34 -0
- data/ext/libmemcached-0.50/clients/ms_stats.c +307 -0
- data/ext/libmemcached-0.50/clients/ms_stats.h +69 -0
- data/ext/libmemcached-0.50/clients/ms_task.c +1114 -0
- data/ext/libmemcached-0.50/clients/ms_task.h +94 -0
- data/ext/libmemcached-0.50/clients/ms_thread.c +351 -0
- data/ext/libmemcached-0.50/clients/ms_thread.h +78 -0
- data/ext/libmemcached-0.50/clients/utilities.cc +231 -0
- data/ext/libmemcached-0.50/clients/utilities.h +64 -0
- data/ext/libmemcached-0.50/config.h.in +647 -0
- data/ext/libmemcached-0.50/config/autorun.sh +126 -0
- data/ext/libmemcached-0.50/config/compile +143 -0
- data/ext/libmemcached-0.50/config/config.guess +1517 -0
- data/ext/libmemcached-0.50/config/config.rpath +666 -0
- data/ext/libmemcached-0.50/config/config.sub +1760 -0
- data/ext/libmemcached-0.50/config/depcomp +630 -0
- data/ext/libmemcached-0.50/config/install-sh +520 -0
- data/ext/libmemcached-0.50/config/ltmain.sh +9642 -0
- data/ext/libmemcached-0.50/config/missing +376 -0
- data/ext/libmemcached-0.50/config/pandora-plugin +752 -0
- data/ext/libmemcached-0.50/config/uncrustify.cfg +1112 -0
- data/ext/libmemcached-0.50/configure +27103 -0
- data/ext/libmemcached-0.50/configure.ac +186 -0
- data/ext/libmemcached-0.50/docs/conf.py.in +354 -0
- data/ext/libmemcached-0.50/docs/include.am +240 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_clone.3 +88 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_crc32.3 +105 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_create.3 +88 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_fnv1_32.3 +105 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_fnv1_64.3 +105 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_fnv1a_32.3 +105 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_fnv1a_64.3 +105 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_free.3 +88 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_functions.3 +105 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_hsieh.3 +105 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_is_allocated.3 +88 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_jenkins.3 +105 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_md5.3 +105 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_murmur.3 +105 -0
- data/ext/libmemcached-0.50/docs/man/hashkit_value.3 +66 -0
- data/ext/libmemcached-0.50/docs/man/libhashkit.3 +57 -0
- data/ext/libmemcached-0.50/docs/man/libmemcached.3 +208 -0
- data/ext/libmemcached-0.50/docs/man/libmemcached_check_configuration.3 +293 -0
- data/ext/libmemcached-0.50/docs/man/libmemcached_configuration.3 +293 -0
- data/ext/libmemcached-0.50/docs/man/libmemcached_examples.3 +144 -0
- data/ext/libmemcached-0.50/docs/man/libmemcachedutil.3 +68 -0
- data/ext/libmemcached-0.50/docs/man/memaslap.1 +1222 -0
- data/ext/libmemcached-0.50/docs/man/memcached.3 +293 -0
- data/ext/libmemcached-0.50/docs/man/memcached_add.3 +132 -0
- data/ext/libmemcached-0.50/docs/man/memcached_add_by_key.3 +132 -0
- data/ext/libmemcached-0.50/docs/man/memcached_analyze.3 +77 -0
- data/ext/libmemcached-0.50/docs/man/memcached_append.3 +111 -0
- data/ext/libmemcached-0.50/docs/man/memcached_append_by_key.3 +111 -0
- data/ext/libmemcached-0.50/docs/man/memcached_behavior_get.3 +333 -0
- data/ext/libmemcached-0.50/docs/man/memcached_behavior_set.3 +333 -0
- data/ext/libmemcached-0.50/docs/man/memcached_callback_get.3 +159 -0
- data/ext/libmemcached-0.50/docs/man/memcached_callback_set.3 +159 -0
- data/ext/libmemcached-0.50/docs/man/memcached_cas.3 +91 -0
- data/ext/libmemcached-0.50/docs/man/memcached_cas_by_key.3 +91 -0
- data/ext/libmemcached-0.50/docs/man/memcached_clone.3 +99 -0
- data/ext/libmemcached-0.50/docs/man/memcached_create.3 +99 -0
- data/ext/libmemcached-0.50/docs/man/memcached_decrement.3 +124 -0
- data/ext/libmemcached-0.50/docs/man/memcached_decrement_with_initial.3 +124 -0
- data/ext/libmemcached-0.50/docs/man/memcached_delete.3 +83 -0
- data/ext/libmemcached-0.50/docs/man/memcached_delete_by_key.3 +83 -0
- data/ext/libmemcached-0.50/docs/man/memcached_destroy_sasl_auth_data.3 +95 -0
- data/ext/libmemcached-0.50/docs/man/memcached_dump.3 +77 -0
- data/ext/libmemcached-0.50/docs/man/memcached_fetch.3 +174 -0
- data/ext/libmemcached-0.50/docs/man/memcached_fetch_execute.3 +174 -0
- data/ext/libmemcached-0.50/docs/man/memcached_fetch_result.3 +174 -0
- data/ext/libmemcached-0.50/docs/man/memcached_flush_buffers.3 +72 -0
- data/ext/libmemcached-0.50/docs/man/memcached_free.3 +99 -0
- data/ext/libmemcached-0.50/docs/man/memcached_generate_hash.3 +85 -0
- data/ext/libmemcached-0.50/docs/man/memcached_generate_hash_value.3 +85 -0
- data/ext/libmemcached-0.50/docs/man/memcached_get.3 +174 -0
- data/ext/libmemcached-0.50/docs/man/memcached_get_by_key.3 +174 -0
- data/ext/libmemcached-0.50/docs/man/memcached_get_memory_allocators.3 +111 -0
- data/ext/libmemcached-0.50/docs/man/memcached_get_sasl_callbacks.3 +95 -0
- data/ext/libmemcached-0.50/docs/man/memcached_get_user_data.3 +79 -0
- data/ext/libmemcached-0.50/docs/man/memcached_increment.3 +124 -0
- data/ext/libmemcached-0.50/docs/man/memcached_increment_with_initial.3 +124 -0
- data/ext/libmemcached-0.50/docs/man/memcached_lib_version.3 +76 -0
- data/ext/libmemcached-0.50/docs/man/memcached_mget.3 +174 -0
- data/ext/libmemcached-0.50/docs/man/memcached_mget_by_key.3 +174 -0
- data/ext/libmemcached-0.50/docs/man/memcached_mget_execute.3 +174 -0
- data/ext/libmemcached-0.50/docs/man/memcached_mget_execute_by_key.3 +174 -0
- data/ext/libmemcached-0.50/docs/man/memcached_pool_behavior_get.3 +139 -0
- data/ext/libmemcached-0.50/docs/man/memcached_pool_behavior_set.3 +139 -0
- data/ext/libmemcached-0.50/docs/man/memcached_pool_create.3 +139 -0
- data/ext/libmemcached-0.50/docs/man/memcached_pool_destroy.3 +139 -0
- data/ext/libmemcached-0.50/docs/man/memcached_pool_pop.3 +139 -0
- data/ext/libmemcached-0.50/docs/man/memcached_pool_push.3 +139 -0
- data/ext/libmemcached-0.50/docs/man/memcached_pool_st.3 +139 -0
- data/ext/libmemcached-0.50/docs/man/memcached_prepend.3 +111 -0
- data/ext/libmemcached-0.50/docs/man/memcached_prepend_by_key.3 +111 -0
- data/ext/libmemcached-0.50/docs/man/memcached_quit.3 +74 -0
- data/ext/libmemcached-0.50/docs/man/memcached_replace.3 +132 -0
- data/ext/libmemcached-0.50/docs/man/memcached_replace_by_key.3 +132 -0
- data/ext/libmemcached-0.50/docs/man/memcached_sasl_set_auth_data.3 +95 -0
- data/ext/libmemcached-0.50/docs/man/memcached_server_add.3 +141 -0
- data/ext/libmemcached-0.50/docs/man/memcached_server_count.3 +141 -0
- data/ext/libmemcached-0.50/docs/man/memcached_server_cursor.3 +141 -0
- data/ext/libmemcached-0.50/docs/man/memcached_server_list.3 +141 -0
- data/ext/libmemcached-0.50/docs/man/memcached_server_list_append.3 +111 -0
- data/ext/libmemcached-0.50/docs/man/memcached_server_list_count.3 +111 -0
- data/ext/libmemcached-0.50/docs/man/memcached_server_list_free.3 +111 -0
- data/ext/libmemcached-0.50/docs/man/memcached_server_push.3 +141 -0
- data/ext/libmemcached-0.50/docs/man/memcached_servers_parse.3 +111 -0
- data/ext/libmemcached-0.50/docs/man/memcached_set.3 +132 -0
- data/ext/libmemcached-0.50/docs/man/memcached_set_by_key.3 +132 -0
- data/ext/libmemcached-0.50/docs/man/memcached_set_memory_allocators.3 +111 -0
- data/ext/libmemcached-0.50/docs/man/memcached_set_sasl_callbacks.3 +95 -0
- data/ext/libmemcached-0.50/docs/man/memcached_set_user_data.3 +79 -0
- data/ext/libmemcached-0.50/docs/man/memcached_stat.3 +116 -0
- data/ext/libmemcached-0.50/docs/man/memcached_stat_execute.3 +116 -0
- data/ext/libmemcached-0.50/docs/man/memcached_stat_get_keys.3 +116 -0
- data/ext/libmemcached-0.50/docs/man/memcached_stat_get_value.3 +116 -0
- data/ext/libmemcached-0.50/docs/man/memcached_stat_servername.3 +116 -0
- data/ext/libmemcached-0.50/docs/man/memcached_strerror.3 +69 -0
- data/ext/libmemcached-0.50/docs/man/memcached_verbosity.3 +66 -0
- data/ext/libmemcached-0.50/docs/man/memcached_version.3 +76 -0
- data/ext/libmemcached-0.50/docs/man/memcapable.1 +92 -0
- data/ext/libmemcached-0.50/docs/man/memcat.1 +71 -0
- data/ext/libmemcached-0.50/docs/man/memcp.1 +77 -0
- data/ext/libmemcached-0.50/docs/man/memdump.1 +66 -0
- data/ext/libmemcached-0.50/docs/man/memerror.1 +65 -0
- data/ext/libmemcached-0.50/docs/man/memflush.1 +73 -0
- data/ext/libmemcached-0.50/docs/man/memrm.1 +72 -0
- data/ext/libmemcached-0.50/docs/man/memslap.1 +59 -0
- data/ext/libmemcached-0.50/docs/man/memstat.1 +70 -0
- data/ext/libmemcached-0.50/example/include.am +24 -0
- data/ext/libmemcached-0.50/example/interface_v0.c +594 -0
- data/ext/libmemcached-0.50/example/interface_v1.c +411 -0
- data/ext/libmemcached-0.50/example/memcached_light.c +474 -0
- data/ext/libmemcached-0.50/example/memcached_light.h +7 -0
- data/ext/libmemcached-0.50/example/storage.c +172 -0
- data/ext/libmemcached-0.50/example/storage.h +27 -0
- data/ext/libmemcached-0.50/example/storage_innodb.c +535 -0
- data/ext/libmemcached-0.50/libhashkit/algorithm.cc +69 -0
- data/ext/libmemcached-0.50/libhashkit/algorithm.h +96 -0
- data/ext/libmemcached-0.50/libhashkit/behavior.cc +9 -0
- data/ext/libmemcached-0.50/libhashkit/behavior.h +26 -0
- data/ext/libmemcached-0.50/libhashkit/common.h +33 -0
- data/ext/libmemcached-0.50/libhashkit/configure.h.in +19 -0
- data/ext/libmemcached-0.50/libhashkit/crc32.cc +86 -0
- data/ext/libmemcached-0.50/libhashkit/digest.cc +62 -0
- data/ext/libmemcached-0.50/libhashkit/digest.h +30 -0
- data/ext/libmemcached-0.50/libhashkit/fnv.cc +75 -0
- data/ext/libmemcached-0.50/libhashkit/function.cc +156 -0
- data/ext/libmemcached-0.50/libhashkit/function.h +44 -0
- data/ext/libmemcached-0.50/libhashkit/hashkit.cc +100 -0
- data/ext/libmemcached-0.50/libhashkit/hashkit.h +95 -0
- data/ext/libmemcached-0.50/libhashkit/hashkit.hpp +97 -0
- data/ext/libmemcached-0.50/libhashkit/hsieh.cc +70 -0
- data/ext/libmemcached-0.50/libhashkit/include.am +69 -0
- data/ext/libmemcached-0.50/libhashkit/jenkins.cc +214 -0
- data/ext/libmemcached-0.50/libhashkit/ketama.cc +164 -0
- data/ext/libmemcached-0.50/libhashkit/md5.cc +367 -0
- data/ext/libmemcached-0.50/libhashkit/murmur.cc +77 -0
- data/ext/libmemcached-0.50/libhashkit/one_at_a_time.cc +34 -0
- data/ext/libmemcached-0.50/libhashkit/str_algorithm.cc +58 -0
- data/ext/libmemcached-0.50/libhashkit/str_algorithm.h +48 -0
- data/ext/libmemcached-0.50/libhashkit/strerror.cc +25 -0
- data/ext/libmemcached-0.50/libhashkit/strerror.h +23 -0
- data/ext/libmemcached-0.50/libhashkit/types.h +90 -0
- data/ext/libmemcached-0.50/libhashkit/visibility.h +48 -0
- data/ext/libmemcached-0.50/libmemcached/allocators.cc +119 -0
- data/ext/libmemcached-0.50/libmemcached/allocators.h +87 -0
- data/ext/libmemcached-0.50/libmemcached/analyze.cc +110 -0
- data/ext/libmemcached-0.50/libmemcached/analyze.h +66 -0
- data/ext/libmemcached-0.50/libmemcached/array.c +128 -0
- data/ext/libmemcached-0.50/libmemcached/array.h +75 -0
- data/ext/libmemcached-0.50/libmemcached/auto.cc +383 -0
- data/ext/libmemcached-0.50/libmemcached/auto.h +111 -0
- data/ext/libmemcached-0.50/libmemcached/basic_string.h +55 -0
- data/ext/libmemcached-0.50/libmemcached/behavior.cc +590 -0
- data/ext/libmemcached-0.50/libmemcached/behavior.h +86 -0
- data/ext/libmemcached-0.50/libmemcached/byteorder.cc +90 -0
- data/ext/libmemcached-0.50/libmemcached/byteorder.h +52 -0
- data/ext/libmemcached-0.50/libmemcached/callback.cc +160 -0
- data/ext/libmemcached-0.50/libmemcached/callback.h +61 -0
- data/ext/libmemcached-0.50/libmemcached/common.h +182 -0
- data/ext/libmemcached-0.50/libmemcached/configure.h.in +52 -0
- data/ext/libmemcached-0.50/libmemcached/connect.cc +626 -0
- data/ext/libmemcached-0.50/libmemcached/constants.h +167 -0
- data/ext/libmemcached-0.50/libmemcached/delete.cc +266 -0
- data/ext/libmemcached-0.50/libmemcached/delete.h +57 -0
- data/ext/libmemcached-0.50/libmemcached/do.cc +100 -0
- data/ext/libmemcached-0.50/libmemcached/do.hpp +49 -0
- data/ext/libmemcached-0.50/libmemcached/dump.cc +107 -0
- data/ext/libmemcached-0.50/libmemcached/dump.h +51 -0
- data/ext/libmemcached-0.50/libmemcached/error.cc +419 -0
- data/ext/libmemcached-0.50/libmemcached/error.h +61 -0
- data/ext/libmemcached-0.50/libmemcached/error.hpp +87 -0
- data/ext/libmemcached-0.50/libmemcached/exception.hpp +63 -0
- data/ext/libmemcached-0.50/libmemcached/fetch.cc +267 -0
- data/ext/libmemcached-0.50/libmemcached/fetch.h +53 -0
- data/ext/libmemcached-0.50/libmemcached/flush.cc +149 -0
- data/ext/libmemcached-0.50/libmemcached/flush.h +49 -0
- data/ext/libmemcached-0.50/libmemcached/flush_buffers.cc +66 -0
- data/ext/libmemcached-0.50/libmemcached/flush_buffers.h +49 -0
- data/ext/libmemcached-0.50/libmemcached/get.cc +842 -0
- data/ext/libmemcached-0.50/libmemcached/get.h +135 -0
- data/ext/libmemcached-0.50/libmemcached/hash.cc +178 -0
- data/ext/libmemcached-0.50/libmemcached/hash.h +68 -0
- data/ext/libmemcached-0.50/libmemcached/hosts.cc +516 -0
- data/ext/libmemcached-0.50/libmemcached/include.am +183 -0
- data/ext/libmemcached-0.50/libmemcached/initialize_query.cc +70 -0
- data/ext/libmemcached-0.50/libmemcached/initialize_query.h +51 -0
- data/ext/libmemcached-0.50/libmemcached/internal.h +46 -0
- data/ext/libmemcached-0.50/libmemcached/io.cc +920 -0
- data/ext/libmemcached-0.50/libmemcached/io.h +119 -0
- data/ext/libmemcached-0.50/libmemcached/is.h +48 -0
- data/ext/libmemcached-0.50/libmemcached/key.cc +23 -0
- data/ext/libmemcached-0.50/libmemcached/libmemcached_probes.d +30 -0
- data/ext/libmemcached-0.50/libmemcached/libmemcached_probes.h +118 -0
- data/ext/libmemcached-0.50/libmemcached/memcached.cc +437 -0
- data/ext/libmemcached-0.50/libmemcached/memcached.h +214 -0
- data/ext/libmemcached-0.50/libmemcached/memcached.hpp +799 -0
- data/ext/libmemcached-0.50/libmemcached/memcached/README.txt +7 -0
- data/ext/libmemcached-0.50/libmemcached/memcached/protocol_binary.h +726 -0
- data/ext/libmemcached-0.50/libmemcached/memcached/vbucket.h +26 -0
- data/ext/libmemcached-0.50/libmemcached/memcached_util.h +44 -0
- data/ext/libmemcached-0.50/libmemcached/memory.h +79 -0
- data/ext/libmemcached-0.50/libmemcached/options.cc +178 -0
- data/ext/libmemcached-0.50/libmemcached/options.h +49 -0
- data/ext/libmemcached-0.50/libmemcached/options.hpp +56 -0
- data/ext/libmemcached-0.50/libmemcached/options/context.h +151 -0
- data/ext/libmemcached-0.50/libmemcached/options/include.am +19 -0
- data/ext/libmemcached-0.50/libmemcached/options/parser.am +0 -0
- data/ext/libmemcached-0.50/libmemcached/options/parser.cc +2324 -0
- data/ext/libmemcached-0.50/libmemcached/options/parser.h +122 -0
- data/ext/libmemcached-0.50/libmemcached/options/scanner.cc +3203 -0
- data/ext/libmemcached-0.50/libmemcached/options/scanner.h +479 -0
- data/ext/libmemcached-0.50/libmemcached/options/server.h +60 -0
- data/ext/libmemcached-0.50/libmemcached/options/symbol.h +57 -0
- data/ext/libmemcached-0.50/libmemcached/parse.cc +110 -0
- data/ext/libmemcached-0.50/libmemcached/parse.h +23 -0
- data/ext/libmemcached-0.50/libmemcached/platform.h +56 -0
- data/ext/libmemcached-0.50/libmemcached/prefix_key.cc +65 -0
- data/ext/libmemcached-0.50/libmemcached/prefix_key.h +49 -0
- data/ext/libmemcached-0.50/libmemcached/protocol/ascii_handler.c +963 -0
- data/ext/libmemcached-0.50/libmemcached/protocol/ascii_handler.h +40 -0
- data/ext/libmemcached-0.50/libmemcached/protocol/binary_handler.c +1121 -0
- data/ext/libmemcached-0.50/libmemcached/protocol/binary_handler.h +47 -0
- data/ext/libmemcached-0.50/libmemcached/protocol/cache.c +149 -0
- data/ext/libmemcached-0.50/libmemcached/protocol/cache.h +116 -0
- data/ext/libmemcached-0.50/libmemcached/protocol/callback.h +418 -0
- data/ext/libmemcached-0.50/libmemcached/protocol/common.h +163 -0
- data/ext/libmemcached-0.50/libmemcached/protocol/include.am +26 -0
- data/ext/libmemcached-0.50/libmemcached/protocol/pedantic.c +202 -0
- data/ext/libmemcached-0.50/libmemcached/protocol/protocol_handler.c +365 -0
- data/ext/libmemcached-0.50/libmemcached/protocol_handler.h +215 -0
- data/ext/libmemcached-0.50/libmemcached/purge.cc +90 -0
- data/ext/libmemcached-0.50/libmemcached/quit.cc +139 -0
- data/ext/libmemcached-0.50/libmemcached/quit.h +55 -0
- data/ext/libmemcached-0.50/libmemcached/response.cc +619 -0
- data/ext/libmemcached-0.50/libmemcached/response.h +57 -0
- data/ext/libmemcached-0.50/libmemcached/result.cc +173 -0
- data/ext/libmemcached-0.50/libmemcached/result.h +100 -0
- data/ext/libmemcached-0.50/libmemcached/return.h +98 -0
- data/ext/libmemcached-0.50/libmemcached/sasl.c +408 -0
- data/ext/libmemcached-0.50/libmemcached/sasl.h +86 -0
- data/ext/libmemcached-0.50/libmemcached/server.cc +351 -0
- data/ext/libmemcached-0.50/libmemcached/server.h +169 -0
- data/ext/libmemcached-0.50/libmemcached/server_list.cc +88 -0
- data/ext/libmemcached-0.50/libmemcached/server_list.h +77 -0
- data/ext/libmemcached-0.50/libmemcached/stats.cc +623 -0
- data/ext/libmemcached-0.50/libmemcached/stats.h +96 -0
- data/ext/libmemcached-0.50/libmemcached/storage.cc +567 -0
- data/ext/libmemcached-0.50/libmemcached/storage.h +133 -0
- data/ext/libmemcached-0.50/libmemcached/strerror.cc +189 -0
- data/ext/libmemcached-0.50/libmemcached/strerror.h +50 -0
- data/ext/libmemcached-0.50/libmemcached/string.cc +253 -0
- data/ext/libmemcached-0.50/libmemcached/string.h +121 -0
- data/ext/libmemcached-0.50/libmemcached/touch.cc +106 -0
- data/ext/libmemcached-0.50/libmemcached/touch.h +59 -0
- data/ext/libmemcached-0.50/libmemcached/types.h +117 -0
- data/ext/libmemcached-0.50/libmemcached/util.h +40 -0
- data/ext/libmemcached-0.50/libmemcached/util/flush.cc +61 -0
- data/ext/libmemcached-0.50/libmemcached/util/flush.h +50 -0
- data/ext/libmemcached-0.50/libmemcached/util/include.am +34 -0
- data/ext/libmemcached-0.50/libmemcached/util/ping.cc +62 -0
- data/ext/libmemcached-0.50/libmemcached/util/ping.h +49 -0
- data/ext/libmemcached-0.50/libmemcached/util/pool.cc +392 -0
- data/ext/libmemcached-0.50/libmemcached/util/pool.h +78 -0
- data/ext/libmemcached-0.50/libmemcached/util/version.cc +87 -0
- data/ext/libmemcached-0.50/libmemcached/util/version.h +53 -0
- data/ext/libmemcached-0.50/libmemcached/verbosity.cc +97 -0
- data/ext/libmemcached-0.50/libmemcached/verbosity.h +50 -0
- data/ext/libmemcached-0.50/libmemcached/version.cc +214 -0
- data/ext/libmemcached-0.50/libmemcached/version.h +52 -0
- data/ext/libmemcached-0.50/libmemcached/virtual_bucket.c +118 -0
- data/ext/libmemcached-0.50/libmemcached/virtual_bucket.h +59 -0
- data/ext/libmemcached-0.50/libmemcached/visibility.h +51 -0
- data/ext/libmemcached-0.50/libmemcached/watchpoint.h +110 -0
- data/ext/libmemcached-0.50/libtest/callbacks.h +21 -0
- data/ext/libmemcached-0.50/libtest/collection.h +19 -0
- data/ext/libmemcached-0.50/libtest/common.h +50 -0
- data/ext/libmemcached-0.50/libtest/core.h +11 -0
- data/ext/libmemcached-0.50/libtest/error.h +18 -0
- data/ext/libmemcached-0.50/libtest/failed.h +52 -0
- data/ext/libmemcached-0.50/libtest/framework.cc +57 -0
- data/ext/libmemcached-0.50/libtest/framework.h +137 -0
- data/ext/libmemcached-0.50/libtest/get.h +22 -0
- data/ext/libmemcached-0.50/libtest/include.am +52 -0
- data/ext/libmemcached-0.50/libtest/runner.h +19 -0
- data/ext/libmemcached-0.50/libtest/server.c +355 -0
- data/ext/libmemcached-0.50/libtest/server.h +43 -0
- data/ext/libmemcached-0.50/libtest/stats.h +30 -0
- data/ext/libmemcached-0.50/libtest/strerror.h +14 -0
- data/ext/libmemcached-0.50/libtest/test.cc +319 -0
- data/ext/libmemcached-0.50/libtest/test.h +162 -0
- data/ext/libmemcached-0.50/libtest/test.hpp +46 -0
- data/ext/libmemcached-0.50/libtest/visibility.h +69 -0
- data/ext/libmemcached-0.50/m4/ac_cxx_header_stdcxx_98.m4 +83 -0
- data/ext/libmemcached-0.50/m4/acx_pthread.m4 +271 -0
- data/ext/libmemcached-0.50/m4/byteorder.m4 +19 -0
- data/ext/libmemcached-0.50/m4/deprecated.m4 +17 -0
- data/ext/libmemcached-0.50/m4/eagain.m4 +28 -0
- data/ext/libmemcached-0.50/m4/enable_utillib.m4 +16 -0
- data/ext/libmemcached-0.50/m4/gettext.m4 +379 -0
- data/ext/libmemcached-0.50/m4/hsieh.m4 +18 -0
- data/ext/libmemcached-0.50/m4/iconv.m4 +214 -0
- data/ext/libmemcached-0.50/m4/lib-ld.m4 +110 -0
- data/ext/libmemcached-0.50/m4/lib-link.m4 +767 -0
- data/ext/libmemcached-0.50/m4/lib-prefix.m4 +221 -0
- data/ext/libmemcached-0.50/m4/libtool.m4 +7851 -0
- data/ext/libmemcached-0.50/m4/ltoptions.m4 +369 -0
- data/ext/libmemcached-0.50/m4/ltsugar.m4 +123 -0
- data/ext/libmemcached-0.50/m4/ltversion.m4 +23 -0
- data/ext/libmemcached-0.50/m4/lt~obsolete.m4 +98 -0
- data/ext/libmemcached-0.50/m4/memaslap.m4 +9 -0
- data/ext/libmemcached-0.50/m4/memcached.m4 +31 -0
- data/ext/libmemcached-0.50/m4/murmur.m4 +18 -0
- data/ext/libmemcached-0.50/m4/pandora_64bit.m4 +60 -0
- data/ext/libmemcached-0.50/m4/pandora_bison.m4 +33 -0
- data/ext/libmemcached-0.50/m4/pandora_canonical.m4 +418 -0
- data/ext/libmemcached-0.50/m4/pandora_check_compiler_version.m4 +37 -0
- data/ext/libmemcached-0.50/m4/pandora_check_cxx_standard.m4 +23 -0
- data/ext/libmemcached-0.50/m4/pandora_cinttypes.m4 +39 -0
- data/ext/libmemcached-0.50/m4/pandora_clock_gettime.m4 +15 -0
- data/ext/libmemcached-0.50/m4/pandora_compile_stdcxx_0x.m4 +103 -0
- data/ext/libmemcached-0.50/m4/pandora_cstdint.m4 +38 -0
- data/ext/libmemcached-0.50/m4/pandora_cxx_demangle.m4 +27 -0
- data/ext/libmemcached-0.50/m4/pandora_enable_dtrace.m4 +60 -0
- data/ext/libmemcached-0.50/m4/pandora_ensure_gcc_version.m4 +62 -0
- data/ext/libmemcached-0.50/m4/pandora_extensions.m4 +16 -0
- data/ext/libmemcached-0.50/m4/pandora_fdatasync.m4 +25 -0
- data/ext/libmemcached-0.50/m4/pandora_flex.m4 +33 -0
- data/ext/libmemcached-0.50/m4/pandora_have_better_malloc.m4 +66 -0
- data/ext/libmemcached-0.50/m4/pandora_have_boost.m4 +93 -0
- data/ext/libmemcached-0.50/m4/pandora_have_gcc_atomics.m4 +37 -0
- data/ext/libmemcached-0.50/m4/pandora_have_innodb.m4 +41 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libaio.m4 +56 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libavahi.m4 +41 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libbdb.m4 +40 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libboost_date_time.m4 +46 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libboost_filesystem.m4 +47 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libboost_iostreams.m4 +49 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libboost_options.m4 +47 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libboost_regex.m4 +54 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libboost_test.m4 +45 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libboost_thread.m4 +54 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libcassandra.m4 +44 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libcurl.m4 +62 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libdl.m4 +51 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libdrizzle.m4 +61 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libevent.m4 +66 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libgearman.m4 +41 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libgtest.m4 +47 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libhaildb.m4 +43 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libhashkit.m4 +42 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libinnodb.m4 +64 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libldap.m4 +73 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libmemcached.m4 +106 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libmysqlclient.m4 +146 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libndbclient.m4 +80 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libpcre.m4 +73 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libpq.m4 +46 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libpqxx.m4 +44 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libsqlite3.m4 +42 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libtokyocabinet.m4 +54 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libuuid.m4 +55 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libvbucket.m4 +40 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libxml2.m4 +52 -0
- data/ext/libmemcached-0.50/m4/pandora_have_libz.m4 +51 -0
- data/ext/libmemcached-0.50/m4/pandora_have_protobuf.m4 +82 -0
- data/ext/libmemcached-0.50/m4/pandora_have_sasl.m4 +133 -0
- data/ext/libmemcached-0.50/m4/pandora_have_thrift.m4 +45 -0
- data/ext/libmemcached-0.50/m4/pandora_header_assert.m4 +23 -0
- data/ext/libmemcached-0.50/m4/pandora_header_stdcxx_98.m4 +83 -0
- data/ext/libmemcached-0.50/m4/pandora_intltool.m4 +225 -0
- data/ext/libmemcached-0.50/m4/pandora_libtool.m4 +25 -0
- data/ext/libmemcached-0.50/m4/pandora_optimize.m4 +75 -0
- data/ext/libmemcached-0.50/m4/pandora_platform.m4 +117 -0
- data/ext/libmemcached-0.50/m4/pandora_plugins.m4 +62 -0
- data/ext/libmemcached-0.50/m4/pandora_print_callstack.m4 +61 -0
- data/ext/libmemcached-0.50/m4/pandora_pthread.m4 +258 -0
- data/ext/libmemcached-0.50/m4/pandora_python3_devel.m4 +236 -0
- data/ext/libmemcached-0.50/m4/pandora_run_cpplint.m4 +8 -0
- data/ext/libmemcached-0.50/m4/pandora_sasl.m4 +133 -0
- data/ext/libmemcached-0.50/m4/pandora_shared_ptr.m4 +59 -0
- data/ext/libmemcached-0.50/m4/pandora_stack_direction.m4 +39 -0
- data/ext/libmemcached-0.50/m4/pandora_stl_hash.m4 +94 -0
- data/ext/libmemcached-0.50/m4/pandora_swig.m4 +39 -0
- data/ext/libmemcached-0.50/m4/pandora_use_pipe.m4 +36 -0
- data/ext/libmemcached-0.50/m4/pandora_vc_build.m4 +168 -0
- data/ext/libmemcached-0.50/m4/pandora_version.m4 +11 -0
- data/ext/libmemcached-0.50/m4/pandora_visibility.m4 +75 -0
- data/ext/libmemcached-0.50/m4/pandora_warnings.m4 +447 -0
- data/ext/libmemcached-0.50/m4/pandora_with_gettext.m4 +44 -0
- data/ext/libmemcached-0.50/m4/pandora_with_lua.m4 +55 -0
- data/ext/libmemcached-0.50/m4/pandora_with_memcached.m4 +41 -0
- data/ext/libmemcached-0.50/m4/pandora_with_perl.m4 +81 -0
- data/ext/libmemcached-0.50/m4/pandora_with_php.m4 +56 -0
- data/ext/libmemcached-0.50/m4/pandora_with_python.m4 +37 -0
- data/ext/libmemcached-0.50/m4/pandora_with_python3.m4 +44 -0
- data/ext/libmemcached-0.50/m4/pandora_with_r.m4 +33 -0
- data/ext/libmemcached-0.50/m4/pandora_with_ruby.m4 +79 -0
- data/ext/libmemcached-0.50/m4/pandora_with_valgrind.m4 +17 -0
- data/ext/libmemcached-0.50/m4/pkg.m4 +157 -0
- data/ext/libmemcached-0.50/m4/po.m4 +449 -0
- data/ext/libmemcached-0.50/m4/progtest.m4 +92 -0
- data/ext/libmemcached-0.50/m4/protocol_binary.m4 +36 -0
- data/ext/libmemcached-0.50/m4/setsockopt.m4 +73 -0
- data/ext/libmemcached-0.50/m4/socket_send_flags.m4 +66 -0
- data/ext/libmemcached-0.50/poll/include.am +8 -0
- data/ext/libmemcached-0.50/poll/poll.c +77 -0
- data/ext/libmemcached-0.50/poll/poll.h +45 -0
- data/ext/libmemcached-0.50/support/include.am +11 -0
- data/ext/libmemcached-0.50/support/libmemcached-fc.spec.in +105 -0
- data/ext/libmemcached-0.50/support/libmemcached.pc.in +10 -0
- data/ext/libmemcached-0.50/support/libmemcached.spec.in +281 -0
- data/ext/libmemcached-0.50/support/set_benchmark.sh +5 -0
- data/ext/libmemcached-0.50/tests/atomsmasher.cc +295 -0
- data/ext/libmemcached-0.50/tests/basic.cc +134 -0
- data/ext/libmemcached-0.50/tests/basic.h +66 -0
- data/ext/libmemcached-0.50/tests/cpp_example.cc +195 -0
- data/ext/libmemcached-0.50/tests/deprecated.cc +72 -0
- data/ext/libmemcached-0.50/tests/deprecated.h +49 -0
- data/ext/libmemcached-0.50/tests/error_conditions.cc +63 -0
- data/ext/libmemcached-0.50/tests/error_conditions.h +48 -0
- data/ext/libmemcached-0.50/tests/hash_plus.cc +225 -0
- data/ext/libmemcached-0.50/tests/hash_results.h +127 -0
- data/ext/libmemcached-0.50/tests/hashkit_functions.cc +619 -0
- data/ext/libmemcached-0.50/tests/include.am +342 -0
- data/ext/libmemcached-0.50/tests/ketama_test_cases.h +121 -0
- data/ext/libmemcached-0.50/tests/ketama_test_cases_spy.h +118 -0
- data/ext/libmemcached-0.50/tests/libmemcached_world.h +205 -0
- data/ext/libmemcached-0.50/tests/mem_functions.cc +6648 -0
- data/ext/libmemcached-0.50/tests/mem_udp.cc +510 -0
- data/ext/libmemcached-0.50/tests/output_plus.res +5 -0
- data/ext/libmemcached-0.50/tests/parser.cc +599 -0
- data/ext/libmemcached-0.50/tests/parser.h +109 -0
- data/ext/libmemcached-0.50/tests/plus.cpp +240 -0
- data/ext/libmemcached-0.50/tests/pool.cc +78 -0
- data/ext/libmemcached-0.50/tests/pool.h +49 -0
- data/ext/libmemcached-0.50/tests/print.cc +58 -0
- data/ext/libmemcached-0.50/tests/print.h +51 -0
- data/ext/libmemcached-0.50/tests/replication.cc +333 -0
- data/ext/libmemcached-0.50/tests/replication.h +64 -0
- data/ext/libmemcached-0.50/tests/start.cc +29 -0
- data/ext/libmemcached-0.50/tests/string.cc +174 -0
- data/ext/libmemcached-0.50/tests/string.h +67 -0
- data/ext/libmemcached-0.50/tests/virtual_buckets.cc +143 -0
- data/ext/libmemcached-0.50/tests/virtual_buckets.h +51 -0
- data/ext/libmemcached-0.50/win32/include.am +11 -0
- data/ext/libmemcached-0.50/win32/wrappers.h +55 -0
- data/ext/rlibmemcached.i +263 -0
- data/ext/rlibmemcached_wrap.c +16732 -0
- data/lib/memcached.rb +32 -0
- data/lib/memcached/auth.rb +16 -0
- data/lib/memcached/behaviors.rb +77 -0
- data/lib/memcached/exceptions.rb +84 -0
- data/lib/memcached/experimental.rb +48 -0
- data/lib/memcached/memcached.rb +660 -0
- data/lib/memcached/rails.rb +133 -0
- data/test/profile/benchmark.rb +245 -0
- data/test/profile/c_profiler.rb +14 -0
- data/test/profile/exercise.rb +185 -0
- data/test/profile/rb_profiler.rb +21 -0
- data/test/profile/valgrind.rb +10 -0
- data/test/setup.rb +30 -0
- data/test/teardown.rb +0 -0
- data/test/test_helper.rb +19 -0
- data/test/unit/binding_test.rb +8 -0
- data/test/unit/memcached_experimental_test.rb +274 -0
- data/test/unit/memcached_test.rb +1293 -0
- data/test/unit/rails_test.rb +122 -0
- metadata +650 -0
- metadata.gz.sig +0 -0
@@ -0,0 +1,619 @@
|
|
1
|
+
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
2
|
+
*
|
3
|
+
* libHashKit Functions Test
|
4
|
+
*
|
5
|
+
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
|
6
|
+
* Copyright (C) 2006-2009 Brian Aker All rights reserved.
|
7
|
+
*
|
8
|
+
* Redistribution and use in source and binary forms, with or without
|
9
|
+
* modification, are permitted provided that the following conditions are
|
10
|
+
* met:
|
11
|
+
*
|
12
|
+
* * Redistributions of source code must retain the above copyright
|
13
|
+
* notice, this list of conditions and the following disclaimer.
|
14
|
+
*
|
15
|
+
* * Redistributions in binary form must reproduce the above
|
16
|
+
* copyright notice, this list of conditions and the following disclaimer
|
17
|
+
* in the documentation and/or other materials provided with the
|
18
|
+
* distribution.
|
19
|
+
*
|
20
|
+
* * The names of its contributors may not be used to endorse or
|
21
|
+
* promote products derived from this software without specific prior
|
22
|
+
* written permission.
|
23
|
+
*
|
24
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
25
|
+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
26
|
+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
27
|
+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
28
|
+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
29
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
30
|
+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
31
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
32
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
33
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
34
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
35
|
+
*
|
36
|
+
*/
|
37
|
+
|
38
|
+
#include <libtest/common.h>
|
39
|
+
|
40
|
+
#include <assert.h>
|
41
|
+
#include <stdio.h>
|
42
|
+
#include <stdlib.h>
|
43
|
+
#include <string.h>
|
44
|
+
|
45
|
+
#include <libhashkit/hashkit.h>
|
46
|
+
|
47
|
+
#include "hash_results.h"
|
48
|
+
|
49
|
+
static hashkit_st global_hashk;
|
50
|
+
|
51
|
+
/**
|
52
|
+
@brief hash_test_st is a structure we use in testing. It is currently empty.
|
53
|
+
*/
|
54
|
+
typedef struct hash_test_st hash_test_st;
|
55
|
+
|
56
|
+
struct hash_test_st
|
57
|
+
{
|
58
|
+
bool _unused;
|
59
|
+
};
|
60
|
+
|
61
|
+
static test_return_t init_test(void *not_used)
|
62
|
+
{
|
63
|
+
hashkit_st hashk;
|
64
|
+
hashkit_st *hashk_ptr;
|
65
|
+
(void)not_used;
|
66
|
+
|
67
|
+
hashk_ptr= hashkit_create(&hashk);
|
68
|
+
test_true(hashk_ptr);
|
69
|
+
test_true(hashk_ptr == &hashk);
|
70
|
+
test_true(hashkit_is_allocated(hashk_ptr) == false);
|
71
|
+
|
72
|
+
hashkit_free(hashk_ptr);
|
73
|
+
|
74
|
+
return TEST_SUCCESS;
|
75
|
+
}
|
76
|
+
|
77
|
+
static test_return_t allocation_test(void *not_used)
|
78
|
+
{
|
79
|
+
hashkit_st *hashk_ptr;
|
80
|
+
(void)not_used;
|
81
|
+
|
82
|
+
hashk_ptr= hashkit_create(NULL);
|
83
|
+
test_true(hashk_ptr);
|
84
|
+
test_true(hashkit_is_allocated(hashk_ptr) == true);
|
85
|
+
hashkit_free(hashk_ptr);
|
86
|
+
|
87
|
+
return TEST_SUCCESS;
|
88
|
+
}
|
89
|
+
|
90
|
+
static test_return_t clone_test(hashkit_st *hashk)
|
91
|
+
{
|
92
|
+
// First we make sure that the testing system is giving us what we expect.
|
93
|
+
assert(&global_hashk == hashk);
|
94
|
+
|
95
|
+
// Second we test if hashk is even valid
|
96
|
+
|
97
|
+
/* All null? */
|
98
|
+
{
|
99
|
+
hashkit_st *hashk_ptr;
|
100
|
+
hashk_ptr= hashkit_clone(NULL, NULL);
|
101
|
+
test_true(hashk_ptr);
|
102
|
+
test_true(hashkit_is_allocated(hashk_ptr));
|
103
|
+
hashkit_free(hashk_ptr);
|
104
|
+
}
|
105
|
+
|
106
|
+
/* Can we init from null? */
|
107
|
+
{
|
108
|
+
hashkit_st *hashk_ptr;
|
109
|
+
|
110
|
+
hashk_ptr= hashkit_clone(NULL, hashk);
|
111
|
+
|
112
|
+
test_true(hashk_ptr);
|
113
|
+
test_true(hashkit_is_allocated(hashk_ptr));
|
114
|
+
|
115
|
+
hashkit_free(hashk_ptr);
|
116
|
+
}
|
117
|
+
|
118
|
+
/* Can we init from struct? */
|
119
|
+
{
|
120
|
+
hashkit_st declared_clone;
|
121
|
+
hashkit_st *hash_clone;
|
122
|
+
|
123
|
+
hash_clone= hashkit_clone(&declared_clone, NULL);
|
124
|
+
test_true(hash_clone);
|
125
|
+
test_true(hash_clone == &declared_clone);
|
126
|
+
test_false(hashkit_is_allocated(hash_clone));
|
127
|
+
|
128
|
+
hashkit_free(hash_clone);
|
129
|
+
}
|
130
|
+
|
131
|
+
/* Can we init from struct? */
|
132
|
+
{
|
133
|
+
hashkit_st declared_clone;
|
134
|
+
hashkit_st *hash_clone;
|
135
|
+
|
136
|
+
hash_clone= hashkit_clone(&declared_clone, hashk);
|
137
|
+
test_true(hash_clone);
|
138
|
+
test_true(hash_clone == &declared_clone);
|
139
|
+
test_false(hashkit_is_allocated(hash_clone));
|
140
|
+
|
141
|
+
hashkit_free(hash_clone);
|
142
|
+
}
|
143
|
+
|
144
|
+
return TEST_SUCCESS;
|
145
|
+
}
|
146
|
+
|
147
|
+
static test_return_t one_at_a_time_run (hashkit_st *hashk)
|
148
|
+
{
|
149
|
+
uint32_t x;
|
150
|
+
const char **ptr;
|
151
|
+
(void)hashk;
|
152
|
+
|
153
|
+
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
|
154
|
+
{
|
155
|
+
uint32_t hash_val;
|
156
|
+
|
157
|
+
hash_val= libhashkit_one_at_a_time(*ptr, strlen(*ptr));
|
158
|
+
test_true(one_at_a_time_values[x] == hash_val);
|
159
|
+
}
|
160
|
+
|
161
|
+
return TEST_SUCCESS;
|
162
|
+
}
|
163
|
+
|
164
|
+
static test_return_t md5_run (hashkit_st *hashk)
|
165
|
+
{
|
166
|
+
uint32_t x;
|
167
|
+
const char **ptr;
|
168
|
+
(void)hashk;
|
169
|
+
|
170
|
+
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
|
171
|
+
{
|
172
|
+
uint32_t hash_val;
|
173
|
+
|
174
|
+
hash_val= libhashkit_md5(*ptr, strlen(*ptr));
|
175
|
+
test_true(md5_values[x] == hash_val);
|
176
|
+
}
|
177
|
+
|
178
|
+
return TEST_SUCCESS;
|
179
|
+
}
|
180
|
+
|
181
|
+
static test_return_t crc_run (hashkit_st *hashk)
|
182
|
+
{
|
183
|
+
uint32_t x;
|
184
|
+
const char **ptr;
|
185
|
+
(void)hashk;
|
186
|
+
|
187
|
+
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
|
188
|
+
{
|
189
|
+
uint32_t hash_val;
|
190
|
+
|
191
|
+
hash_val= libhashkit_crc32(*ptr, strlen(*ptr));
|
192
|
+
assert(crc_values[x] == hash_val);
|
193
|
+
}
|
194
|
+
|
195
|
+
return TEST_SUCCESS;
|
196
|
+
}
|
197
|
+
|
198
|
+
static test_return_t fnv1_64_run (hashkit_st *hashk)
|
199
|
+
{
|
200
|
+
uint32_t x;
|
201
|
+
const char **ptr;
|
202
|
+
(void)hashk;
|
203
|
+
|
204
|
+
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
|
205
|
+
{
|
206
|
+
uint32_t hash_val;
|
207
|
+
|
208
|
+
hash_val= libhashkit_fnv1_64(*ptr, strlen(*ptr));
|
209
|
+
assert(fnv1_64_values[x] == hash_val);
|
210
|
+
}
|
211
|
+
|
212
|
+
return TEST_SUCCESS;
|
213
|
+
}
|
214
|
+
|
215
|
+
static test_return_t fnv1a_64_run (hashkit_st *hashk)
|
216
|
+
{
|
217
|
+
uint32_t x;
|
218
|
+
const char **ptr;
|
219
|
+
(void)hashk;
|
220
|
+
|
221
|
+
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
|
222
|
+
{
|
223
|
+
uint32_t hash_val;
|
224
|
+
|
225
|
+
hash_val= libhashkit_fnv1a_64(*ptr, strlen(*ptr));
|
226
|
+
assert(fnv1a_64_values[x] == hash_val);
|
227
|
+
}
|
228
|
+
|
229
|
+
return TEST_SUCCESS;
|
230
|
+
}
|
231
|
+
|
232
|
+
static test_return_t fnv1_32_run (hashkit_st *hashk)
|
233
|
+
{
|
234
|
+
uint32_t x;
|
235
|
+
const char **ptr;
|
236
|
+
(void)hashk;
|
237
|
+
|
238
|
+
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
|
239
|
+
{
|
240
|
+
uint32_t hash_val;
|
241
|
+
|
242
|
+
hash_val= libhashkit_fnv1_32(*ptr, strlen(*ptr));
|
243
|
+
assert(fnv1_32_values[x] == hash_val);
|
244
|
+
}
|
245
|
+
|
246
|
+
return TEST_SUCCESS;
|
247
|
+
}
|
248
|
+
|
249
|
+
static test_return_t fnv1a_32_run (hashkit_st *hashk)
|
250
|
+
{
|
251
|
+
uint32_t x;
|
252
|
+
const char **ptr;
|
253
|
+
(void)hashk;
|
254
|
+
|
255
|
+
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
|
256
|
+
{
|
257
|
+
uint32_t hash_val;
|
258
|
+
|
259
|
+
hash_val= libhashkit_fnv1a_32(*ptr, strlen(*ptr));
|
260
|
+
assert(fnv1a_32_values[x] == hash_val);
|
261
|
+
}
|
262
|
+
|
263
|
+
return TEST_SUCCESS;
|
264
|
+
}
|
265
|
+
|
266
|
+
static test_return_t hsieh_run (hashkit_st *hashk)
|
267
|
+
{
|
268
|
+
uint32_t x;
|
269
|
+
const char **ptr;
|
270
|
+
(void)hashk;
|
271
|
+
|
272
|
+
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
|
273
|
+
{
|
274
|
+
uint32_t hash_val;
|
275
|
+
|
276
|
+
#ifdef HAVE_HSIEH_HASH
|
277
|
+
hash_val= libhashkit_hsieh(*ptr, strlen(*ptr));
|
278
|
+
#else
|
279
|
+
hash_val= 1;
|
280
|
+
#endif
|
281
|
+
assert(hsieh_values[x] == hash_val);
|
282
|
+
}
|
283
|
+
|
284
|
+
return TEST_SUCCESS;
|
285
|
+
}
|
286
|
+
|
287
|
+
static test_return_t murmur_run (hashkit_st *hashk)
|
288
|
+
{
|
289
|
+
(void)hashk;
|
290
|
+
|
291
|
+
#ifdef WORDS_BIGENDIAN
|
292
|
+
(void)murmur_values;
|
293
|
+
return TEST_SKIPPED;
|
294
|
+
#else
|
295
|
+
uint32_t x;
|
296
|
+
const char **ptr;
|
297
|
+
|
298
|
+
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
|
299
|
+
{
|
300
|
+
uint32_t hash_val;
|
301
|
+
|
302
|
+
#ifdef HAVE_MURMUR_HASH
|
303
|
+
hash_val= libhashkit_murmur(*ptr, strlen(*ptr));
|
304
|
+
#else
|
305
|
+
hash_val= 1;
|
306
|
+
#endif
|
307
|
+
assert(murmur_values[x] == hash_val);
|
308
|
+
}
|
309
|
+
|
310
|
+
return TEST_SUCCESS;
|
311
|
+
#endif
|
312
|
+
}
|
313
|
+
|
314
|
+
static test_return_t jenkins_run (hashkit_st *hashk)
|
315
|
+
{
|
316
|
+
uint32_t x;
|
317
|
+
const char **ptr;
|
318
|
+
(void)hashk;
|
319
|
+
|
320
|
+
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
|
321
|
+
{
|
322
|
+
uint32_t hash_val;
|
323
|
+
|
324
|
+
hash_val= libhashkit_jenkins(*ptr, strlen(*ptr));
|
325
|
+
assert(jenkins_values[x] == hash_val);
|
326
|
+
}
|
327
|
+
|
328
|
+
return TEST_SUCCESS;
|
329
|
+
}
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
/**
|
335
|
+
@brief now we list out the tests.
|
336
|
+
*/
|
337
|
+
|
338
|
+
test_st allocation[]= {
|
339
|
+
{"init", 0, (test_callback_fn*)init_test},
|
340
|
+
{"create and free", 0, (test_callback_fn*)allocation_test},
|
341
|
+
{"clone", 0, (test_callback_fn*)clone_test},
|
342
|
+
{0, 0, 0}
|
343
|
+
};
|
344
|
+
|
345
|
+
static test_return_t hashkit_digest_test(hashkit_st *hashk)
|
346
|
+
{
|
347
|
+
uint32_t value;
|
348
|
+
value= hashkit_digest(hashk, "a", sizeof("a"));
|
349
|
+
|
350
|
+
return TEST_SUCCESS;
|
351
|
+
}
|
352
|
+
|
353
|
+
static test_return_t hashkit_set_function_test(hashkit_st *hashk)
|
354
|
+
{
|
355
|
+
for (int algo= int(HASHKIT_HASH_DEFAULT); algo < int(HASHKIT_HASH_MAX); algo++)
|
356
|
+
{
|
357
|
+
uint32_t x;
|
358
|
+
const char **ptr;
|
359
|
+
uint32_t *list;
|
360
|
+
|
361
|
+
hashkit_return_t rc= hashkit_set_function(hashk, static_cast<hashkit_hash_algorithm_t>(algo));
|
362
|
+
|
363
|
+
/* Hsieh is disabled most of the time for patent issues */
|
364
|
+
#ifndef HAVE_HSIEH_HASH
|
365
|
+
if (rc == HASHKIT_FAILURE && algo == HASHKIT_HASH_HSIEH)
|
366
|
+
continue;
|
367
|
+
#endif
|
368
|
+
|
369
|
+
#ifndef HAVE_MURMUR_HASH
|
370
|
+
if (rc == HASHKIT_FAILURE && algo == HASHKIT_HASH_MURMUR)
|
371
|
+
continue;
|
372
|
+
#endif
|
373
|
+
|
374
|
+
if (rc == HASHKIT_INVALID_ARGUMENT && algo == HASHKIT_HASH_CUSTOM)
|
375
|
+
continue;
|
376
|
+
|
377
|
+
test_true_got(rc == HASHKIT_SUCCESS, hashkit_strerror(NULL, rc));
|
378
|
+
|
379
|
+
switch (algo)
|
380
|
+
{
|
381
|
+
case HASHKIT_HASH_DEFAULT:
|
382
|
+
list= one_at_a_time_values;
|
383
|
+
break;
|
384
|
+
case HASHKIT_HASH_MD5:
|
385
|
+
list= md5_values;
|
386
|
+
break;
|
387
|
+
case HASHKIT_HASH_CRC:
|
388
|
+
list= crc_values;
|
389
|
+
break;
|
390
|
+
case HASHKIT_HASH_FNV1_64:
|
391
|
+
list= fnv1_64_values;
|
392
|
+
break;
|
393
|
+
case HASHKIT_HASH_FNV1A_64:
|
394
|
+
list= fnv1a_64_values;
|
395
|
+
break;
|
396
|
+
case HASHKIT_HASH_FNV1_32:
|
397
|
+
list= fnv1_32_values;
|
398
|
+
break;
|
399
|
+
case HASHKIT_HASH_FNV1A_32:
|
400
|
+
list= fnv1a_32_values;
|
401
|
+
break;
|
402
|
+
case HASHKIT_HASH_HSIEH:
|
403
|
+
list= hsieh_values;
|
404
|
+
break;
|
405
|
+
case HASHKIT_HASH_MURMUR:
|
406
|
+
list= murmur_values;
|
407
|
+
break;
|
408
|
+
case HASHKIT_HASH_JENKINS:
|
409
|
+
list= jenkins_values;
|
410
|
+
break;
|
411
|
+
case HASHKIT_HASH_CUSTOM:
|
412
|
+
case HASHKIT_HASH_MAX:
|
413
|
+
default:
|
414
|
+
list= NULL;
|
415
|
+
break;
|
416
|
+
}
|
417
|
+
|
418
|
+
// Now we make sure we did set the hash correctly.
|
419
|
+
if (list)
|
420
|
+
{
|
421
|
+
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
|
422
|
+
{
|
423
|
+
uint32_t hash_val;
|
424
|
+
|
425
|
+
hash_val= hashkit_digest(hashk, *ptr, strlen(*ptr));
|
426
|
+
test_true(list[x] == hash_val);
|
427
|
+
}
|
428
|
+
}
|
429
|
+
else
|
430
|
+
{
|
431
|
+
return TEST_FAILURE;
|
432
|
+
}
|
433
|
+
}
|
434
|
+
|
435
|
+
return TEST_SUCCESS;
|
436
|
+
}
|
437
|
+
|
438
|
+
static uint32_t hash_test_function(const char *string, size_t string_length, void *context)
|
439
|
+
{
|
440
|
+
(void)context;
|
441
|
+
return libhashkit_md5(string, string_length);
|
442
|
+
}
|
443
|
+
|
444
|
+
static test_return_t hashkit_set_custom_function_test(hashkit_st *hashk)
|
445
|
+
{
|
446
|
+
hashkit_return_t rc;
|
447
|
+
uint32_t x;
|
448
|
+
const char **ptr;
|
449
|
+
|
450
|
+
|
451
|
+
rc= hashkit_set_custom_function(hashk, hash_test_function, NULL);
|
452
|
+
test_true(rc == HASHKIT_SUCCESS);
|
453
|
+
|
454
|
+
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
|
455
|
+
{
|
456
|
+
uint32_t hash_val;
|
457
|
+
|
458
|
+
hash_val= hashkit_digest(hashk, *ptr, strlen(*ptr));
|
459
|
+
test_true(md5_values[x] == hash_val);
|
460
|
+
}
|
461
|
+
|
462
|
+
return TEST_SUCCESS;
|
463
|
+
}
|
464
|
+
|
465
|
+
static test_return_t hashkit_set_distribution_function_test(hashkit_st *hashk)
|
466
|
+
{
|
467
|
+
for (int algo= int(HASHKIT_HASH_DEFAULT); algo < int(HASHKIT_HASH_MAX); algo++)
|
468
|
+
{
|
469
|
+
hashkit_return_t rc= hashkit_set_distribution_function(hashk, static_cast<hashkit_hash_algorithm_t>(algo));
|
470
|
+
|
471
|
+
/* Hsieh is disabled most of the time for patent issues */
|
472
|
+
if (rc == HASHKIT_FAILURE && algo == HASHKIT_HASH_HSIEH)
|
473
|
+
continue;
|
474
|
+
|
475
|
+
if (rc == HASHKIT_INVALID_ARGUMENT && algo == HASHKIT_HASH_CUSTOM)
|
476
|
+
continue;
|
477
|
+
|
478
|
+
test_true(rc == HASHKIT_SUCCESS);
|
479
|
+
}
|
480
|
+
|
481
|
+
return TEST_SUCCESS;
|
482
|
+
}
|
483
|
+
|
484
|
+
static test_return_t hashkit_set_custom_distribution_function_test(hashkit_st *hashk)
|
485
|
+
{
|
486
|
+
hashkit_return_t rc= hashkit_set_custom_distribution_function(hashk, hash_test_function, NULL);
|
487
|
+
test_true(rc == HASHKIT_SUCCESS);
|
488
|
+
|
489
|
+
return TEST_SUCCESS;
|
490
|
+
}
|
491
|
+
|
492
|
+
|
493
|
+
static test_return_t hashkit_get_function_test(hashkit_st *hashk)
|
494
|
+
{
|
495
|
+
for (int algo= int(HASHKIT_HASH_DEFAULT); algo < int(HASHKIT_HASH_MAX); algo++)
|
496
|
+
{
|
497
|
+
|
498
|
+
if (HASHKIT_HASH_CUSTOM or HASHKIT_HASH_HSIEH)
|
499
|
+
continue;
|
500
|
+
|
501
|
+
hashkit_return_t rc= hashkit_set_function(hashk, static_cast<hashkit_hash_algorithm_t>(algo));
|
502
|
+
test_true(rc == HASHKIT_SUCCESS);
|
503
|
+
|
504
|
+
test_true(hashkit_get_function(hashk) == algo);
|
505
|
+
}
|
506
|
+
return TEST_SUCCESS;
|
507
|
+
}
|
508
|
+
|
509
|
+
static test_return_t hashkit_compare_test(hashkit_st *hashk)
|
510
|
+
{
|
511
|
+
hashkit_st *clone= hashkit_clone(NULL, hashk);
|
512
|
+
|
513
|
+
test_true(hashkit_compare(clone, hashk));
|
514
|
+
hashkit_free(clone);
|
515
|
+
|
516
|
+
return TEST_SUCCESS;
|
517
|
+
}
|
518
|
+
|
519
|
+
test_st hashkit_st_functions[] ={
|
520
|
+
{"hashkit_digest", 0, (test_callback_fn*)hashkit_digest_test},
|
521
|
+
{"hashkit_set_function", 0, (test_callback_fn*)hashkit_set_function_test},
|
522
|
+
{"hashkit_set_custom_function", 0, (test_callback_fn*)hashkit_set_custom_function_test},
|
523
|
+
{"hashkit_get_function", 0, (test_callback_fn*)hashkit_get_function_test},
|
524
|
+
{"hashkit_set_distribution_function", 0, (test_callback_fn*)hashkit_set_distribution_function_test},
|
525
|
+
{"hashkit_set_custom_distribution_function", 0, (test_callback_fn*)hashkit_set_custom_distribution_function_test},
|
526
|
+
{"hashkit_compare", 0, (test_callback_fn*)hashkit_compare_test},
|
527
|
+
{0, 0, 0}
|
528
|
+
};
|
529
|
+
|
530
|
+
static test_return_t libhashkit_digest_test(hashkit_st *hashk)
|
531
|
+
{
|
532
|
+
|
533
|
+
(void)hashk;
|
534
|
+
|
535
|
+
uint32_t value= libhashkit_digest("a", sizeof("a"), HASHKIT_HASH_DEFAULT);
|
536
|
+
test_true(value);
|
537
|
+
|
538
|
+
return TEST_SUCCESS;
|
539
|
+
}
|
540
|
+
|
541
|
+
test_st library_functions[] ={
|
542
|
+
{"libhashkit_digest", 0, (test_callback_fn*)libhashkit_digest_test},
|
543
|
+
{0, 0, 0}
|
544
|
+
};
|
545
|
+
|
546
|
+
test_st hash_tests[] ={
|
547
|
+
{"one_at_a_time", 0, (test_callback_fn*)one_at_a_time_run },
|
548
|
+
{"md5", 0, (test_callback_fn*)md5_run },
|
549
|
+
{"crc", 0, (test_callback_fn*)crc_run },
|
550
|
+
{"fnv1_64", 0, (test_callback_fn*)fnv1_64_run },
|
551
|
+
{"fnv1a_64", 0, (test_callback_fn*)fnv1a_64_run },
|
552
|
+
{"fnv1_32", 0, (test_callback_fn*)fnv1_32_run },
|
553
|
+
{"fnv1a_32", 0, (test_callback_fn*)fnv1a_32_run },
|
554
|
+
{"hsieh", 0, (test_callback_fn*)hsieh_run },
|
555
|
+
{"murmur", 0, (test_callback_fn*)murmur_run },
|
556
|
+
{"jenkis", 0, (test_callback_fn*)jenkins_run },
|
557
|
+
{0, 0, (test_callback_fn*)0}
|
558
|
+
};
|
559
|
+
|
560
|
+
/*
|
561
|
+
* The following test suite is used to verify that we don't introduce
|
562
|
+
* regression bugs. If you want more information about the bug / test,
|
563
|
+
* you should look in the bug report at
|
564
|
+
* http://bugs.launchpad.net/libmemcached
|
565
|
+
*/
|
566
|
+
test_st regression[]= {
|
567
|
+
{0, 0, 0}
|
568
|
+
};
|
569
|
+
|
570
|
+
collection_st collection[] ={
|
571
|
+
{"allocation", 0, 0, allocation},
|
572
|
+
{"hashkit_st_functions", 0, 0, hashkit_st_functions},
|
573
|
+
{"library_functions", 0, 0, library_functions},
|
574
|
+
{"hashing", 0, 0, hash_tests},
|
575
|
+
{"regression", 0, 0, regression},
|
576
|
+
{0, 0, 0, 0}
|
577
|
+
};
|
578
|
+
|
579
|
+
/* Prototypes for functions we will pass to test framework */
|
580
|
+
void *world_create(test_return_t *error);
|
581
|
+
test_return_t world_destroy(hashkit_st *hashk);
|
582
|
+
|
583
|
+
void *world_create(test_return_t *error)
|
584
|
+
{
|
585
|
+
hashkit_st *hashk_ptr= hashkit_create(&global_hashk);
|
586
|
+
|
587
|
+
if (hashk_ptr != &global_hashk)
|
588
|
+
{
|
589
|
+
*error= TEST_FAILURE;
|
590
|
+
return NULL;
|
591
|
+
}
|
592
|
+
|
593
|
+
if (hashkit_is_allocated(hashk_ptr) == true)
|
594
|
+
{
|
595
|
+
*error= TEST_FAILURE;
|
596
|
+
return NULL;
|
597
|
+
}
|
598
|
+
|
599
|
+
*error= TEST_SUCCESS;
|
600
|
+
|
601
|
+
return hashk_ptr;
|
602
|
+
}
|
603
|
+
|
604
|
+
|
605
|
+
test_return_t world_destroy(hashkit_st *hashk)
|
606
|
+
{
|
607
|
+
// Did we get back what we expected?
|
608
|
+
assert(hashkit_is_allocated(hashk) == false);
|
609
|
+
hashkit_free(&global_hashk);
|
610
|
+
|
611
|
+
return TEST_SUCCESS;
|
612
|
+
}
|
613
|
+
|
614
|
+
void get_world(Framework *world)
|
615
|
+
{
|
616
|
+
world->collections= collection;
|
617
|
+
world->_create= (test_callback_create_fn*)world_create;
|
618
|
+
world->_destroy= (test_callback_fn*)world_destroy;
|
619
|
+
}
|