src: consistently use TESTING for internal development tests

This commit is contained in:
Markus F.X.J. Oberhumer 2022-08-27 16:33:57 +02:00
parent 6931a3aa70
commit aa8cdca0a9
3 changed files with 18 additions and 17 deletions

View File

@ -314,13 +314,13 @@ void show_help(int verbose)
// "\nUPX comes with ABSOLUTELY NO WARRANTY; for details type 'upx -L'.\n" // "\nUPX comes with ABSOLUTELY NO WARRANTY; for details type 'upx -L'.\n"
""); "");
#if (DEBUG) || (TESTING) #if DEBUG || TESTING
fg = con_fg(f,FG_RED); fg = con_fg(f,FG_RED);
con_fprintf(f,"\nWARNING: this version is compiled with" con_fprintf(f,"\nWARNING: this version is compiled with"
#if (DEBUG) #if DEBUG
" -DDEBUG" " -DDEBUG"
#endif #endif
#if (TESTING) #if TESTING
" -DTESTING" " -DTESTING"
#endif #endif
"\n"); "\n");

View File

@ -405,10 +405,11 @@ void PackTos::pack(OutputFile *fo) {
overlay = file_size - (FH_SIZE + i_text + i_data + i_sym); overlay = file_size - (FH_SIZE + i_text + i_data + i_sym);
fi->readx(ibuf + t, overlay); fi->readx(ibuf + t, overlay);
#if 0 || (TESTING) #if TESTING
printf("text: %d, data: %d, sym: %d, bss: %d, flags=0x%x\n", printf("text: %d, data: %d, sym: %d, bss: %d, flags=0x%x\n", i_text, i_data, i_sym, i_bss,
i_text, i_data, i_sym, i_bss, (int)ih.fh_flag); (int) ih.fh_flag);
printf("xx1 reloc: %d, overlay: %d, fixup: %d\n", relocsize, overlay, overlay >= 4 ? (int)get_be32(ibuf+t) : -1); printf("xx1 reloc: %d, overlay: %d, fixup: %d\n", relocsize, overlay,
overlay >= 4 ? (int) get_be32(ibuf + t) : -1);
#endif #endif
// Check relocs (see load_and_reloc() in freemint/sys/memory.c). // Check relocs (see load_and_reloc() in freemint/sys/memory.c).
@ -431,7 +432,7 @@ void PackTos::pack(OutputFile *fo) {
symbols.need_reloc = true; symbols.need_reloc = true;
} }
#if 0 || (TESTING) #if TESTING
printf("xx2: %d relocs: %d, overlay: %d, t: %d\n", nrelocs, relocsize, overlay, t); printf("xx2: %d relocs: %d, overlay: %d, t: %d\n", nrelocs, relocsize, overlay, t);
#endif #endif
@ -442,7 +443,7 @@ void PackTos::pack(OutputFile *fo) {
ih.fh_sym = 0; // we stripped all symbols ih.fh_sym = 0; // we stripped all symbols
memcpy(ibuf + t, &ih, FH_SIZE); memcpy(ibuf + t, &ih, FH_SIZE);
t += FH_SIZE; t += FH_SIZE;
#if 0 || (TESTING) #if TESTING
printf("xx3 reloc: %d, overlay: %d, t: %d\n", relocsize, overlay, t); printf("xx3 reloc: %d, overlay: %d, t: %d\n", relocsize, overlay, t);
#endif #endif
assert(t <= isize); assert(t <= isize);
@ -633,11 +634,11 @@ void PackTos::pack(OutputFile *fo) {
// add an empty relocation fixup to workaround a bug in some TOS versions // add an empty relocation fixup to workaround a bug in some TOS versions
oh.fh_reloc = 0; oh.fh_reloc = 0;
#if 0 || (TESTING) #if TESTING
printf("old text: %6d, data: %6d, bss: %6d, reloc: %d, overlay: %d\n", printf("old text: %6d, data: %6d, bss: %6d, reloc: %d, overlay: %d\n", i_text, i_data, i_bss,
i_text, i_data, i_bss, relocsize, overlay); relocsize, overlay);
printf("new text: %6d, data: %6d, bss: %6d, flag=0x%x\n", printf("new text: %6d, data: %6d, bss: %6d, flag=0x%x\n", o_text, o_data, o_bss,
o_text, o_data, o_bss, (int)oh.fh_flag); (int) oh.fh_flag);
linker->dumpSymbols(); linker->dumpSymbols();
#endif #endif

View File

@ -1079,7 +1079,7 @@ unsigned PeFile::processImports0(ord_mask_t ord_mask) // pass 1
// This decreases compression ratio, so FIXME somehow. // This decreases compression ratio, so FIXME somehow.
infoWarning("can't remove unneeded imports"); infoWarning("can't remove unneeded imports");
ilen += sizeof(import_desc) * dllnum; ilen += sizeof(import_desc) * dllnum;
#if defined(DEBUG) #if TESTING
if (opt->verbose > 3) if (opt->verbose > 3)
names.dump(); names.dump();
#endif #endif
@ -1194,7 +1194,7 @@ void PeFile::Export::convert(unsigned eoffs,unsigned esize)
iv.flatten(); iv.flatten();
if (iv.ivnum == 1) if (iv.ivnum == 1)
iv.clear(); iv.clear();
#if defined(DEBUG) #if TESTING
else else
iv.dump(); iv.dump();
#endif #endif
@ -1853,7 +1853,7 @@ bool PeFile::Resource::clear()
iv.flatten(); iv.flatten();
if (iv.ivnum == 1) if (iv.ivnum == 1)
iv.clear(); iv.clear();
#if defined(DEBUG) #if TESTING
if (opt->verbose > 3) if (opt->verbose > 3)
iv.dump(); iv.dump();
#endif #endif