Merge lp:~tangent-org/libmemcached/1.0-build Build: jenkins-Libmemcached-1.0-125
[m6w6/libmemcached] / tests / libmemcached-1.0 / mem_functions.cc
index 38c0db77e88a90e967128531b273ec0387f3b646..49be55da94aa8cee4e5f51d185d5d11482406456 100644 (file)
@@ -823,6 +823,34 @@ test_return_t memcached_add_SUCCESS_TEST(memcached_st *memc)
   return TEST_SUCCESS;
 }
 
+test_return_t regression_1067242_TEST(memcached_st *memc)
+{
+  test_compare(MEMCACHED_SUCCESS, memcached_set(memc,
+                                                test_literal_param(__func__), 
+                                                test_literal_param("-2"),
+                                                0, 0));
+
+  memcached_return_t rc;
+  char* value;
+  test_true((value= memcached_get(memc, test_literal_param(__func__), NULL, NULL, &rc)));
+  test_compare(MEMCACHED_SUCCESS, rc);
+  free(value);
+
+  for (size_t x= 0; x < 10; x++)
+  {
+    uint64_t new_number;
+    test_compare(MEMCACHED_CLIENT_ERROR,
+                 memcached_increment(memc, 
+                                     test_literal_param(__func__), 1, &new_number));
+    test_compare(MEMCACHED_CLIENT_ERROR, memcached_last_error(memc));
+    test_true((value= memcached_get(memc, test_literal_param(__func__), NULL, NULL, &rc)));
+    test_compare(MEMCACHED_SUCCESS, rc);
+    free(value);
+  }
+
+  return TEST_SUCCESS;
+}
+
 /*
   Set the value, then quit to make sure it is flushed.
   Come back in and test that add fails.
@@ -3655,6 +3683,27 @@ test_return_t murmur_run (memcached_st *)
 #endif
 }
 
+test_return_t murmur3_TEST(hashkit_st *)
+{
+  test_skip(true, libhashkit_has_algorithm(HASHKIT_HASH_MURMUR3));
+
+#ifdef WORDS_BIGENDIAN
+  (void)murmur3_values;
+  return TEST_SKIPPED;
+#else
+  uint32_t x;
+  const char **ptr;
+
+  for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
+  {
+    test_compare(murmur3_values[x],
+                 memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHED_HASH_MURMUR3));
+  }
+
+  return TEST_SUCCESS;
+#endif
+}
+
 test_return_t jenkins_run (memcached_st *)
 {
   uint32_t x;