Skip to content

Commit

Permalink
fix destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmad88me committed Jul 31, 2020
1 parent 4b37ad9 commit 3032fa9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ using namespace std;


EntityAnn::EntityAnn() {
// do nothing
m_logger = nullptr;
m_hdt = nullptr;
m_graph = nullptr;
m_properties_counts = nullptr;
}

EntityAnn::~EntityAnn() {
Expand Down Expand Up @@ -72,20 +75,36 @@ void EntityAnn::init(hdt::HDT* hdt_ptr, string log_file_dir, double alpha) {


EntityAnn::EntityAnn(hdt::HDT* hdt_ptr, string log_file_dir) {
m_logger = nullptr;
m_hdt = nullptr;
m_graph = nullptr;
m_properties_counts = nullptr;
init(hdt_ptr, log_file_dir, 1.0);
}


EntityAnn::EntityAnn(hdt::HDT* hdt_ptr, string log_file_dir, double alpha) {
m_logger = nullptr;
m_hdt = nullptr;
m_graph = nullptr;
m_properties_counts = nullptr;
init(hdt_ptr, log_file_dir, alpha);
}

EntityAnn::EntityAnn(string hdt_file_dir, string log_file_dir) {
m_logger = nullptr;
m_hdt = nullptr;
m_graph = nullptr;
m_properties_counts = nullptr;
init(hdt_file_dir, log_file_dir, 1.0);
}


EntityAnn::EntityAnn(string hdt_file_dir, string log_file_dir, double alpha) {
m_logger = nullptr;
m_hdt = nullptr;
m_graph = nullptr;
m_properties_counts = nullptr;
init(hdt_file_dir, log_file_dir, alpha);
}

Expand Down
5 changes: 5 additions & 0 deletions src/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ void ttl_to_hdt(string ttl_dir) {

namespace {

TEST(EntityEmpty, Hello) {
EntityAnn* ea = new EntityAnn();
ASSERT_NE(ea, nullptr);
delete ea;
}

TEST(EntityTest, Hello) {
EntityAnn* ea = new EntityAnn(hdt_file, log_file);
Expand Down

0 comments on commit 3032fa9

Please sign in to comment.