summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-09-28 16:52:59 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-09-28 16:52:59 +0200
commitc61b229a213ac1f1cc50c6c4af53131578a91d53 (patch)
tree7533babfa11f671ef4d2fca6d4f55df249a371d6
parentfd83de802d05a227cc00489f66ea70fccb4dda05 (diff)
Fix -Wextra warnings from gcc.
-rw-r--r--uunit.cc2
-rw-r--r--uunit.h16
2 files changed, 11 insertions, 7 deletions
diff --git a/uunit.cc b/uunit.cc
index 609310a..ba894cb 100644
--- a/uunit.cc
+++ b/uunit.cc
@@ -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);
diff --git a/uunit.h b/uunit.h
index 4532ef8..92feb8d 100644
--- a/uunit.h
+++ b/uunit.h
@@ -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 << ".";