Notice to GitKraken users: A vulnerability has been found in the SSH key generation of GitKraken versions 7.6.0 to 8.0.0 (https://www.gitkraken.com/blog/weak-ssh-key-fix). If you use GitKraken and have generated a SSH key using one of these versions, please remove it both from your local workstation and from your LRZ GitLab profile.

21.10.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 571bb014 authored by Hossain Mahmud's avatar Hossain Mahmud Committed by Christian Schulte zu Berge
Browse files

added ImageSeries tests

parent ab691100
......@@ -78,5 +78,4 @@ namespace campvis {
return _images[index];
}
}
\ No newline at end of file
// include gtest library
#include "gtest/gtest.h"
// include(s) for class to be tested
#include "core/datastructures/imageseries.h"
// additional includes
#include "core/datastructures/imagedata.h"
class ImageSeriesTest : public testing::Test {
protected:
ImageSeriesTest() {
_image = new campvis::ImageData(2, tgt::svec3(1,2,3), 4);
_dh = campvis::DataHandle(_image);
_imgSeries2.addImage(_image);
_imgSeries3.addImage(_dh);
}
~ImageSeriesTest() {
delete _image;
}
// 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::ImageSeries _imgSeries1, _imgSeries2, _imgSeries3;
campvis::ImageData* _image;
campvis::DataHandle _dh;
};
TEST_F(ImageSeriesTest, getNumImageTest) {
EXPECT_EQ(0, _imgSeries1.getNumImages());
EXPECT_EQ(1, _imgSeries2.getNumImages());
EXPECT_EQ(1, _imgSeries3.getNumImages());
}
TEST_F(ImageSeriesTest, addImageTest) {
_imgSeries3.addImage(_image);
EXPECT_EQ(2, _imgSeries3.getNumImages());
}
TEST_F(ImageSeriesTest, getImageTest) {
//EXPECT_EQ(_dh.getData(), &_imgSeries2.getImage(_imgSeries2.getNumImages()-1).getData());
EXPECT_EQ(_dh.getTimestamp(), _imgSeries2.getImage(_imgSeries2.getNumImages()-1).getTimestamp());
}
TEST_F(ImageSeriesTest, getLocalMemoryFootprintTest) {
SUCCEED();
}
TEST_F(ImageSeriesTest, getVideoMemoryFootprintTest) {
SUCCEED();
}
TEST_F(ImageSeriesTest, cloneTest) {
campvis::ImageSeries* tempSeries = _imgSeries2.clone();
EXPECT_EQ(_imgSeries2.getNumImages(), tempSeries->getNumImages());
EXPECT_EQ(_imgSeries2.getLocalMemoryFootprint(), tempSeries->getLocalMemoryFootprint());
EXPECT_EQ(_imgSeries2.getVideoMemoryFootprint(), tempSeries->getVideoMemoryFootprint());
EXPECT_EQ(_imgSeries2.getImage(_imgSeries2.getNumImages()-1).getTimestamp(), tempSeries->getImage(tempSeries->getNumImages()-1).getTimestamp());
delete tempSeries;
}
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