diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-09-28 16:52:59 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-09-28 16:52:59 +0200 |
commit | c61b229a213ac1f1cc50c6c4af53131578a91d53 (patch) | |
tree | 7533babfa11f671ef4d2fca6d4f55df249a371d6 | |
parent | fd83de802d05a227cc00489f66ea70fccb4dda05 (diff) |
Fix -Wextra warnings from gcc.
-rw-r--r-- | uunit.cc | 2 | ||||
-rw-r--r-- | uunit.h | 16 |
2 files changed, 11 insertions, 7 deletions
@@ -10,6 +10,8 @@ int main(int argc, char* argv[]) { + (void)argc; + (void)argv; std::ofstream xmlfile; xmlfile.open("result_" OUTPUT ".xml"); return uUnit::runTests(xmlfile); @@ -50,7 +50,7 @@ public: std::size_t line; std::string msg; std::string failure_type; - int id; + std::size_t id; }; //! Run test @@ -118,7 +118,7 @@ public: continue; } status_cb(test.name, test.file, true); - test_result result{test.name}; + test_result result{test.name, {}, {}, {}, {}, {}}; result.id = test_num; successful_tests.push_back(result); } @@ -176,7 +176,7 @@ public: std::ostringstream ss; ss << "assertion failed" << std::endl << "- Expression: " << expr << "" << std::endl; - throw test_result{"", file, line, ss.str()}; + throw test_result{"", file, line, ss.str(), {}, {}}; } } //! Convenience macro to pass along filename and linenumber @@ -193,7 +193,7 @@ public: ss << "equality assertion failed" << std::endl << "- Expected: " << expected << "" << std::endl << "- Actual : " << value << "" << std::endl; - throw test_result{"", file, line, ss.str()}; + throw test_result{"", file, line, ss.str(), {}, {}}; } } @@ -207,7 +207,7 @@ public: ss << "equality assertion failed" << std::endl << "- Expected: " << expected << "" << std::endl << "- Actual : " << value << "" << std::endl; - throw test_result{"", file, line, ss.str()}; + throw test_result{"", file, line, ss.str(), {}, {}}; } } //! Convenience macro to pass along filename and linenumber @@ -226,7 +226,7 @@ public: ss << "throws assertion failed" << std::endl << "- Expected: " << expected << " to be thrown" << std::endl << "- Actual : no exception was thrown" << std::endl; - throw test_result{"", file, line, ss.str()}; + throw test_result{"", file, line, ss.str(), {}, {}}; } catch(const T& t) { @@ -238,7 +238,7 @@ public: ss << "throws assertion failed" << std::endl << "- Expected: " << expected << " to be thrown" << std::endl << "- Actual : unexpected exception was thrown" << std::endl; - throw test_result{"", file, line, ss.str()}; + throw test_result{"", file, line, ss.str(), {}, {}}; } } #define uUNIT_ASSERT_THROWS(expected, expr) \ @@ -307,6 +307,8 @@ namespace //! function pointer to a function with the same signature. void report_result(const char* name, const char* file, bool success) { + (void)name; + (void)file; if(success) { std::cout << "."; |