Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
CAMP
campvis-public
Commits
571bb014
Commit
571bb014
authored
Mar 01, 2014
by
Hossain Mahmud
Committed by
Christian Schulte zu Berge
Apr 23, 2014
Browse files
added ImageSeries tests
parent
ab691100
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/datastructures/imageseries.cpp
View file @
571bb014
...
...
@@ -77,6 +77,5 @@ namespace campvis {
tgtAssert
(
index
<
_images
.
size
(),
"Index out of bounds."
);
return
_images
[
index
];
}
}
\ No newline at end of file
test/imageseriestest.cpp
0 → 100644
View file @
571bb014
// 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
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment