remove size of data files

This commit is contained in:
Shlomo Golubev 2007-09-26 09:30:01 +00:00
parent 982a8c33be
commit aab3d2f90b
3 changed files with 30 additions and 32 deletions

View File

@ -560,32 +560,26 @@ bool Traits_test<T_Traits>::start()
template <class T_Traits> template <class T_Traits>
bool Traits_test<T_Traits>::read_input(std::ifstream & is ,Read_object_type obj_t) bool Traits_test<T_Traits>::read_input(std::ifstream & is ,Read_object_type obj_t)
{ {
int num=0;
char one_line[128]; char one_line[128];
skip_comments(is, one_line); skip_comments(is, one_line);
std::istringstream str_stream(one_line, std::istringstream::in); std::istringstream str_stream(one_line, std::istringstream::in);
str_stream >> num;
str_stream.clear(); str_stream.clear();
if (num > 0)
{
try try
{ {
switch (obj_t) for (int i = 0; !is.eof() ; ++i)
{ {
case POINT : switch (obj_t)
m_points.resize(num); {
break; case POINT :
case CURVE : m_points.resize(m_points.size()+1);
m_curves.resize(num); break;
break; case CURVE :
case XCURVE : m_curves.resize(m_curves.size()+1);
m_xcurves.resize(num); break;
break; case XCURVE :
}//switch m_xcurves.resize(m_xcurves.size()+1);
for (int i = 0; i < num; ++i) break;
{ }//switch
skip_comments(is, one_line);
str_stream.str(one_line);
switch (obj_t) switch (obj_t)
{ {
case POINT : case POINT :
@ -614,6 +608,8 @@ bool Traits_test<T_Traits>::read_input(std::ifstream & is ,Read_object_type obj_
break; break;
}//switch }//switch
str_stream.clear(); str_stream.clear();
skip_comments(is, one_line);
str_stream.str(one_line);
}//for }//for
/*for (int i = 0; i < num; ++i) /*for (int i = 0; i < num; ++i)
{ //for debug { //for debug
@ -651,7 +647,6 @@ bool Traits_test<T_Traits>::read_input(std::ifstream & is ,Read_object_type obj_
is.close(); is.close();
return false; return false;
}//catch }//catch
} //if num>0
return true; return true;
} }

View File

@ -671,10 +671,13 @@ test_spherical_arc_traits()
echo " ERROR: not executed test_traits spherical_arc_traits" >> $ERRORFILE echo " ERROR: not executed test_traits spherical_arc_traits" >> $ERRORFILE
else else
execute_commands_old_structure spherical_arcs spherical_arc_traits \ execute_commands_old_structure spherical_arcs spherical_arc_traits \
COMPARE_Y_AT_X_LEFT COMPARE_Y_AT_X_RIGHT \ COMPARE_Y_AT_X_LEFT COMPARE_Y_AT_X_RIGHT INTERSECT \
BOUNDARY_IN_X BOUNDARY_IN_Y CONSTRUCTOR \ BOUNDARY_IN_X BOUNDARY_IN_Y CONSTRUCTOR \
COMPARE MAKE_X_MONOTONE SPLIT MERGE ERRORS COMPARE MAKE_X_MONOTONE SPLIT MERGE ERRORS
execute_commands_new_structure spherical_arcs spherical_arc_traits \
INTERSECT
run_trapped_test test_traits \ run_trapped_test test_traits \
data/spherical_arcs/compare.pt data/spherical_arcs/compare.xcv \ data/spherical_arcs/compare.pt data/spherical_arcs/compare.xcv \
data/empty.zero data/spherical_arcs/compare spherical_arc_traits data/empty.zero data/spherical_arcs/compare spherical_arc_traits

View File

@ -83,6 +83,7 @@ read_point(stream & is, Point_2 & p)
{ {
Basic_number_type x, y, z; Basic_number_type x, y, z;
is >> x >> y >> z; is >> x >> y >> z;
//std::cout << "x " << x << " y " << y << " z " << z << std::endl;
p = Point_2(x, y, z); p = Point_2(x, y, z);
return true; return true;
} }
@ -93,13 +94,13 @@ template <class stream>
bool bool
Traits_test<Traits>::read_xcurve(stream & is, X_monotone_curve_2 & xcv) Traits_test<Traits>::read_xcurve(stream & is, X_monotone_curve_2 & xcv)
{ {
Basic_number_type x1, y1, z1, x2, y2, z2; Curve_2 cv;
is >> x1 >> y1 >> z1 >> x2 >> y2 >> z2; if (read_curve(is,cv))
Point_2 p1(x1, y1, z1); {
Point_2 p2(x2, y2, z2); xcv = X_monotone_curve_2(cv);
CGAL_assertion(p1 != p2); return true;
xcv = X_monotone_curve_2(p1, p2); }
return true; return false;
} }
/*! Read a curve */ /*! Read a curve */
@ -108,10 +109,9 @@ template <class stream>
bool bool
Traits_test<Traits>::read_curve(stream & is, Curve_2 & cv) Traits_test<Traits>::read_curve(stream & is, Curve_2 & cv)
{ {
Basic_number_type x1, y1, z1, x2, y2, z2; Point_2 p1,p2;
is >> x1 >> y1 >> z1 >> x2 >> y2 >> z2; read_point(is,p1);
Point_2 p1(x1, y1, z1); read_point(is,p2);
Point_2 p2(x2, y2, z2);
CGAL_assertion(p1 != p2); CGAL_assertion(p1 != p2);
cv = Curve_2(p1, p2); cv = Curve_2(p1, p2);
return true; return true;