Commit 09b1873a authored by Hossain Mahmud's avatar Hossain Mahmud Committed by Christian Schulte zu Berge

it should fix datahandle related crashing

parent 571bb014
......@@ -32,7 +32,7 @@ ADD_EXECUTABLE(test-campvis
ADD_DEFINITIONS(${CampvisGlobalDefinitions} ${CampvisModulesDefinitions} ${CampvisApplicationDefinitions} ${QT_DEFINITIONS})
INCLUDE_DIRECTORIES(${CampvisGlobalIncludeDirs} ${CampvisModulesIncludeDirs} ${CampvisHome}/ext/gtest-1.7.0/ ${CampvisHome}/ext/gtest-1.7.0/include)
TARGET_LINK_LIBRARIES(test-campvis campvis-modules campvis-core tgt gtest_main ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs})
TARGET_LINK_LIBRARIES(test-campvis campvis-modules campvis-core tgt gtest ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs})
IF(CAMPVIS_GROUP_SOURCE_FILES)
DEFINE_SOURCE_GROUPS_FROM_SUBDIR(TestCampvisSources ${CampvisHome} "")
......
......@@ -13,20 +13,14 @@ protected:
DataHandleTest() {
_data1 = new campvis::ImageData(2, tgt::svec3(1,2,3), 4);
_dh0 = new campvis::DataHandle();
_dh1 = new campvis::DataHandle(_data1);
_dh2 = new campvis::DataHandle(*_dh1);
_dh3 = *_dh2;
_dh0 = campvis::DataHandle();
_dh1 = campvis::DataHandle(_data1);
_dh2 = campvis::DataHandle(_dh1);
_dh3 = _dh2;
}
~DataHandleTest() {
// Note: Can't explicitely delete them, there's a note on the constructor
// tgt::Singleton<campvis::SimpleJobProcessor>>::getRef() assertions fails
// in the second delete!
//delete _dh1;
//delete _dh2;
delete _data1;
//delete _data1;
}
// If the constructor and destructor are not enough for setting up
......@@ -39,26 +33,26 @@ protected:
protected:
campvis::DataHandle *_dh0, *_dh1, *_dh2, _dh3, _dh4;
campvis::DataHandle _dh0, _dh1, _dh2, _dh3, _dh4;
campvis::AbstractData * _data1;
};
TEST_F(DataHandleTest, getDataTest) {
ASSERT_TRUE(nullptr == _dh0->getData());
EXPECT_EQ(_dh1->getData(), _dh2->getData());
EXPECT_EQ(_dh1->getData(), _dh3.getData());
ASSERT_TRUE(nullptr == _dh0.getData());
EXPECT_EQ(_dh1.getData(), _dh2.getData());
EXPECT_EQ(_dh1.getData(), _dh3.getData());
EXPECT_EQ(nullptr, _dh4.getData());
}
TEST_F(DataHandleTest, getTimestampTest) {
EXPECT_NE(-1, _dh0->getTimestamp());
EXPECT_NE(-1, _dh1->getTimestamp());
EXPECT_NE(-1, _dh2->getTimestamp());
EXPECT_NE(-1, _dh0.getTimestamp());
EXPECT_NE(-1, _dh1.getTimestamp());
EXPECT_NE(-1, _dh2.getTimestamp());
EXPECT_NE(-1, _dh3.getTimestamp());
EXPECT_NE(-1, _dh4.getTimestamp());
EXPECT_EQ(_dh1->getTimestamp(), _dh2->getTimestamp());
EXPECT_EQ(_dh1->getTimestamp(), _dh3.getTimestamp());
EXPECT_EQ(_dh1.getTimestamp(), _dh2.getTimestamp());
EXPECT_EQ(_dh1.getTimestamp(), _dh3.getTimestamp());
}
......@@ -19,7 +19,7 @@ protected:
}
~ImageSeriesTest() {
delete _image;
//delete _image;
}
// If the constructor and destructor are not enough for setting up
......
#include "gtest/gtest.h"
#include <stdio.h>
#include "core/tools/simplejobprocessor.h"
void init() {
campvis::SimpleJobProcessor::init();
}
void deinit() {
campvis::SimpleJobProcessor::deinit();
}
GTEST_API_ int main(int argc, char **argv) {
printf("Running main() from main.cpp\n");
testing::InitGoogleTest(&argc, argv);
init();
int ret= RUN_ALL_TESTS();
printf("main() returned with %d\n", ret);
deinit();
//getchar();
return 0;
}
#include "gtest/gtest.h"
#include "core/datastructures/renderdata.h"
#include "tgt/framebufferobject.h"
class RenderDataTest : public testing::Test {
protected:
RenderDataTest() {
//_fbo = new tgt::FramebufferObject();
//_fbo->attachTexture();
//_renderData1 = campvis::RenderData(_fbo);
//_renderData2 = campvis::RenderData(_fbo);
//_renderData3 = campvis::RenderData(_fbo);
}
~RenderDataTest() {
//delete _fbo;
}
// If the constructor and destructor are not enough for setting up
// and cleaning up each test, you can define the following two methods
virtual void SetUp() {
}
virtual void TearDown() {
}
protected:
//campvis::RenderData _renderData1, _renderData2, _renderData3;
tgt::FramebufferObject* _fbo;
};
TEST_F(RenderDataTest, getLocalMemoryFootprintTest) {
SUCCEED();
}
TEST_F(RenderDataTest, getVideoMemoryFootprintTest) {
SUCCEED();
}
TEST_F(RenderDataTest, cloneTest) {
}
TEST_F(RenderDataTest, getNumColorTexturesTest) {
}
TEST_F(RenderDataTest, getColorTextureTest) {
}
TEST_F(RenderDataTest, getColorDataHandleTest) {
}
TEST_F(RenderDataTest, hasDepthTextureTest) {
}
TEST_F(RenderDataTest, getDepthTextureTest) {
}
TEST_F(RenderDataTest, getDepthDataHandleTest) {
}
TEST_F(RenderDataTest, addColorTextureTest) {
}
TEST_F(RenderDataTest, setDepthTextureTest) {
}
TEST_F(RenderDataTest, bindColorTextureTest) {
}
TEST_F(RenderDataTest, bindDepthTextureTest) {
}
TEST_F(RenderDataTest, bindTest) {
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment