Skip to content

Commit 37763c9

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Remove unused exception parameter from cachelib/navy/serialization/tests/RecordIOTest.cpp
Summary: `-Wunused-exception-parameter` has identified an unused exception parameter. This diff removes it. This: ``` try { ... } catch (exception& e) { // no use of e } ``` should instead be written as ``` } catch (exception&) { ``` If the code compiles, this is safe to land. Reviewed By: palmje Differential Revision: D55092111 fbshipit-source-id: 95ca871a34ea6b1720038e8acd477703193b0b67
1 parent 465ce00 commit 37763c9

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

cachelib/navy/serialization/tests/RecordIOTest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ TEST(RecordIO, MemoryDevice) {
109109
memset(wbuf->writableData(), testChar, testSize);
110110
try {
111111
rw->writeRecord(std::move(wbuf));
112-
} catch (std::logic_error& e) {
112+
} catch (std::logic_error&) {
113113
writeFailed = true;
114114
failedIter = j;
115115
break;
@@ -127,7 +127,7 @@ TEST(RecordIO, MemoryDevice) {
127127
for (uint32_t k = 0; k < testSize; k++) {
128128
EXPECT_EQ(data[k], testChar);
129129
}
130-
} catch (std::logic_error& e) {
130+
} catch (std::logic_error&) {
131131
readFailed = true;
132132
EXPECT_EQ(j, failedIter);
133133
break;
@@ -180,7 +180,7 @@ TEST(RecordIO, MemoryDeviceVariousPayloads) {
180180
memset(wbuf->writableData(), testChar, testSize);
181181
try {
182182
rw->writeRecord(std::move(wbuf));
183-
} catch (std::logic_error& e) {
183+
} catch (std::logic_error&) {
184184
failedIter = j;
185185
break;
186186
/* ignore */
@@ -196,7 +196,7 @@ TEST(RecordIO, MemoryDeviceVariousPayloads) {
196196
for (uint32_t k = 0; k < testSize; k++) {
197197
EXPECT_EQ(data[k], testChar);
198198
}
199-
} catch (std::logic_error& e) {
199+
} catch (std::logic_error&) {
200200
// read should fail when we cannot write beyond the metadataSize
201201
EXPECT_EQ(j, failedIter);
202202
break;

cachelib/shm/tests/test_shm_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ class ShmManagerTest : public ShmTestBase {
5050
void TearDown() final {
5151
try {
5252
clearAllSegments();
53-
} catch (const std::exception& e) {
53+
} catch (const std::exception&) {
5454
// ignore
5555
}
5656

5757
try {
5858
facebook::cachelib::util::removePath(cacheDir);
5959
// make sure nothing exists at the end
60-
} catch (const std::exception& e) {
60+
} catch (const std::exception&) {
6161
// ignore
6262
}
6363
}

0 commit comments

Comments
 (0)