+static test_return_t memcached_mget_mixed_memcached_get_TEST(memcached_st *memc)
+{
+ test_skip(true, HAVE_LIBUUID);
+
+ std::vector<size_t> key_lengths;
+ key_lengths.resize(200);
+ std::vector<char *> keys;
+ keys.resize(key_lengths.size());
+
+ for (size_t x= 0; x < keys.size(); x++)
+ {
+ if (HAVE_LIBUUID)
+ {
+ uuid_t out;
+ uuid_generate(out);
+ char uuid_string[37];
+
+ uuid_unparse(out, uuid_string);
+ uuid_string[36]= 0;
+ keys[x]= strdup(uuid_string);
+ key_lengths[x]= 36;
+ }
+ }
+
+ for (libtest::vchar_t::iterator iter= keys.begin();
+ iter != keys.end();
+ iter++)
+ {
+ test_compare(MEMCACHED_SUCCESS,
+ memcached_set(memc,
+ (*iter), 36,
+ NULL, 0,
+ time_t(0), uint32_t(0)));
+ }
+
+ for (size_t loop= 0; loop < 20; loop++)
+ {
+ if (random() %2)
+ {
+ test_compare(MEMCACHED_SUCCESS,
+ memcached_mget(memc, &keys[0], &key_lengths[0], keys.size()));
+
+ memcached_result_st *results= memcached_result_create(memc, NULL);
+ test_true(results);
+
+ size_t result_count= 0;
+ memcached_return_t rc;
+ while (memcached_fetch_result(memc, results, &rc))
+ {
+ result_count++;
+ }
+ test_compare(keys.size(), result_count);
+ }
+ else
+ {
+ int which_key= random() %keys.size();
+ size_t value_length;
+ uint32_t flags;
+ memcached_return_t rc;
+ char *out_value= memcached_get(memc, keys[which_key], 36,
+ &value_length, &flags, &rc);
+ test_compare(MEMCACHED_SUCCESS, rc);
+ test_null(out_value);
+ test_zero(value_length);
+ test_zero(flags);
+ }
+ }
+
+ for (libtest::vchar_t::iterator iter= keys.begin();
+ iter != keys.end();
+ iter++)
+ {
+ free(*iter);
+ }
+
+ return TEST_SUCCESS;
+}
+