| 393 | }; |
| 394 | |
| 395 | TEST_F(MapCacherTest, Simple) |
| 396 | { |
| 397 | driver->pause(); |
| 398 | map<string, bufferlist> truth; |
| 399 | set<string> truth_keys; |
| 400 | string blah("asdf"); |
| 401 | bufferlist bl; |
| 402 | encode(blah, bl); |
| 403 | truth[string("asdf")] = bl; |
| 404 | truth_keys.insert(truth.begin()->first); |
| 405 | { |
| 406 | PausyAsyncMap::Transaction t; |
| 407 | cache->set_keys(truth, &t); |
| 408 | driver->submit(&t); |
| 409 | cache->set_keys(truth, &t); |
| 410 | driver->submit(&t); |
| 411 | } |
| 412 | |
| 413 | map<string, bufferlist> got; |
| 414 | cache->get_keys(truth_keys, &got); |
| 415 | assert_bl_map_eq(got, truth); |
| 416 | |
| 417 | driver->resume(); |
| 418 | sleep(1); |
| 419 | |
| 420 | got.clear(); |
| 421 | cache->get_keys(truth_keys, &got); |
| 422 | assert_bl_map_eq(got, truth); |
| 423 | } |
| 424 | |
| 425 | TEST_F(MapCacherTest, Random) |
| 426 | { |
nothing calls this directly
no test coverage detected