Browse Source

Code cleanup.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
9e287c5671
  1. 6
      src/Magnum/Test/BufferImageGLTest.cpp
  2. 4
      src/Magnum/Test/CubeMapTextureGLTest.cpp
  3. 6
      src/Magnum/Test/ImageViewTest.cpp
  4. 2
      src/Magnum/Trade/Test/ImageDataTest.cpp

6
src/Magnum/Test/BufferImageGLTest.cpp

@ -65,8 +65,7 @@ void BufferImageGLTest::construct() {
/** @todo How to verify the contents in ES? */ /** @todo How to verify the contents in ES? */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CORRADE_COMPARE_AS(std::vector<char>(imageData.begin(), imageData.end()), CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const char>{data},
std::vector<char>(data, data + 12),
TestSuite::Compare::Container); TestSuite::Compare::Container);
#endif #endif
} }
@ -130,8 +129,7 @@ void BufferImageGLTest::setData() {
/** @todo How to verify the contents in ES? */ /** @todo How to verify the contents in ES? */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CORRADE_COMPARE_AS(std::vector<UnsignedShort>(imageData.begin(), imageData.end()), CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const char>{data2},
std::vector<UnsignedShort>(data2, data2 + 8),
TestSuite::Compare::Container); TestSuite::Compare::Container);
#endif #endif
} }

4
src/Magnum/Test/CubeMapTextureGLTest.cpp

@ -393,7 +393,7 @@ void CubeMapTextureGLTest::imageFull() {
CubeMapTexture texture; CubeMapTexture texture;
texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2, 2}) texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2, 2})
.setSubImage(0, {}, ImageView3D{ColorFormat::RGBA, ColorType::UnsignedByte, Vector3i{2, 2, 6}, DataFull}); .setSubImage(0, {}, ImageView3D{ColorFormat::RGBA, ColorType::UnsignedByte, {2, 2, 6}, DataFull});
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
@ -413,7 +413,7 @@ void CubeMapTextureGLTest::imageFullBuffer() {
CubeMapTexture texture; CubeMapTexture texture;
texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2}) texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2})
.setSubImage(0, {}, BufferImage3D{ColorFormat::RGBA, ColorType::UnsignedByte, Vector3i{2, 2, 6}, DataFull, BufferUsage::StaticDraw}); .setSubImage(0, {}, BufferImage3D{ColorFormat::RGBA, ColorType::UnsignedByte, {2, 2, 6}, DataFull, BufferUsage::StaticDraw});
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();

6
src/Magnum/Test/ImageViewTest.cpp

@ -43,7 +43,7 @@ ImageViewTest::ImageViewTest() {
} }
void ImageViewTest::construct() { void ImageViewTest::construct() {
const char data[3] = {}; const char data[3]{};
ImageView2D a(ColorFormat::Red, ColorType::UnsignedByte, {1, 3}, data); ImageView2D a(ColorFormat::Red, ColorType::UnsignedByte, {1, 3}, data);
CORRADE_COMPARE(a.format(), ColorFormat::Red); CORRADE_COMPARE(a.format(), ColorFormat::Red);
@ -53,9 +53,9 @@ void ImageViewTest::construct() {
} }
void ImageViewTest::setData() { void ImageViewTest::setData() {
const char data[3] = {}; const char data[3]{};
ImageView2D a(ColorFormat::Red, ColorType::UnsignedByte, {1, 3}, data); ImageView2D a(ColorFormat::Red, ColorType::UnsignedByte, {1, 3}, data);
const char data2[8] = {}; const char data2[8]{};
a.setData(data2); a.setData(data2);
CORRADE_COMPARE(a.format(), ColorFormat::Red); CORRADE_COMPARE(a.format(), ColorFormat::Red);

2
src/Magnum/Trade/Test/ImageDataTest.cpp

@ -114,7 +114,7 @@ void ImageDataTest::toReference() {
void ImageDataTest::release() { void ImageDataTest::release() {
char data[] = {'b', 'e', 'e', 'r'}; char data[] = {'b', 'e', 'e', 'r'};
ImageData2D a(ColorFormat::Red, ColorType::UnsignedByte, {1, 4}, data); Trade::ImageData2D a(ColorFormat::Red, ColorType::UnsignedByte, {1, 4}, data);
const char* const pointer = a.release(); const char* const pointer = a.release();
CORRADE_COMPARE(pointer, data); CORRADE_COMPARE(pointer, data);

Loading…
Cancel
Save