Skip to content

Commit 4859353

Browse files
committed
TEST/GTEST: Drop counters that are set but never read
GCC 16 promotes these to errors under -Werror=unused-but-set-variable and the Fedora 44 devel build stops on them. Each counter is only ever incremented; the tests assert on other values. Signed-off-by: Alexey Rivkin <arivkin@nvidia.com>
1 parent 087470a commit 4859353

3 files changed

Lines changed: 0 additions & 8 deletions

File tree

test/gtest/ucs/test_pgtable.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ UCS_TEST_F(test_pgtable, multi_search) {
189189
ucs_pgt_addr_t max = 0;
190190

191191
/* generate random regions */
192-
unsigned num_regions = 0;
193192
for (int i = 0; i < 200 / ucs::test_time_multiplier(); ++i) {
194193
ucs_pgt_addr_t start = (ucs::rand() & 0x7fffffff) << 24;
195194
size_t size = ucs_min((size_t)ucs::rand(),
@@ -203,7 +202,6 @@ UCS_TEST_F(test_pgtable, multi_search) {
203202
min = ucs_min(start, min);
204203
max = ucs_max(start, max);
205204
regions.push_back(make_region(start, end));
206-
++num_regions;
207205
}
208206

209207
/* Insert regions */

test/gtest/uct/ib/test_ud_pending.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ UCS_TEST_SKIP_COND_P(test_ud_pending, window,
197197
UCS_TEST_SKIP_COND_P(test_ud_pending, tx_wqe,
198198
!check_caps(UCT_IFACE_FLAG_PUT_SHORT))
199199
{
200-
int i;
201200
uct_pending_req_t r;
202201
ucs_status_t status;
203202

@@ -208,10 +207,8 @@ UCS_TEST_SKIP_COND_P(test_ud_pending, tx_wqe,
208207
connect();
209208
/* set big window */
210209
set_tx_win(m_e1, 8192);
211-
i = 0;
212210
do {
213211
status = tx(m_e1);
214-
i++;
215212
} while (status == UCS_OK);
216213

217214
r.func = pending_cb_dispatch;

test/gtest/uct/test_mem.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ UCS_TEST_P(test_mem, mmap_fixed) {
229229
const size_t n_tryes = 101;
230230
uct_alloc_method_t meth;
231231
size_t length = 1;
232-
size_t n_success;
233232
ucs::mmap_fixed_address p_addr(page_size * 2 * (n_tryes + 1));
234233
void* curr_addr;
235234

@@ -245,7 +244,6 @@ UCS_TEST_P(test_mem, mmap_fixed) {
245244
params.name = "test";
246245
params.mem_type = UCS_MEMORY_TYPE_HOST;
247246

248-
n_success = 0;
249247
curr_addr = *p_addr;
250248

251249
for (i = 0; i < n_tryes; ++i) {
@@ -254,7 +252,6 @@ UCS_TEST_P(test_mem, mmap_fixed) {
254252

255253
status = uct_mem_alloc(length, &meth, 1, &params, &uct_mem);
256254
if (status == UCS_OK) {
257-
++n_success;
258255
EXPECT_EQ(meth, uct_mem.method);
259256
EXPECT_EQ(curr_addr, uct_mem.address);
260257
EXPECT_GE(uct_mem.length, (size_t)1);

0 commit comments

Comments
 (0)