[core] std::shared_ptr<const Response> ⇢ const Response&

This commit is contained in:
John Firebaugh
2016-01-13 16:31:54 -08:00
parent 7fb5e973ed
commit 2ee1fe4178
7 changed files with 46 additions and 51 deletions

View File

@@ -64,8 +64,8 @@ TEST_F(Storage, CacheNotFound) {
const Resource resource{ Resource::Unknown, "http://127.0.0.1:3000/not-found" };
// Insert existing data into the cache that will be marked as stale.
auto response = std::make_shared<Response>();
response->data = std::make_shared<const std::string>("existing data");
Response response;
response.data = std::make_shared<const std::string>("existing data");
cache.put(resource, response, SQLiteCache::Hint::Full);
std::unique_ptr<FileRequest> req1;
@@ -122,8 +122,8 @@ TEST_F(Storage, DontCacheConnectionErrors) {
const Resource resource{ Resource::Unknown, "http://127.0.0.1:3001" };
// Insert existing data into the cache that will be marked as stale.
auto response = std::make_shared<Response>();
response->data = std::make_shared<const std::string>("existing data");
Response response;
response.data = std::make_shared<const std::string>("existing data");
cache.put(resource, response, SQLiteCache::Hint::Full);
std::unique_ptr<FileRequest> req1;
@@ -178,8 +178,8 @@ TEST_F(Storage, DontCacheServerErrors) {
const Resource resource{ Resource::Unknown, "http://127.0.0.1:3000/permanent-error" };
// Insert existing data into the cache that will be marked as stale.
auto response = std::make_shared<Response>();
response->data = std::make_shared<const std::string>("existing data");
Response response;
response.data = std::make_shared<const std::string>("existing data");
cache.put(resource, response, SQLiteCache::Hint::Full);
std::unique_ptr<FileRequest> req1;