+ populate_vector(inc_val, inc_value);
+
+ test_true(mcach.set(key, inc_val, 0, 0));
+
+ test_true(mcach.get(key, ret_value));
+ test_false(ret_value.empty());
+ copy_vec_to_string(ret_value, ret_string);
+
+ int_inc_value= uint64_t(atol(inc_value.c_str()));
+ int_ret_value= uint64_t(atol(ret_string.c_str()));
+ test_compare(int_inc_value, int_ret_value);
+
+ test_true(mcach.increment(key, 1, &int_ret_value));
+ test_compare(uint64_t(2), int_ret_value);
+
+ test_true(mcach.increment(key, 1, &int_ret_value));
+ test_compare(uint64_t(3), int_ret_value);
+
+ test_true(mcach.increment(key, 5, &int_ret_value));
+ test_compare(uint64_t(8), int_ret_value);
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t basic_master_key_test(memcached_st *original)
+{
+ Memcache foo(original);
+ const string value_set("Data for server A");
+ vector<char> value;
+ vector<char> test_value;
+ const string master_key_a("server-a");
+ const string master_key_b("server-b");
+ const string key("xyz");
+
+ populate_vector(value, value_set);
+
+ test_true(foo.setByKey(master_key_a, key, value, 0, 0));
+ test_true(foo.getByKey(master_key_a, key, test_value));
+
+ test_compare(value.size(), test_value.size());
+ test_memcmp(&value[0], &test_value[0], value.size());
+
+ test_value.clear();
+
+#if 0
+ test_false(foo.getByKey(master_key_b, key, test_value));
+ test_zero(test_value.size());
+#endif
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t mget_test(memcached_st *original)
+{
+ Memcache memc(original);
+ memcached_return_t mc_rc;
+ vector<string> keys;
+ vector< vector<char> *> values;
+ keys.reserve(3);
+ keys.push_back("fudge");
+ keys.push_back("son");
+ keys.push_back("food");
+ vector<char> val1;
+ vector<char> val2;
+ vector<char> val3;
+ populate_vector(val1, "fudge");
+ populate_vector(val2, "son");
+ populate_vector(val3, "food");
+ values.reserve(3);
+ values.push_back(&val1);
+ values.push_back(&val2);
+ values.push_back(&val3);