L3B/test_suite.h

79 lines
2.7 KiB
C
Raw Normal View History

#ifndef TEST_SUITE_H
#define TEST_SUITE_H
#include <string>
#include <vector>
2024-09-24 16:56:57 -06:00
/**
* @brief Test suite. Runs all tests.
* @return true if all tests pass, false otherwise
*/
bool run_all_tests();
/**
2024-09-24 16:56:57 -06:00
* @brief A generic test function, that simply prints "PASSED" if LHS equals RHS
* and otherwise prints FAILED. Do not modify this function.
2024-09-24 16:56:57 -06:00
*
* @param testNum Number of the test. Value will be incremented upon completion
* @param MESSAGE description of test
* @param LHS computed result
* @param RHS expected result
* @return 1 if test passed, 0 otherwise
*/
2024-09-24 16:56:57 -06:00
int test_int(int& testNum, const std::string MESSAGE, const int LHS,
const int RHS);
/**
2024-09-24 16:56:57 -06:00
* @brief A generic test function, that simply prints "PASSED" if LHS equals RHS
* and otherwise prints FAILED. Do not modify this function.
2024-09-24 16:56:57 -06:00
*
* @param testNum Number of the test. Value will be incremented upon completion
* @param MESSAGE description of test
* @param LHS computed result
* @param RHS expected result
* @return 1 if test passed, 0 otherwise
*/
2024-09-24 16:56:57 -06:00
int test_unsigned_long(int& testNum, const std::string MESSAGE,
const unsigned long LHS, const unsigned long RHS);
/**
2024-09-24 16:56:57 -06:00
* @brief A generic test function, that simply prints "PASSED" if LHS equals RHS
* and otherwise prints FAILED. Do not modify this function.
2024-09-24 16:56:57 -06:00
*
* @param testNum Number of the test. Value will be incremented upon completion
* @param MESSAGE description of test
* @param LHS computed result
* @param RHS expected result
* @return 1 if test passed, 0 otherwise
*/
2024-09-24 16:56:57 -06:00
int test_char(int& testNum, const std::string MESSAGE, const char LHS,
const char RHS);
/**
2024-09-24 16:56:57 -06:00
* @brief A generic test function, that simply prints "PASSED" if LHS equals RHS
* and otherwise prints FAILED. Do not modify this function.
2024-09-24 16:56:57 -06:00
*
* @param testNum Number of the test. Value will be incremented upon completion
* @param MESSAGE description of test
* @param LHS computed result
* @param RHS expected result
* @return 1 if test passed, 0 otherwise
*/
2024-09-24 16:56:57 -06:00
int test_string(int& testNum, const std::string MESSAGE, const std::string LHS,
const std::string RHS);
/**
2024-09-24 16:56:57 -06:00
* @brief A generic test function, that simply prints "PASSED" if LHS equals RHS
* and otherwise prints FAILED. Do not modify this function.
2024-09-24 16:56:57 -06:00
*
* @param testNum Number of the test. Value will be incremented upon completion
* @param MESSAGE description of test
* @param LHS computed result
* @param RHS expected result
* @return 1 if test passed, 0 otherwise
*/
2024-09-24 16:56:57 -06:00
int test_vector_string(int& testNum, const std::string MESSAGE,
const std::vector<std::string>& LHS,
const std::vector<std::string>& RHS);
#endif