Merge fix for binary mget
[awesomized/libmemcached] / tests / function.c
index 27af67369c5729de9442e37d03061a6968bb05f4..dfdb4d93b15fae8efa97f8014b9435d4456d93f8 100644 (file)
@@ -1044,14 +1044,14 @@ static test_return get_test5(memcached_st *memc)
 
 static test_return  mget_end(memcached_st *memc)
 {
-  const char *keys[] = { "foo", "foo2" };
-  size_t lengths[] = { 3, 4 };
-  const char *values[] = { "fjord", "41" };
+  const char *keys[]= { "foo", "foo2" };
+  size_t lengths[]= { 3, 4 };
+  const char *values[]= { "fjord", "41" };
 
   memcached_return rc;
 
   // Set foo and foo2
-  for(int i = 0; i < 2; i++)
+  for (int i= 0; i < 2; i++)
   {
     rc= memcached_set(memc, keys[i], lengths[i], values[i], strlen(values[i]),
                      (time_t)0, (uint32_t)0);
@@ -1070,27 +1070,28 @@ static test_return  mget_end(memcached_st *memc)
   size_t key_length;
 
   // this should get both
-  for(int i = 0; i < 2; i++) {
-    string = memcached_fetch(memc, key, &key_length, &string_length,
-                             &flags, &rc);
+  for (int i = 0; i < 2; i++) 
+  {
+    string= memcached_fetch(memc, key, &key_length, &string_length,
+                            &flags, &rc);
     assert(rc == MEMCACHED_SUCCESS);
     int val = 0;
-    if(key_length == 4)
-      val = 1;
+    if (key_length == 4)
+      val= 1;
     assert(string_length == strlen(values[val]));
     assert(strncmp(values[val], string, string_length) == 0);
     free(string);
   }
 
   // this should indicate end
-  string = memcached_fetch(memc, key, &key_length, &string_length, &flags, &rc);
+  string= memcached_fetch(memc, key, &key_length, &string_length, &flags, &rc);
   assert(rc == MEMCACHED_END);
 
   // now get just one
   rc= memcached_mget(memc, keys, lengths, 1);
   assert(rc == MEMCACHED_SUCCESS);
 
-  string = memcached_fetch(memc, key, &key_length, &string_length, &flags, &rc);
+  string= memcached_fetch(memc, key, &key_length, &string_length, &flags, &rc);
   assert(key_length == lengths[0]);
   assert(strncmp(keys[0], key, key_length) == 0);
   assert(string_length == strlen(values[0]));
@@ -1099,8 +1100,7 @@ static test_return  mget_end(memcached_st *memc)
   free(string);
 
   // this should indicate end
-  string = memcached_fetch(memc, key, &key_length, &string_length, &flags, &rc);
-  assert(rc != MEMCACHED_SUCCESS);
+  string= memcached_fetch(memc, key, &key_length, &string_length, &flags, &rc);
   assert(rc == MEMCACHED_END);
 
   return TEST_SUCCESS;