Boost logo

Boost Users :

From: chun ping wang (cablepuff_at_[hidden])
Date: 2007-05-17 13:41:55


Heres the code.
if ((2.0/3.0) != MyAnn::getCondProb(std::string("+cancer"),
std::string("+test"), vps));
     BOOST_ERROR("getCondProb");
  if((1.0/2.0) != MyAnn::getProb(std::string("+cancer"), vps, 1));
     BOOST_ERROR("getProb");
  if((3.0/4.0) != MyAnn::getProb(std::string("+test"), vps, 2));
     BOOST_ERROR("getProb");
  if((1.0/2.0) != MyAnn::getProbAND(std::string("+cancer"),
std::string("+test"), vps));
     BOOST_ERROR("getCondProbAND");
  if((3.0/4.0) != MyAnn::getProbOR(std::string("+cancer"),
std::string("+test"), vps));
     BOOST_ERROR("getCondProbOR");
  BOOST_CHECK((2.0/3.0) == MyAnn::getCondProb(std::string("+cancer"),
std::string("+test"), vps));
  BOOST_CHECK((1.0/2.0) == MyAnn::getProb(std::string("+cancer"), vps, 1));
  BOOST_CHECK((3.0/4.0) == MyAnn::getProb(std::string("+test"), vps, 2));
  BOOST_CHECK((1.0/2.0) == MyAnn::getProbAND(std::string("+cancer"),
std::string("+test"), vps));
  BOOST_CHECK((3.0/4.0) == MyAnn::getProbOR(std::string("+cancer"),
std::string("+test"), vps));

Heres the result:
C:\CPW\cs_classes\cs461\c++\BayesianTest.cpp(144): getCondProb in function:
'int
 test_main(int, char**)'
C:\CPW\cs_classes\cs461\c++\BayesianTest.cpp(146): getProb in function: 'int
tes
t_main(int, char**)'
C:\CPW\cs_classes\cs461\c++\BayesianTest.cpp(148): getProb in function: 'int
tes
t_main(int, char**)'
C:\CPW\cs_classes\cs461\c++\BayesianTest.cpp(150): getCondProbAND in
function: '
int test_main(int, char**)'
C:\CPW\cs_classes\cs461\c++\BayesianTest.cpp(152): getCondProbOR in
function: 'i
nt test_main(int, char**)'
C:\CPW\cs_classes\cs461\c++\BayesianTest.cpp(156): test (1.0/2.0) ==
MyAnn::getP
robAND(std::string("+cancer"), std::string("+test"), vps) failed in
function: 'i
nt test_main(int, char**)'
C:\CPW\cs_classes\cs461\c++\BayesianTest.cpp(157): test (3.0/4.0) ==
MyAnn::getP
robOR(std::string("+cancer"), std::string("+test"), vps) failed in function:
'in
t test_main(int, char**)'
C:/Boost/include/boost_1_34/boost/test/minimal.hpp(122): exception
"std::excepti
on: boost::bad_format_string: format-string is ill-formed" caught in
function: '
int main(int, char**)'

I like to know what went wrong .. and how come its failing? its using boost
1.34



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net