diff -r 4e948fd205f7 -r acc83957ee4a src/test/preflow_test.cc --- a/src/test/preflow_test.cc Wed Sep 15 14:04:57 2004 +0000 +++ b/src/test/preflow_test.cc Wed Sep 15 14:25:44 2004 +0000 @@ -1,4 +1,6 @@ #include +#include + #include "test_tools.h" #include #include @@ -6,8 +8,6 @@ #include #include -#include - using namespace hugo; void check_Preflow() @@ -69,17 +69,17 @@ typedef Preflow PType; - char *f_name; + string f_name; + if( getenv("srcdir") ) { + f_name = string(getenv("srcdir")) + "/preflow_graph.inp"; + } + else { + f_name = "preflow_graph.inp"; + } - f_name=new char[strlen(getenv("srcdir"))+50]; - strcpy(f_name,getenv("srcdir")); - strcat(f_name,"/preflow_graph.inp"); + std::ifstream file(f_name.c_str()); - std::ifstream file(f_name); - - check(file,"Input file '" << f_name << "' not found."); - - delete [] f_name; + check(file, "Input file '" << f_name << "' not found."); Graph G; Node s, t; @@ -180,6 +180,3 @@ min_min_cut_value == max_min_cut_value, "The max flow value or the three min cut values are incorrect."); } - - -