projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Added simple exception test to the C++ test case file.
[m6w6/libmemcached]
/
tests
/
atomsmasher.c
diff --git
a/tests/atomsmasher.c
b/tests/atomsmasher.c
index 08aa86f7f7cb3d72f30cb15ba4efb12ca97a8240..3b4879df4bef1c1c260935867fbfbae4ad42f94f 100644
(file)
--- a/
tests/atomsmasher.c
+++ b/
tests/atomsmasher.c
@@
-1,6
+1,8
@@
/*
Sample test application.
*/
/*
Sample test application.
*/
+#include "libmemcached/common.h"
+
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@
-11,7
+13,6
@@
#include <unistd.h>
#include <time.h>
#include "server.h"
#include <unistd.h>
#include <time.h>
#include "server.h"
-#include "../libmemcached/common.h"
#include "../clients/generator.h"
#include "../clients/execute.h"
#include "../clients/generator.h"
#include "../clients/execute.h"
@@
-72,8
+73,8
@@
infinite:
uint32_t test_bit;
uint8_t which;
uint32_t test_bit;
uint8_t which;
- test_bit=
random() % GLOBAL_COUNT
;
- which=
random() % 2
;
+ test_bit=
(uint32_t)(random() % GLOBAL_COUNT)
;
+ which=
(uint8_t)(random() % 2)
;
if (which == 0)
{
if (which == 0)
{
@@
-155,8
+156,8
@@
static memcached_return enable_consistent(memcached_st *memc)
static test_return add_test(memcached_st *memc)
{
memcached_return rc;
static test_return add_test(memcached_st *memc)
{
memcached_return rc;
- char *key= "foo";
- char *value= "when we sanitize";
+ 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);
@@
-172,7
+173,7
@@
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 || MEMCACHED_STORED);
+ assert(rc == MEMCACHED_NOTSTORED ||
rc ==
MEMCACHED_STORED);
else
assert(rc == MEMCACHED_NOTSTORED);
else
assert(rc == MEMCACHED_NOTSTORED);