mirror of https://github.com/WerWolv/ImHex.git
tests: Run all tests multiple times
Tests are all done pretty quickly anyways and this should detect use-after-frees and co
This commit is contained in:
parent
3543fa4caa
commit
a93049056a
|
@ -30,10 +30,6 @@ void addFunctions() {
|
||||||
|
|
||||||
int test(int argc, char **argv) {
|
int test(int argc, char **argv) {
|
||||||
auto &testPatterns = TestPattern::getTests();
|
auto &testPatterns = TestPattern::getTests();
|
||||||
ON_SCOPE_EXIT {
|
|
||||||
for (auto &[key, value] : TestPattern::getTests())
|
|
||||||
delete value;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Check if a test to run has been provided
|
// Check if a test to run has been provided
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
|
@ -106,7 +102,18 @@ int test(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
auto result = test(argc, argv);
|
int result = EXIT_SUCCESS;
|
||||||
|
|
||||||
|
for (u32 i = 0; i < 16; i++) {
|
||||||
|
result = test(argc, argv);
|
||||||
|
if (result != EXIT_SUCCESS)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ON_SCOPE_EXIT {
|
||||||
|
for (auto &[key, value] : TestPattern::getTests())
|
||||||
|
delete value;
|
||||||
|
};
|
||||||
|
|
||||||
if (result == EXIT_SUCCESS)
|
if (result == EXIT_SUCCESS)
|
||||||
hex::log::info("Success!");
|
hex::log::info("Success!");
|
||||||
|
|
Loading…
Reference in New Issue