Skip to content

Commit

Permalink
Fix an unused variable warning
Browse files Browse the repository at this point in the history
Building with `-Werror,-Wunused-variable` produces this error:

```
libunifex/test/indexed_for_test.cpp:91:8: error: unused variable 'result'
[-Werror,-Wunused-variable]
  auto result = just(42)
       ^
1 error generated.
```

This change fixes the error by using `result` to confirm that the
calculated sum is as expected.
  • Loading branch information
ispeters authored and lewissbaker committed Aug 24, 2020
1 parent 50b8de3 commit ed0076b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/indexed_for_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,8 @@ TEST(indexed_for, Pipeable) {
x = x + idx;
})
| sync_wait();

// ranges::iota_view{10} produces [0, 9] so our accumulator is summing
// 42 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9, which is 42 + 45 = 87.
EXPECT_EQ(87, *result);
}

0 comments on commit ed0076b

Please sign in to comment.