Boost logo

Boost Testing :

Subject: Re: [Boost-testing] Boost test setup error: memory access violation at address: 0x00000021: no mapping at fault address
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2014-02-25 04:24:44


girijaram <gbgirija.here <at> gmail.com> writes:

>
>
> I am getting the above error while running the executable after compiling
> and running the following file.

* Any chance you can see in deubgger where exactly it crashes?
* I would suggest wrapping you setup code (initialization of DB group) into
a global fixture. This way the code is going to be monitored by the
framework as well)
* Once you do the above I suggest switch to automatically generated test
cases. Something like this:

static boost::shared_ptr<DatabaseGroup> db;
static std::string dbName;

struct Conf {
  Conf()
  {
    std::string db_location = "home/girijag/ripe/ripe_db";
    std::cout << "hello" << std::endl;
    int concurrency = 0;
    std::string db_cache_policy = "AllMem";

    db = boost::shared_ptr<DatabaseGroup>(
       new DatabaseGroup(db_location, concurrency,db_cache_policy));
    
    dbName = "DB1";
  }

  ~Conf() { db.reset(); }
}

BOOST_TEST_GLOBAL_FIXTURE(Conf)

BOOST_AUTO_TEST_CASE( test_DB_creation )
{
  db.createDatabase(dbName, dbName)
}

Gennadiy


Boost-testing list run by mbergal at meta-comm.com