X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=tests%2Fbooleanmatrix.h;h=8ab71279810753c91e2c33392946442f86a0dfdf;hb=44f4198b0d8076203f7247d3183037d5179b11d0;hp=0cba01971cff197b8f4a08b92840f2cdb1b67c20;hpb=929c696bfb48aa0f96ce2b70b1b926b5f2b2dede;p=libstick.git diff --git a/tests/booleanmatrix.h b/tests/booleanmatrix.h index 0cba019..8ab7127 100644 --- a/tests/booleanmatrix.h +++ b/tests/booleanmatrix.h @@ -4,23 +4,23 @@ #include #include -#include +#include using namespace libstick; -class BooleanmatrixTestSuite: public Test::Suite { +class boolean_matrix_TestSuite: public Test::Suite { public: - BooleanmatrixTestSuite() { - TEST_ADD(BooleanmatrixTestSuite::test_getsetsize >); - TEST_ADD(BooleanmatrixTestSuite::test_getsetsize >); - TEST_ADD(BooleanmatrixTestSuite::test_getsetsize >); + boolean_matrix_TestSuite() { + TEST_ADD(boolean_matrix_TestSuite::test_getsetsize >); + TEST_ADD(boolean_matrix_TestSuite::test_getsetsize >); + TEST_ADD(boolean_matrix_TestSuite::test_getsetsize >); - TEST_ADD(BooleanmatrixTestSuite::test_addgetcolumn >); - TEST_ADD(BooleanmatrixTestSuite::test_addgetcolumn >); + TEST_ADD(boolean_matrix_TestSuite::test_addgetcolumn >); + TEST_ADD(boolean_matrix_TestSuite::test_addgetcolumn >); - TEST_ADD(BooleanmatrixTestSuite::test_addgetrow >); - TEST_ADD(BooleanmatrixTestSuite::test_addgetrow >); + TEST_ADD(boolean_matrix_TestSuite::test_addgetrow >); + TEST_ADD(boolean_matrix_TestSuite::test_addgetrow >); } protected: @@ -61,21 +61,21 @@ class BooleanmatrixTestSuite: public Test::Suite { // Check if columns are empty for (unsigned c=0; c < size; ++c) - TEST_ASSERT(mat.getColumn(c).size() == 0); + TEST_ASSERT(mat.get_column(c).size() == 0); - col.push_back(3); - col.push_back(14); - col.push_back(8); - col.push_back(0); + col.set(0, true); + col.set(3, true); + col.set(8, true); + col.set(14, true); // Add column and test for values - mat.addColumn(5, col); + mat.add_column(5, col); for (unsigned c=0; c < size; ++c) { if (c==5) { for (unsigned r=0; r < size; ++r ) TEST_ASSERT(mat.get(r,c) == (r==0 || r==3 || r==8 || r==14)); } else { - TEST_ASSERT(mat.getColumn(c).size() == 0); + TEST_ASSERT(mat.get_column(c).size() == 0); } } } @@ -88,21 +88,21 @@ class BooleanmatrixTestSuite: public Test::Suite { // Check if rows are empty for (unsigned r=0; r < size; ++r) - TEST_ASSERT(mat.getRow(r).size() == 0); + TEST_ASSERT(mat.get_row(r).size() == 0); - row.push_back(0); - row.push_back(8); - row.push_back(14); - row.push_back(3); + row.set(0, true); + row.set(8, true); + row.set(14, true); + row.set(3, true); // Add row and test for values - mat.addRow(5, row); + mat.add_row(5, row); for (unsigned r=0; r < size; ++r) { if (r==5) { for (unsigned c=0; c < size; ++c ) TEST_ASSERT(mat.get(r,c) == (c==0 || c==3 || c==8 || c==14)); } else { - TEST_ASSERT(mat.getRow(r).size() == 0); + TEST_ASSERT(mat.get_row(r).size() == 0); } } }