+ foo.setByKey(master_key_a, key, value, 0, 0);
+ foo.getByKey(master_key_a, key, test_value);
+
+ assert((memcmp(&value[0], &test_value[0], value.size()) == 0));
+
+ test_value.clear();
+
+ foo.getByKey(master_key_b, key, test_value);
+ assert((memcmp(&value[0], &test_value[0], value.size()) == 0));
+
+ return TEST_SUCCESS;
+}
+
+/* Count the results */
+memcached_return_t callback_counter(const memcached_st *,
+ memcached_result_st *,
+ void *context)
+{
+ unsigned int *counter= static_cast<unsigned int *>(context);
+
+ *counter= *counter + 1;
+
+ return MEMCACHED_SUCCESS;
+}
+
+test_return_t mget_result_function(memcached_st *memc)
+{
+ Memcache mc(memc);
+ bool rc;
+ string key1("fudge");
+ string key2("son");
+ string key3("food");
+ vector<string> keys;
+ vector< vector<char> *> values;
+ vector<char> val1;
+ vector<char> val2;
+ vector<char> val3;
+ populate_vector(val1, key1);
+ populate_vector(val2, key2);
+ populate_vector(val3, key3);
+ keys.reserve(3);
+ keys.push_back(key1);
+ keys.push_back(key2);
+ keys.push_back(key3);
+ values.reserve(3);
+ values.push_back(&val1);
+ values.push_back(&val2);
+ values.push_back(&val3);
+ unsigned int counter;
+ memcached_execute_fn callbacks[1];
+
+ /* We need to empty the server before we continue the test */
+ rc= mc.flush(0);
+ rc= mc.setAll(keys, values, 50, 9);
+ assert(rc == true);
+
+ rc= mc.mget(keys);
+ assert(rc == true);