projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Updated copyright headers.
[m6w6/libmemcached]
/
tests
/
atomsmasher.c
diff --git
a/tests/atomsmasher.c
b/tests/atomsmasher.c
index eee08d6b724da3a4616e10e362b7a024f9e0d15e..90f7e8f72a6674018bcc6eb9616e1ec320340a28 100644
(file)
--- a/
tests/atomsmasher.c
+++ b/
tests/atomsmasher.c
@@
-1,3
+1,14
@@
+/* LibMemcached
+ * Copyright (C) 2006-2009 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary:
+ *
+ */
+
/*
Sample test application.
*/
/*
Sample test application.
*/
@@
-37,14
+48,14
@@
static pairs_st *global_pairs;
static char *global_keys[GLOBAL_COUNT];
static size_t global_keys_length[GLOBAL_COUNT];
static char *global_keys[GLOBAL_COUNT];
static size_t global_keys_length[GLOBAL_COUNT];
-static test_return cleanup_pairs(memcached_st *memc __attribute__((unused)))
+static test_return
_t
cleanup_pairs(memcached_st *memc __attribute__((unused)))
{
pairs_free(global_pairs);
return 0;
}
{
pairs_free(global_pairs);
return 0;
}
-static test_return generate_pairs(memcached_st *memc __attribute__((unused)))
+static test_return
_t
generate_pairs(memcached_st *memc __attribute__((unused)))
{
unsigned long long x;
global_pairs= pairs_generate(GLOBAL_COUNT, 400);
{
unsigned long long x;
global_pairs= pairs_generate(GLOBAL_COUNT, 400);
@@
-59,10
+70,10
@@
static test_return generate_pairs(memcached_st *memc __attribute__((unused)))
return 0;
}
return 0;
}
-static test_return drizzle(memcached_st *memc)
+static test_return
_t
drizzle(memcached_st *memc)
{
unsigned int x;
{
unsigned int x;
- memcached_return rc;
+ memcached_return
_t
rc;
char *return_value;
size_t return_value_length;
uint32_t flags;
char *return_value;
size_t return_value_length;
uint32_t flags;
@@
-111,38
+122,38
@@
infinite:
return 0;
}
return 0;
}
-static memcached_return pre_nonblock(memcached_st *memc)
+static memcached_return
_t
pre_nonblock(memcached_st *memc)
{
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, 0);
return MEMCACHED_SUCCESS;
}
{
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, 0);
return MEMCACHED_SUCCESS;
}
-static memcached_return pre_md5(memcached_st *memc)
+static memcached_return
_t
pre_md5(memcached_st *memc)
{
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_MD5);
return MEMCACHED_SUCCESS;
}
{
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_MD5);
return MEMCACHED_SUCCESS;
}
-static memcached_return pre_hsieh(memcached_st *memc)
+static memcached_return
_t
pre_hsieh(memcached_st *memc)
{
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_HSIEH);
return MEMCACHED_SUCCESS;
}
{
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_HSIEH);
return MEMCACHED_SUCCESS;
}
-static memcached_return enable_consistent(memcached_st *memc)
+static memcached_return
_t
enable_consistent(memcached_st *memc)
{
{
- memcached_server_distribution value= MEMCACHED_DISTRIBUTION_CONSISTENT;
- memcached_hash hash;
+ memcached_server_distribution
_t
value= MEMCACHED_DISTRIBUTION_CONSISTENT;
+ memcached_hash
_t
hash;
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, value);
pre_hsieh(memc);
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, value);
pre_hsieh(memc);
- value= (memcached_server_distribution)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION);
+ value= (memcached_server_distribution
_t
)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION);
assert(value == MEMCACHED_DISTRIBUTION_CONSISTENT);
assert(value == MEMCACHED_DISTRIBUTION_CONSISTENT);
- hash= (memcached_hash)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_HASH);
+ hash= (memcached_hash
_t
)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_HASH);
assert(hash == MEMCACHED_HASH_HSIEH);
assert(hash == MEMCACHED_HASH_HSIEH);
@@
-153,11
+164,11
@@
static memcached_return enable_consistent(memcached_st *memc)
Set the value, then quit to make sure it is flushed.
Come back in and test that add fails.
*/
Set the value, then quit to make sure it is flushed.
Come back in and test that add fails.
*/
-static test_return add_test(memcached_st *memc)
+static test_return
_t
add_test(memcached_st *memc)
{
{
- memcached_return rc;
- char *key= "foo";
- char *value= "when we sanitize";
+ memcached_return
_t
rc;
+ c
onst c
har *key= "foo";
+ c
onst c
har *value= "when we sanitize";
unsigned long long setting_value;
setting_value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_NO_BLOCK);
unsigned long long setting_value;
setting_value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_NO_BLOCK);
@@
-165,7
+176,7
@@
static test_return add_test(memcached_st *memc)
rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
(time_t)0, (uint32_t)0);
rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
(time_t)0, (uint32_t)0);
-
assert
(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED);
+
test_truth
(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED);
memcached_quit(memc);
rc= memcached_add(memc, key, strlen(key),
value, strlen(value),
memcached_quit(memc);
rc= memcached_add(memc, key, strlen(key),
value, strlen(value),
@@
-173,9
+184,13
@@
static test_return add_test(memcached_st *memc)
/* Too many broken OS'es have broken loopback in async, so we can't be sure of the result */
if (setting_value)
/* Too many broken OS'es have broken loopback in async, so we can't be sure of the result */
if (setting_value)
- assert(rc == MEMCACHED_NOTSTORED || rc == MEMCACHED_STORED);
+ {
+ test_truth(rc == MEMCACHED_NOTSTORED || rc == MEMCACHED_STORED);
+ }
else
else
- assert(rc == MEMCACHED_NOTSTORED);
+ {
+ test_truth(rc == MEMCACHED_NOTSTORED);
+ }
return 0;
}
return 0;
}
@@
-184,7
+199,7
@@
static test_return add_test(memcached_st *memc)
* repeating add_tests many times
* may show a problem in timing
*/
* repeating add_tests many times
* may show a problem in timing
*/
-static test_return many_adds(memcached_st *memc)
+static test_return
_t
many_adds(memcached_st *memc)
{
unsigned int i;
for (i = 0; i < TEST_COUNTER; i++)
{
unsigned int i;
for (i = 0; i < TEST_COUNTER; i++)