Closed Gluttton closed 10 years ago
Except a lot of benefits it's allow to create tests in easiest way. For instance using std::initializer_list: instead of this:
// Arrange. // - + - // + - - // - - + Matrix <double> etalon_matrix (3, 3); etalon_matrix (0, 0) = -1.0; etalon_matrix (0, 1) = 0.0; etalon_matrix (0, 2) = -1.0; etalon_matrix (1, 0) = 0.0; etalon_matrix (1, 1) = -1.0; etalon_matrix (1, 2) = -1.0; etalon_matrix (2, 0) = -1.0; etalon_matrix (2, 1) = -1.0; etalon_matrix (2, 2) = 0.0; // 1 0 1 // 0 1 1 // 1 1 0 Matrix <double> test_matrix (3, 3); test_matrix (0, 0) = 1.0; test_matrix (0, 1) = 0.0; test_matrix (0, 2) = 1.0; test_matrix (1, 0) = 0.0; test_matrix (1, 1) = 1.0; test_matrix (1, 2) = 1.0; test_matrix (2, 0) = 1.0; test_matrix (2, 1) = 1.0; test_matrix (2, 2) = 0.0;
write something like this:
// Arrange. Matrix <double> etalon_matrix ({ {-1.0, 0.0, -1.0}, { 0.0, -1.0, -1.0}, {-1.0, -1.0, 0.0} }); Matrix <double> test_matrix ({ { 1.0, 0.0, 1.0}, { 0.0, 1.0, 1.0}, { 1.0, 1.0, 0.0} });
Looks like self documented.
I added this in da95d6bbeb690e31188ff5c3ee41e2ca14c5a277
Except a lot of benefits it's allow to create tests in easiest way. For instance using std::initializer_list: instead of this:
write something like this:
Looks like self documented.