[Lemon-commits] [lemon_svn] alpar: r1155 - hugo/trunk/src/test

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:43:34 CET 2006


Author: alpar
Date: Wed Sep 15 13:50:50 2004
New Revision: 1155

Modified:
   hugo/trunk/src/test/Makefile.am
   hugo/trunk/src/test/preflow_test.cc

Log:
Better handling of the input files of the tests.



Modified: hugo/trunk/src/test/Makefile.am
==============================================================================
--- hugo/trunk/src/test/Makefile.am	(original)
+++ hugo/trunk/src/test/Makefile.am	Wed Sep 15 13:50:50 2004
@@ -1,8 +1,6 @@
 AM_CPPFLAGS = -I$(top_srcdir)/src
 
-#dist_noinst_DATA = preflow_graph
-EXTRA_DIST = preflow_graph.inp
-CLEANFILES = preflow_graph.out
+EXTRA_DIST = preflow_graph.inp #input file for preflow_test.cc
 
 noinst_HEADERS = test_tools.h graph_test.h
 
@@ -23,10 +21,6 @@
 	unionfind_test \
 	xy_test
 
-SUFFIXES = .inp .out
-.inp.out:
-	-cp $< $@
-
 TESTS = $(check_PROGRAMS)
 XFAIL_TESTS = test_tools_fail
 
@@ -40,7 +34,6 @@
 minlengthpaths_test_SOURCES = minlengthpaths_test.cc
 path_test_SOURCES = path_test.cc
 preflow_test_SOURCES = preflow_test.cc
-preflow_test_DEPENDENCIES = preflow_graph.out
 time_measure_test_SOURCES = time_measure_test.cc
 test_tools_fail_SOURCES = test_tools_fail.cc
 test_tools_pass_SOURCES = test_tools_pass.cc

Modified: hugo/trunk/src/test/preflow_test.cc
==============================================================================
--- hugo/trunk/src/test/preflow_test.cc	(original)
+++ hugo/trunk/src/test/preflow_test.cc	Wed Sep 15 13:50:50 2004
@@ -5,6 +5,9 @@
 #include <hugo/preflow.h>
 #include <hugo/skeletons/graph.h>
 #include <hugo/skeletons/maps.h>
+
+#include <string.h>
+
 using namespace hugo;
 
 void check_Preflow() 
@@ -66,7 +69,17 @@
 
   typedef Preflow<Graph, int> PType;
 
-  std::ifstream file("preflow_graph.out");
+  char *f_name;
+  
+  f_name=new char[strlen(getenv("srcdir"))+50];
+  strcpy(f_name,getenv("srcdir"));
+  strcat(f_name,"/preflow_graph.inp");
+  
+  std::ifstream file(f_name);
+  
+  check(file,"Input file '" << f_name << "' not found.");
+  
+  delete [] f_name;
   
   Graph G;
   Node s, t;



More information about the Lemon-commits mailing list