diff --git a/tests/hellodprintf/.gitignore b/tests/hellodprintf/.gitignore index 4f4333a..ff5d7a4 100644 --- a/tests/hellodprintf/.gitignore +++ b/tests/hellodprintf/.gitignore @@ -1,5 +1,5 @@ hellodprintf +hellodprintf_fortran hellodprintf_call_channel hellodprintf_call_nochannel -hellodprintf_call_fortran *.o diff --git a/tests/hellodprintf/breakpoints_gdb.seer b/tests/hellodprintf/breakpoints_gdb.seer new file mode 100644 index 0000000..b4782a5 --- /dev/null +++ b/tests/hellodprintf/breakpoints_gdb.seer @@ -0,0 +1,3 @@ +break -source /nas/erniep/Development/seer/tests/hellodprintf/hellodprintf.cpp -line 9 +break -source /nas/erniep/Development/seer/tests/hellodprintf/hellodprintf.cpp -line 20 +dprintf -source /nas/erniep/Development/seer/tests/hellodprintf/hellodprintf.cpp -line 15,"C: n=%d count=%d\n",n,count diff --git a/tests/hellodprintf/hellodprintf.cpp b/tests/hellodprintf/hellodprintf.cpp index a3808f7..2bac744 100644 --- a/tests/hellodprintf/hellodprintf.cpp +++ b/tests/hellodprintf/hellodprintf.cpp @@ -4,37 +4,8 @@ #include #include -FILE* logfile = NULL; - -extern "C" { - int log_msg (const char* format, ...) { - int n; - va_list args; - // init the variable length argument list - va_start(args, format); - - n = vfprintf(logfile, format, args); - - // cleanup the variable length argument list - va_end(args); - - return n; - } -} - -extern "C" { - void fortranfunction_ (int* count); -} - int main (int argc, char** argv) { - const char* filename = "logfile.txt"; - logfile = fopen(filename, "w"); - if (logfile == NULL) { - fprintf(stderr, "Failed to open logfile: %s\n", filename); - return 1; - } - int count = 10; int nfact = 1; int n; @@ -46,10 +17,6 @@ int main (int argc, char** argv) { std::cout << std::setw(12) << n << std::setw(14) << nfact << std::endl; } - fortranfunction_(&count); - - fclose(logfile); - return 0; }