0

I am using Boost.Test and my test fails. That's fun and all, but the results are horrifying. This is the output of Boost.Test:

$ zwja/Build/Products/Debug/test ; exit;                                     <
Running 2 test cases...
/Users/daknok/Desktop/libxxqlite/test/DatabaseTest.cpp:32: error in "P
                                                                      `??k??k
                                                                             ???k?%??k??k
         l
          p??k????k?": 
*** 1 failure detected in test suite "Master Test Suite"

Here is my failing test case:

BOOST_AUTO_TEST_CASE(Querying) {
  BOOST_CHECK_NO_THROW({
    XXQLite::Database db;
    XXQLite::Query query1 = db.createQuery("CREATE TABLE Foo (Id PRIMARY KEY)");
    XXQLite::Query query2
      = db.createQuery("SELECT * FROM Foo WHERE Id=? OR Id=? OR Id=?",
                       1, 2, 3);
  });
}

I really have no idea what's going on here. What could be the cause of these strange, unreadable error messages? Did Boost not like my code? Is there something wrong with my Boost installation?

ildjarn
  • 62,044
  • 9
  • 127
  • 211
  • Whew, that looks screwy. Did you try cleaning your build and compiling from scratch? – Thomas Feb 03 '12 at 21:05
  • @Thomas same results (although slightly different positioning of question marks). –  Feb 03 '12 at 21:06

2 Answers2

0

According to the example here, the thing between the question marks is what you passed to BOOST_AUTO_TEST_CASE:

BOOST_AUTO_TEST_CASE( test )
{
    BOOST_CHECK_NO_THROW( throw my_exception() );
}

Output:

Running 1 test case...
test.cpp(8): error in "test": exception thrown by throw my_exception()

That is, for you it should print "Querying". Anything going on with that name? Does it work if you change it to something else?

Also try looking at your preprocessor output. If you're using gcc, use the -E flag.

Thomas
  • 174,939
  • 50
  • 355
  • 478
0

It appears you have some kind of memory corruption. Do a clean build. Try valgrind. Try different boost release.

Gennadiy Rozental
  • 1,905
  • 2
  • 13
  • 17