Personal tools
You are here: Home Forum Install & build Test fails in "MEDCouplingBasicsTestInterp::testInterpolationCC()" on i586 Debian Squeeze

Test fails in "MEDCouplingBasicsTestInterp::testInterpolationCC()" on i586 Debian Squeeze

Up to Install & build

Test fails in "MEDCouplingBasicsTestInterp::testInterpolationCC()" on i586 Debian Squeeze

Posted by Torben Hansen at August 09. 2012

Hi

I keep getting test failure when trying to compile MED for Salome 6.4.0

It seems that std::set allows duplicates. I have inserted some code as seen below to verify that they really are duplicates. The output shows only 4 non-zero differences.

Is there a compile flag I need to set or something else, is it a libstd bug or have I completely misunderstood something.

I'm building on OpenSuSE Build Service for Debian Squeeze

It fails for i586. For amd64 this part seems OK (the buildlog become too big, but that's a different problem).

 

From MEDCouplingBasicsTestInterp.cxx

void MEDCouplingBasicsTestInterp::testInterpolationCC()

{
..

..

  for ( int i = 0; i < (int)res.size(); ++i )
    for ( std::map<int,double>::iterator s_v = res[i].begin(); s_v != res[i].end(); ++s_v)
      {
        sum += s_v->second;
        double vvv;
#ifdef WNT
        double vv = s_v->second / precis;
        if(vv>=0.0)
          {
            vvv = floor(vv+0.5);
          }
        else
          {
            vvv = ceil(vv-0.5);
          }
#else
        vvv = round( s_v->second / precis );
#endif
        vals.insert( precis * vvv );
      }

// Insert TMH -------------------------------
  double vvvtmp=0.0;
  for ( std::set<double>::iterator v = vals.begin(); v != vals.end();++v)
  {
    printf("TEST:%.15g\n",*v-vvvtmp);
    vvvtmp=*v;
  }
  //cout << "tgt: " << i << " src: " << s_v->first << " - w: " << s_v->second << endl;

//End insert TMH -------------------------
  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, sum, precis );

  std::set<double>::iterator v = vals.begin();
  CPPUNIT_ASSERT_EQUAL( 4, int( vals.size()) ); // Fails *************** Expacted 4, Actual 64 *************

..

}

 

 

Thanks

Torben

Powered by Ploneboard
Document Actions