1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00

Merge r386,r395,r451 from libarchive.googlecode.com: On Windows, break

into the debugger on test setup failures (otherwise, the console window
just goes away and you can't see what went wrong).  On all platforms,
clean up a stray buffer before exiting.
This commit is contained in:
Tim Kientzle 2009-03-05 18:30:50 +00:00
parent 8655c70597
commit e80e6f7018
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=189417

View File

@ -35,6 +35,8 @@
#include <time.h>
#ifdef _WIN32
#include <crtdbg.h>
#include <windows.h>
#include <winbase.h>
#endif
/*
@ -910,10 +912,13 @@ get_refdir(void)
strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
}
#if defined(_WIN32) && defined(_DEBUG)
/* You should have to add "$(TargetDir)" to
* Properties > Configuration Properties > Debugging > Working Directory,
* if you are running libarchive_test.exe on Visual Studio.
*/
DebugBreak();
#endif
printf("Unable to locate known reference file %s\n", KNOWNREF);
printf(" Checked following directories:\n%s\n", tried);
exit(1);
@ -1092,6 +1097,7 @@ int main(int argc, char **argv)
i = atoi(*argv);
if (**argv < '0' || **argv > '9' || i < 0 || i >= limit) {
printf("*** INVALID Test %s\n", *argv);
free(refdir_alloc);
usage(progname);
} else {
if (test_run(i, tmpdir))