// test_class_KSArray_order_comparisons // Test suite for class KSArray, comparisons <, <=, >, >= // Pre: None. // Post: // Pass/fail status of tests have been registered with t. // Appropriate messages have been printed to cout. // Does not throw (No-Throw Guarantee) void test_class_KSArray_order_comparisons(Tester & t) { std::cout << "Test Suite: class KSArray - comparisons" << std::endl; bool correctType; // result of type checking const int theSize = 10; int i; // Counter KSArray<int> tai1(theSize); for (i = 0; i < theSize; ++i) tai1[i] = 15 - i * i; const KSArray<int> tai1Eq(tai1); // Equal to tai1 KSArray<int> tai1Sm1(tai1); // Smaller than tai1, due to values --tai1Sm1[5]; KSArray<int> tai1Sm2(theSize-2); // Smaller than tai1, due to size for (i = 0; i < tai1Sm2.size(); ++i) tai1Sm2[i] = tai1[i]; KSArray<int> cmh(theSize+1); for (i = 0; i < theSize; ++i) cmh[i] = 15 - i * i; cmh[theSize-1]--; // operator< return type correctType = TypeCheck<bool>::check(tai1 < tai1Eq); t.test(correctType, "operator<, return type"); // operator<= return type correctType = TypeCheck<bool>::check(tai1 <= tai1Eq); t.test(correctType, "operator<=, return type"); // operator> return type correctType = TypeCheck<bool>::check(tai1 > tai1Eq); t.test(correctType, "operator>, return type"); // operator>= return type correctType = TypeCheck<bool>::check(tai1 >= tai1Eq); t.test(correctType, "operator>=, return type"); // Equal arrays, operator< t.test(!(tai1 < tai1Eq), "Equal arrays, operator<"); // Equal arrays, operator<= t.test(tai1 <= tai1Eq, "Equal arrays, operator<="); // Equal arrays, operator> t.test(!(tai1 > tai1Eq), "Equal arrays, operator>"); // Equal arrays, operator>= t.test(tai1 >= tai1Eq, "Equal arrays, operator>="); // Differing values #1, operator< t.test(!(tai1 < tai1Sm1), "Differing values #1, operator<"); t.test(!(tai1<cmh),"! 223<222"); // Differing values #1, operator<= t.test(!(tai1 <= tai1Sm1), "Differing values #1, operator<="); // Differing values #1, operator> t.test(tai1 > tai1Sm1, "Differing values #1, operator>"); // Differing values #1, operator>= t.test(tai1 >= tai1Sm1, "Differing values #1, operator>="); // Differing values #2, operator< t.test(tai1Sm1 < tai1, "Differing values #2, operator<"); // Differing values #2, operator<= t.test(tai1Sm1 <= tai1, "Differing values #2, operator<="); // Differing values #2, operator> t.test(!(tai1Sm1 > tai1), "Differing values #2, operator>"); // Differing values #2, operator>= t.test(!(tai1Sm1 >= tai1), "Differing values #2, operator>="); // Differing sizes #1, operator< t.test(!(tai1 < tai1Sm2), "Differing sizes #1, operator<"); // Differing sizes #1, operator<= t.test(!(tai1 <= tai1Sm2), "Differing sizes #1, operator<="); // Differing sizes #1, operator> t.test(tai1 > tai1Sm2, "Differing sizes #1, operator>"); // Differing sizes #1, operator>= t.test(tai1 >= tai1Sm2, "Differing sizes #1, operator>="); // Differing sizes #2, operator< t.test(tai1Sm2 < tai1, "Differing sizes #2, operator<"); // Differing sizes #2, operator<= t.test(tai1Sm2 <= tai1, "Differing sizes #2, operator<="); // Differing sizes #2, operator> t.test(!(tai1Sm2 > tai1), "Differing sizes #2, operator>"); // Differing sizes #2, operator>= t.test(!(tai1Sm2 >= tai1), "Differing sizes #2, operator>="); }
bool Solver::cm (string s, ifstream& in) { bool found = false; cmh (s, STRINGTIFY(nGaussIter), nGaussIter, in, found); cmh (s, STRINGTIFY(maxTimeStep), maxTimeStep, in, found); cmh (s, STRINGTIFY(cfl), cfl, in, found); cmh (s, STRINGTIFY(dt), dt, in, found); cmh (s, STRINGTIFY(finalTime), finalTime, in, found); cmh (s, STRINGTIFY(tol), tol, in, found); cmh (s, STRINGTIFY(oversetTol), oversetTol, in, found); cmh (s, STRINGTIFY(steady), steady, in, found); cmh (s, STRINGTIFY(implicit), implicit, in, found); cmh (s, STRINGTIFY(verbose), verbose, in, found); cmh (s, STRINGTIFY(tOrder), tOrder, in, found); cmh (s, STRINGTIFY(sOrder), sOrder, in, found); cmh (s, STRINGTIFY(linearSolverType), linearSolverType, in, found); return found; }