summaryrefslogtreecommitdiff
path: root/issues
diff options
context:
space:
mode:
authorChris Mumford <cmumford@google.com>2019-04-12 01:09:39 -0700
committerChris Mumford <cmumford@google.com>2019-04-12 01:11:25 -0700
commit5a2a472741f36ecf5b994439da5a64c6ab90c47f (patch)
tree366b1ca0b3af9cebb82c32b86acfbc978e85b5b0 /issues
parent08e771901f454ac32643bd8e8cb2bcfa08026c0c (diff)
downloadleveldb-5a2a472741f36ecf5b994439da5a64c6ab90c47f.tar.gz
Fixed missing std namespaces and make_unique.
cout/endl were missing the std namespace. Also std::make_unique was used inadvertently which is part of C++14 and only C++11 is currently supported. PiperOrigin-RevId: 243221310
Diffstat (limited to 'issues')
-rw-r--r--issues/issue320_test.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/issues/issue320_test.cc b/issues/issue320_test.cc
index 5145857..c5fcbfc 100644
--- a/issues/issue320_test.cc
+++ b/issues/issue320_test.cc
@@ -66,7 +66,7 @@ TEST(Issue320, Test) {
ReadOptions readOptions;
while (count < 200000) {
if ((++count % 1000) == 0) {
- cout << "count: " << count << endl;
+ std::cout << "count: " << count << std::endl;
}
int index = GenerateRandomNumber(test_map.size());
@@ -74,18 +74,20 @@ TEST(Issue320, Test) {
if (test_map[index] == nullptr) {
num_items++;
- test_map[index] = std::make_unique<std::pair<std::string, std::string>>(
- CreateRandomString(index), CreateRandomString(index));
+ test_map[index].reset(new std::pair<std::string, std::string>(
+ CreateRandomString(index), CreateRandomString(index)));
batch.Put(test_map[index]->first, test_map[index]->second);
} else {
ASSERT_OK(db->Get(readOptions, test_map[index]->first, &old_value));
if (old_value != test_map[index]->second) {
- cout << "ERROR incorrect value returned by Get" << endl;
- cout << " count=" << count << endl;
- cout << " old value=" << old_value << endl;
- cout << " test_map[index]->second=" << test_map[index]->second << endl;
- cout << " test_map[index]->first=" << test_map[index]->first << endl;
- cout << " index=" << index << endl;
+ std::cout << "ERROR incorrect value returned by Get" << std::endl;
+ std::cout << " count=" << count << std::endl;
+ std::cout << " old value=" << old_value << std::endl;
+ std::cout << " test_map[index]->second=" << test_map[index]->second
+ << std::endl;
+ std::cout << " test_map[index]->first=" << test_map[index]->first
+ << std::endl;
+ std::cout << " index=" << index << std::endl;
ASSERT_EQ(old_value, test_map[index]->second);
}