Boost logo

Boost Testing :

Subject: [Boost-testing] Boost test setup error: memory access violation at address: 0x00000021: no mapping at fault address
From: girijaram (gbgirija.here_at_[hidden])
Date: 2014-02-21 08:00:51


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

#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#include <iostream>
#include <boost/shared_ptr.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/bind.hpp>
#include <boost/test/unit_test_log.hpp>
#include <boost/filesystem/fstream.hpp>
#include "index/DatabaseGroup.hpp"

using namespace boost::unit_test;

namespace indexing {

class ForwardDBTest {

    /// A pointer to the database group object.
    DatabaseGroup& databaseGroup;

    std::string databaseName;
public:

    ~ForwardDBTest() {
    }
    ;

    ForwardDBTest(DatabaseGroup& databaseGroup_, std::string dbName) :
            databaseGroup(databaseGroup_), databaseName(dbName) {
    }

    void boostTestCreateDB() {
        databaseGroup.createDatabase(databaseName, databaseName);
    }

};

class testSuites: public test_suite {
public:
    testSuites() :
            test_suite("test_suite") {
        std::string db_location = "home/girijag/ripe/ripe_db";
        std::cout << "hello" << std::endl;
        int concurrency = 0;
        std::string db_cache_policy = "AllMem";
        boost::shared_ptr<DatabaseGroup> db =
boost::shared_ptr<DatabaseGroup>(
                new DatabaseGroup(db_location, concurrency,
db_cache_policy));
        std::string dbName = "DB1";
        boost::shared_ptr<ForwardDBTest> instance(
                new ForwardDBTest(*db, dbName));
        test_case* boostTestCreateDB_test_case = BOOST_CLASS_TEST_CASE(
                &ForwardDBTest::boostTestCreateDB, instance);
        add(boostTestCreateDB_test_case);
    }

    ~testSuites() {
    }
    ;

};

test_suite* init_unit_test_suite(int argc, char** argv) {

    test_suite* suite(BOOST_TEST_SUITE("Master Suite"));
    suite->add(new testSuites());
    return suite;
}

}'

Please let me know how should i resolve this? i am getting errors as below:-
Test setup error: memory access violation at address: 0x00000021: no mapping
at fault address

I have been struggling from past 2 days to figure out whats my issue

--
View this message in context: http://boost.2283326.n4.nabble.com/Boost-test-setup-error-memory-access-violation-at-address-0x00000021-no-mapping-at-fault-address-tp4659700.html
Sent from the Boost - Testing mailing list archive at Nabble.com.

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