DTrace support
[m6w6/libmemcached] / tests / test.c
index dabb00f4779ac23b6d0bb7e7ac84b7de4b54a8b5..d457cf50b6357958a6720aff8617bdd2211c293a 100644 (file)
@@ -211,11 +211,13 @@ void get_test3(void)
   char *string;
   size_t string_length;
   uint16_t flags;
-  int i;
+  int x;
 
-  value = (char*) malloc(value_length);
-  for (i=0; i<value_length; i++)
-    value[i] = (char) (i % 127);
+  value = (char*)malloc(value_length);
+  assert(value);
+
+  for (x= 0; x < value_length; x++)
+    value[x] = (char) (x % 127);
 
   memc= memcached_init(NULL);
   assert(memc);
@@ -230,6 +232,8 @@ void get_test3(void)
   string= memcached_get(memc, key, strlen(key),
                         &string_length, &flags, &rc);
 
+  assert(rc == MEMCACHED_SUCCESS);
+  assert(string);
   assert(string_length == value_length);
   assert(!memcmp(string, value, string_length));