Skip to content

Commit

Permalink
Separate out the unit test for the degenerate case (#14425)
Browse files Browse the repository at this point in the history
* Separate out the unit test for the degenerate case

 * This is a trivial disturbance to the test to correct
   a spurious kcov error; see
   SimonKagstrom/kcov#339
 * Closes #14424
  • Loading branch information
ggould-tri authored Dec 8, 2020
1 parent 404f5ac commit 0be3ddd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion math/test/gray_code_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
namespace drake {
namespace math {
namespace {

GTEST_TEST(TestGrayCode, TestDegenerateCase) {
auto zero_code = CalculateReflectedGrayCodes(0);
EXPECT_EQ(zero_code.cols(), 0);
EXPECT_EQ(zero_code.rows(), 0);
}

GTEST_TEST(TestGrayCode, TestCalculateGrayCodes) {
for (int i = 0; i < 4; i++) {
for (int i = 1; i < 4; i++) {
auto test_code = CalculateReflectedGrayCodes(i);
// Asking for codes for 0 bits should generate 0 for 0 bits.
// Asking for codes for i bits should generate 2^(i) codes for i bits.
Expand Down

0 comments on commit 0be3ddd

Please sign in to comment.