From: Szasz P. <sp...@us...> - 2004-03-17 19:46:39
|
Update of /cvsroot/rtk/rtk/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23068/test Modified Files: test.h Log Message: Some fixes to work in symbian Index: test.h =================================================================== RCS file: /cvsroot/rtk/rtk/test/test.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test.h 14 Mar 2004 13:57:01 -0000 1.10 --- test.h 17 Mar 2004 19:37:08 -0000 1.11 *************** *** 12,15 **** --- 12,17 ---- #undef STEP + #if 0 + #define STEP(x) IncStep();rprintf(_R("$ %s\n"), _R(#x));x #define OUT(msg, val) IncStep();rprintf(_R("> ") _R(msg) _R("\n"), val) *************** *** 20,23 **** --- 22,71 ---- rprintf(_R("-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n")); \ + #else + + #define STEP(x) \ + IncStep(); \ + rprintf(_R("$ %s\n"), _R(#x)); \ + rfprintf(f_out, _R("$ %s\n"), _R(#x)); \ + fflush(f_out); \ + x + + #define OUT(msg, val) \ + {IncStep(); \ + typeof(val) tmp = val; \ + rprintf(_R("> ") _R(msg) _R("\n"), tmp); \ + rfprintf(f_out, _R("> ") _R(msg) _R("\n"), tmp); \ + fflush(f_out);} + + #define OUTD(msg, val) \ + {IncStep(); \ + rprintf(_R("> ") _R(msg) _R("\n"), val); \ + rfprintf(f_out, _R("> ") _R(msg) _R("\n"), val); \ + fflush(f_out);} + + #define TITLE(x) \ + rprintf(_R("-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n")); \ + rprintf(_R(" %s\n"), x); \ + rprintf(_R("-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n")); \ + const char * f_out_name_ = __FILE__ ".out"; \ + const char * f_out_name = f_out_name_ + rstrlen(f_out_name_) - 1; \ + while (f_out_name > f_out_name_ && f_out_name[-1] != '/') f_out_name--; \ + rprintf(_R("Output of the STEP and OUT macros can be found also in the file `%s'\n"), f_out_name); \ + f_out = fopen(f_out_name, "w"); + + FILE * f_out; + + #endif + + /** Wait for a key if there are no arguments to the executable. + If we put the test in a script, we just have to pass any argument, + and they will not wait. + */ + #define WAIT_KEY \ + if (argc == 1) { \ + rprintf(_R("\nPress any key")); \ + rgetchar(); \ + } + using namespace Rtk; |