10 std::string
filename = TestDir +
"unittest/mbtest1.vtk";
17 int main(
int argc,
char* argv[] )
20 if( argc > 1 )
filename = std::string( argv[1] );
54 if( MB_FAILURE == rval )
67 std::map< QualityType, double > qualities;
73 for( std::map< QualityType, double >::iterator mit = qualities.begin(); mit != qualities.end(); ++mit )
75 std::cout <<
" " << vw.
quality_name( mit->first ) <<
" " << mit->second <<
" \n";
83 #define MAX_NODES_PER_ELEMENT 27
84 #define MAX_TESTS_PER_ELEMENT 20
86 #ifdef VERDICT_USE_FLOAT
87 #define VERDICT_SIGNIFICANT_FIG 7
89 #define VERDICT_SIGNIFICANT_FIG 15
115 { 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 },
116 { 1.732050807568877, 0.0 } },
122 { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 },
129 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
136 { 0.0, 0.0, 0.0, -1.0, 1.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 1.0, -1.0, 1.0, 1.0, -1.0, 0.0, 1.0 },
139 {
"singularity wedge",
143 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
162 { 10.825317499999997, 5.999999989158383329e+01, 6.000000021683238316e+01, 1.000000000000000000e+00,
163 9.999999989075266660e-01, 1.000000000000000000e+00, 8.533333407912848181e-03, 8.533333407912848181e-03,
164 1.000000000000000000e+00, 0.0 } },
214 { 1.429964171762364344e+00, 9.245003270420482089e-02, 7.453559924999298980e-01, 7.999999999999998432e-03,
215 2.692582403567252314e+00, 5.773502691896258421e-01, 9.000000000000000000e+01, 5.678908923910092454e+01,
216 2.307927774486215888e+00, 1.114172029062311164e+00, 5.570860145311555822e-01, 5.570860145311555822e-01,
217 4.332891224131210084e-01, 9.999999999999995559e-01, 4.332891224131208419e-01, 5.570860145311553602e-01,
218 5.626795729450876360e-01, 0.0 } },
240 { 1.666666666666666572e+02, 1.224744871391589385e+00, 1.000000000000000000e+03, 8.399473665965818681e-01,
241 3.599999999998462557e-05, 3.023810519746403209e-05, 1.000000000000000000e+00, 0.0 } },
260 { 2.458897037399689067e-01, 1.784576525620624188e-01, 8.130624999999999103e-01, 6.209702997008308412e-01,
261 6.896219298787312768e-01, 5.245942005845132261e-01, 1.273059825673506174e+00, 4.769999999999999241e-01,
262 7.778495101180593618e-01, 7.778495101180593618e-01, 7.897852810190353345e-01, 6.738357656250002492e-01,
263 5.241428201914338780e-01, 5.321855695148176579e-01, 5.847977114834492784e-01, 0.0 } },
273 double answer_from_lib;
277 #define MAX_STR_LEN 30
284 cout.setf( ios::scientific, ios::floatfield );
293 for( i = 0; testcases[i].
testname != 0; i++ )
297 <<
"Test case: " << testcases[i].
testname << endl;
307 cout <<
"\t #" << j + 1 <<
" TESTING :: " <<
QualityType_ToString( testcases[i].
function[j] ) << endl;
308 merr = vw->
quality_measure( dummy, testcases[i].
function[j], answer_from_lib, testcases[i].num_nodes,
309 testcases[i].etype, testcases[i].coords );
317 sprintf( exponent,
"%e", testcases[i].answer[j] );
318 base_ptr = strstr( exponent,
"e" );
320 base_ptr = &base_ptr[1];
322 base = atoi( base_ptr );
326 if( fabs( answer_from_lib - testcases[i].answer[j] ) >
tolerance )
328 cout <<
"\t #" << j + 1 <<
" FAILED :: " <<
QualityType_ToString( testcases[i].
function[j] ) << endl;
330 cout <<
"\t\t calculated ( " << answer_from_lib <<
" ) and "
331 <<
"expected ( " << testcases[i].
answer[j] <<
") " << endl;
336 cout <<
"\t #" << j + 1 <<
" PASSED :: " <<
QualityType_ToString( testcases[i].
function[j] ) << endl;
342 std::cout << endl <<
"All tests passed ? " << ( passed ? 1 : 0 ) << endl;