Commit fa05f607 by Jamie Madill

Use value-paramaterized tests instead of by type.

This should fix our non-standard template use, which causes compile errors for the tests on GCC/Clang. BUG=angleproject:997 Change-Id: Id1bb15231eda445f37e53a5b33d4684ec6618d8e Reviewed-on: https://chromium-review.googlesource.com/269858Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 0ca53786
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
'<(angle_path)/src/tests/end2end_tests/UnpackRowLength.cpp', '<(angle_path)/src/tests/end2end_tests/UnpackRowLength.cpp',
'<(angle_path)/src/tests/end2end_tests/VertexAttributeTest.cpp', '<(angle_path)/src/tests/end2end_tests/VertexAttributeTest.cpp',
'<(angle_path)/src/tests/end2end_tests/ViewportTest.cpp', '<(angle_path)/src/tests/end2end_tests/ViewportTest.cpp',
'<(angle_path)/src/tests/end2end_tests/angle_test_configs.h',
'<(angle_path)/src/tests/standalone_tests/EGLQueryContextTest.cpp', '<(angle_path)/src/tests/standalone_tests/EGLQueryContextTest.cpp',
'<(angle_path)/src/tests/standalone_tests/EGLSurfaceTest.cpp', '<(angle_path)/src/tests/standalone_tests/EGLSurfaceTest.cpp',
'<(angle_path)/src/tests/standalone_tests/EGLThreadTest.cpp', '<(angle_path)/src/tests/standalone_tests/EGLThreadTest.cpp',
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
#include "EGLWindow.h" #include "EGLWindow.h"
#include "OSWindow.h" #include "OSWindow.h"
ANGLETest::ANGLETest(EGLint glesMajorVersion, const EGLPlatformParameters &platform) ANGLETest::ANGLETest()
: mEGLWindow(nullptr) : mEGLWindow(nullptr)
{ {
mEGLWindow = new EGLWindow(1280, 720, glesMajorVersion, platform); mEGLWindow = new EGLWindow(1280, 720, GetParam().mClientVersion, GetParam().mEGLPlatformParameters);
} }
ANGLETest::~ANGLETest() ANGLETest::~ANGLETest()
......
...@@ -7,18 +7,14 @@ ...@@ -7,18 +7,14 @@
#ifndef ANGLE_TESTS_ANGLE_TEST_H_ #ifndef ANGLE_TESTS_ANGLE_TEST_H_
#define ANGLE_TESTS_ANGLE_TEST_H_ #define ANGLE_TESTS_ANGLE_TEST_H_
#include "gtest/gtest.h" #include <gtest/gtest.h>
#define GL_GLEXT_PROTOTYPES
#include "angle_gl.h"
#include <algorithm> #include <algorithm>
#include "angle_gl.h"
#include "angle_test_configs.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "shader_utils.h" #include "shader_utils.h"
#include "testfixturetypes.h"
#define EXPECT_GL_ERROR(err) EXPECT_EQ((err), glGetError()) #define EXPECT_GL_ERROR(err) EXPECT_EQ((err), glGetError())
#define EXPECT_GL_NO_ERROR() EXPECT_GL_ERROR(GL_NO_ERROR) #define EXPECT_GL_NO_ERROR() EXPECT_GL_ERROR(GL_NO_ERROR)
...@@ -56,10 +52,10 @@ ...@@ -56,10 +52,10 @@
class EGLWindow; class EGLWindow;
class OSWindow; class OSWindow;
class ANGLETest : public testing::Test class ANGLETest : public ::testing::TestWithParam<angle::PlatformParameters>
{ {
protected: protected:
ANGLETest(EGLint glesMajorVersion, const EGLPlatformParameters &platform); ANGLETest();
~ANGLETest(); ~ANGLETest();
public: public:
......
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(BlendMinMaxTest, ES2_D3D9, ES2_D3D11, ES2_OPENGL);
template<typename T>
class BlendMinMaxTest : public ANGLETest class BlendMinMaxTest : public ANGLETest
{ {
protected: protected:
BlendMinMaxTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) BlendMinMaxTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -146,13 +150,13 @@ protected: ...@@ -146,13 +150,13 @@ protected:
GLuint mColorRenderbuffer; GLuint mColorRenderbuffer;
}; };
TYPED_TEST(BlendMinMaxTest, RGBA8) TEST_P(BlendMinMaxTest, RGBA8)
{ {
SetUpFramebuffer(GL_RGBA8); SetUpFramebuffer(GL_RGBA8);
runTest(); runTest();
} }
TYPED_TEST(BlendMinMaxTest, RGBA32f) TEST_P(BlendMinMaxTest, RGBA32f)
{ {
if (getClientVersion() < 3 && !extensionEnabled("GL_OES_texture_float")) if (getClientVersion() < 3 && !extensionEnabled("GL_OES_texture_float"))
{ {
...@@ -164,7 +168,7 @@ TYPED_TEST(BlendMinMaxTest, RGBA32f) ...@@ -164,7 +168,7 @@ TYPED_TEST(BlendMinMaxTest, RGBA32f)
runTest(); runTest();
} }
TYPED_TEST(BlendMinMaxTest, RGBA16F) TEST_P(BlendMinMaxTest, RGBA16F)
{ {
if (getClientVersion() < 3 && !extensionEnabled("GL_OES_texture_half_float")) if (getClientVersion() < 3 && !extensionEnabled("GL_OES_texture_half_float"))
{ {
...@@ -175,3 +179,6 @@ TYPED_TEST(BlendMinMaxTest, RGBA16F) ...@@ -175,3 +179,6 @@ TYPED_TEST(BlendMinMaxTest, RGBA16F)
SetUpFramebuffer(GL_RGBA16F); SetUpFramebuffer(GL_RGBA16F);
runTest(); runTest();
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(BlendMinMaxTest, ES2_D3D9(), ES2_D3D11(), ES2_OPENGL());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(BlitFramebufferANGLETest, ES2_D3D9, ES2_D3D11);
template<typename T>
class BlitFramebufferANGLETest : public ANGLETest class BlitFramebufferANGLETest : public ANGLETest
{ {
protected: protected:
BlitFramebufferANGLETest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) BlitFramebufferANGLETest()
{ {
setWindowWidth(256); setWindowWidth(256);
setWindowHeight(256); setWindowHeight(256);
...@@ -307,7 +311,7 @@ protected: ...@@ -307,7 +311,7 @@ protected:
}; };
// Draw to user-created framebuffer, blit whole-buffer color to original framebuffer. // Draw to user-created framebuffer, blit whole-buffer color to original framebuffer.
TYPED_TEST(BlitFramebufferANGLETest, BlitColorToDefault) TEST_P(BlitFramebufferANGLETest, BlitColorToDefault)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO); glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
...@@ -334,7 +338,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitColorToDefault) ...@@ -334,7 +338,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitColorToDefault)
} }
// Draw to system framebuffer, blit whole-buffer color to user-created framebuffer. // Draw to system framebuffer, blit whole-buffer color to user-created framebuffer.
TYPED_TEST(BlitFramebufferANGLETest, ReverseColorBlit) TEST_P(BlitFramebufferANGLETest, ReverseColorBlit)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO); glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO);
...@@ -361,7 +365,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ReverseColorBlit) ...@@ -361,7 +365,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ReverseColorBlit)
} }
// blit from user-created FBO to system framebuffer, with the scissor test enabled. // blit from user-created FBO to system framebuffer, with the scissor test enabled.
TYPED_TEST(BlitFramebufferANGLETest, ScissoredBlit) TEST_P(BlitFramebufferANGLETest, ScissoredBlit)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO); glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
...@@ -396,7 +400,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ScissoredBlit) ...@@ -396,7 +400,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ScissoredBlit)
} }
// blit from system FBO to user-created framebuffer, with the scissor test enabled. // blit from system FBO to user-created framebuffer, with the scissor test enabled.
TYPED_TEST(BlitFramebufferANGLETest, ReverseScissoredBlit) TEST_P(BlitFramebufferANGLETest, ReverseScissoredBlit)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO); glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO);
...@@ -431,7 +435,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ReverseScissoredBlit) ...@@ -431,7 +435,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ReverseScissoredBlit)
} }
// blit from user-created FBO to system framebuffer, using region larger than buffer. // blit from user-created FBO to system framebuffer, using region larger than buffer.
TYPED_TEST(BlitFramebufferANGLETest, OversizedBlit) TEST_P(BlitFramebufferANGLETest, OversizedBlit)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO); glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
...@@ -461,7 +465,7 @@ TYPED_TEST(BlitFramebufferANGLETest, OversizedBlit) ...@@ -461,7 +465,7 @@ TYPED_TEST(BlitFramebufferANGLETest, OversizedBlit)
} }
// blit from system FBO to user-created framebuffer, using region larger than buffer. // blit from system FBO to user-created framebuffer, using region larger than buffer.
TYPED_TEST(BlitFramebufferANGLETest, ReverseOversizedBlit) TEST_P(BlitFramebufferANGLETest, ReverseOversizedBlit)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO); glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO);
...@@ -490,7 +494,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ReverseOversizedBlit) ...@@ -490,7 +494,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ReverseOversizedBlit)
} }
// blit from user-created FBO to system framebuffer, with depth buffer. // blit from user-created FBO to system framebuffer, with depth buffer.
TYPED_TEST(BlitFramebufferANGLETest, BlitWithDepth) TEST_P(BlitFramebufferANGLETest, BlitWithDepth)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO); glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
...@@ -527,7 +531,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitWithDepth) ...@@ -527,7 +531,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitWithDepth)
} }
// blit from system FBO to user-created framebuffer, with depth buffer. // blit from system FBO to user-created framebuffer, with depth buffer.
TYPED_TEST(BlitFramebufferANGLETest, ReverseBlitWithDepth) TEST_P(BlitFramebufferANGLETest, ReverseBlitWithDepth)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO); glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO);
...@@ -564,7 +568,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ReverseBlitWithDepth) ...@@ -564,7 +568,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ReverseBlitWithDepth)
} }
// blit from one region of the system fbo to another-- this should fail. // blit from one region of the system fbo to another-- this should fail.
TYPED_TEST(BlitFramebufferANGLETest, BlitSameBufferOriginal) TEST_P(BlitFramebufferANGLETest, BlitSameBufferOriginal)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO); glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO);
...@@ -580,7 +584,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitSameBufferOriginal) ...@@ -580,7 +584,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitSameBufferOriginal)
} }
// blit from one region of the system fbo to another. // blit from one region of the system fbo to another.
TYPED_TEST(BlitFramebufferANGLETest, BlitSameBufferUser) TEST_P(BlitFramebufferANGLETest, BlitSameBufferUser)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO); glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
...@@ -595,7 +599,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitSameBufferUser) ...@@ -595,7 +599,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitSameBufferUser)
EXPECT_GL_ERROR(GL_INVALID_OPERATION); EXPECT_GL_ERROR(GL_INVALID_OPERATION);
} }
TYPED_TEST(BlitFramebufferANGLETest, BlitPartialColor) TEST_P(BlitFramebufferANGLETest, BlitPartialColor)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO); glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
...@@ -624,7 +628,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitPartialColor) ...@@ -624,7 +628,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitPartialColor)
EXPECT_PIXEL_EQ( getWindowWidth() / 4, 3 * getWindowHeight() / 4, 255, 0, 0, 255); EXPECT_PIXEL_EQ( getWindowWidth() / 4, 3 * getWindowHeight() / 4, 255, 0, 0, 255);
} }
TYPED_TEST(BlitFramebufferANGLETest, BlitDifferentSizes) TEST_P(BlitFramebufferANGLETest, BlitDifferentSizes)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO); glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
...@@ -652,7 +656,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitDifferentSizes) ...@@ -652,7 +656,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitDifferentSizes)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(BlitFramebufferANGLETest, BlitWithMissingAttachments) TEST_P(BlitFramebufferANGLETest, BlitWithMissingAttachments)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mColorOnlyFBO); glBindFramebuffer(GL_FRAMEBUFFER, mColorOnlyFBO);
...@@ -690,7 +694,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitWithMissingAttachments) ...@@ -690,7 +694,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitWithMissingAttachments)
EXPECT_PIXEL_EQ( getWindowWidth() / 4, 3 * getWindowHeight() / 4, 0, 0, 255, 255); EXPECT_PIXEL_EQ( getWindowWidth() / 4, 3 * getWindowHeight() / 4, 0, 0, 255, 255);
} }
TYPED_TEST(BlitFramebufferANGLETest, BlitStencil) TEST_P(BlitFramebufferANGLETest, BlitStencil)
{ {
// TODO(jmadill): Figure out if we can fix this on D3D9. // TODO(jmadill): Figure out if we can fix this on D3D9.
// https://code.google.com/p/angleproject/issues/detail?id=809 // https://code.google.com/p/angleproject/issues/detail?id=809
...@@ -740,7 +744,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitStencil) ...@@ -740,7 +744,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitStencil)
} }
// make sure that attempting to blit a partial depth buffer issues an error // make sure that attempting to blit a partial depth buffer issues an error
TYPED_TEST(BlitFramebufferANGLETest, BlitPartialDepthStencil) TEST_P(BlitFramebufferANGLETest, BlitPartialDepthStencil)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO); glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
...@@ -759,7 +763,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitPartialDepthStencil) ...@@ -759,7 +763,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitPartialDepthStencil)
} }
// Test blit with MRT framebuffers // Test blit with MRT framebuffers
TYPED_TEST(BlitFramebufferANGLETest, BlitMRT) TEST_P(BlitFramebufferANGLETest, BlitMRT)
{ {
if (!extensionEnabled("GL_EXT_draw_buffers")) if (!extensionEnabled("GL_EXT_draw_buffers"))
{ {
...@@ -807,7 +811,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitMRT) ...@@ -807,7 +811,7 @@ TYPED_TEST(BlitFramebufferANGLETest, BlitMRT)
} }
// Make sure that attempts to stretch in a blit call issue an error // Make sure that attempts to stretch in a blit call issue an error
TYPED_TEST(BlitFramebufferANGLETest, ErrorStretching) TEST_P(BlitFramebufferANGLETest, ErrorStretching)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO); glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
...@@ -826,7 +830,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ErrorStretching) ...@@ -826,7 +830,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ErrorStretching)
} }
// Make sure that attempts to flip in a blit call issue an error // Make sure that attempts to flip in a blit call issue an error
TYPED_TEST(BlitFramebufferANGLETest, ErrorFlipping) TEST_P(BlitFramebufferANGLETest, ErrorFlipping)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO); glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
...@@ -844,7 +848,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ErrorFlipping) ...@@ -844,7 +848,7 @@ TYPED_TEST(BlitFramebufferANGLETest, ErrorFlipping)
EXPECT_GL_ERROR(GL_INVALID_OPERATION); EXPECT_GL_ERROR(GL_INVALID_OPERATION);
} }
TYPED_TEST(BlitFramebufferANGLETest, Errors) TEST_P(BlitFramebufferANGLETest, Errors)
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO); glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
...@@ -883,3 +887,6 @@ TYPED_TEST(BlitFramebufferANGLETest, Errors) ...@@ -883,3 +887,6 @@ TYPED_TEST(BlitFramebufferANGLETest, Errors)
} }
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(BlitFramebufferANGLETest, ES2_D3D9(), ES2_D3D11());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
#include <cstdint> #include <cstdint>
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(BufferDataTest, ES2_D3D9, ES2_D3D11, ES2_OPENGL);
template<typename T>
class BufferDataTest : public ANGLETest class BufferDataTest : public ANGLETest
{ {
protected: protected:
BufferDataTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) BufferDataTest()
{ {
setWindowWidth(16); setWindowWidth(16);
setWindowHeight(16); setWindowHeight(16);
...@@ -81,7 +85,7 @@ class BufferDataTest : public ANGLETest ...@@ -81,7 +85,7 @@ class BufferDataTest : public ANGLETest
GLint mAttribLocation; GLint mAttribLocation;
}; };
TYPED_TEST(BufferDataTest, NULLData) TEST_P(BufferDataTest, NULLData)
{ {
glBindBuffer(GL_ARRAY_BUFFER, mBuffer); glBindBuffer(GL_ARRAY_BUFFER, mBuffer);
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
...@@ -104,7 +108,7 @@ TYPED_TEST(BufferDataTest, NULLData) ...@@ -104,7 +108,7 @@ TYPED_TEST(BufferDataTest, NULLData)
} }
} }
TYPED_TEST(BufferDataTest, ZeroNonNULLData) TEST_P(BufferDataTest, ZeroNonNULLData)
{ {
glBindBuffer(GL_ARRAY_BUFFER, mBuffer); glBindBuffer(GL_ARRAY_BUFFER, mBuffer);
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
...@@ -119,7 +123,7 @@ TYPED_TEST(BufferDataTest, ZeroNonNULLData) ...@@ -119,7 +123,7 @@ TYPED_TEST(BufferDataTest, ZeroNonNULLData)
delete [] zeroData; delete [] zeroData;
} }
TYPED_TEST(BufferDataTest, NULLResolvedData) TEST_P(BufferDataTest, NULLResolvedData)
{ {
glBindBuffer(GL_ARRAY_BUFFER, mBuffer); glBindBuffer(GL_ARRAY_BUFFER, mBuffer);
glBufferData(GL_ARRAY_BUFFER, 128, NULL, GL_DYNAMIC_DRAW); glBufferData(GL_ARRAY_BUFFER, 128, NULL, GL_DYNAMIC_DRAW);
...@@ -134,7 +138,7 @@ TYPED_TEST(BufferDataTest, NULLResolvedData) ...@@ -134,7 +138,7 @@ TYPED_TEST(BufferDataTest, NULLResolvedData)
// Tests that a huge allocation returns GL_OUT_OF_MEMORY // Tests that a huge allocation returns GL_OUT_OF_MEMORY
// TODO(jmadill): Figure out how to test this reliably on the Chromium bots // TODO(jmadill): Figure out how to test this reliably on the Chromium bots
TYPED_TEST(BufferDataTest, DISABLED_HugeSetDataShouldNotCrash) TEST_P(BufferDataTest, DISABLED_HugeSetDataShouldNotCrash)
{ {
glBindBuffer(GL_ARRAY_BUFFER, mBuffer); glBindBuffer(GL_ARRAY_BUFFER, mBuffer);
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
...@@ -203,14 +207,10 @@ TYPED_TEST(BufferDataTest, DISABLED_HugeSetDataShouldNotCrash) ...@@ -203,14 +207,10 @@ TYPED_TEST(BufferDataTest, DISABLED_HugeSetDataShouldNotCrash)
delete[] data; delete[] data;
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_TYPED_TEST_CASE(IndexedBufferCopyTest, ES3_D3D11);
template<typename T>
class IndexedBufferCopyTest : public ANGLETest class IndexedBufferCopyTest : public ANGLETest
{ {
protected: protected:
IndexedBufferCopyTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) IndexedBufferCopyTest()
{ {
setWindowWidth(16); setWindowWidth(16);
setWindowHeight(16); setWindowHeight(16);
...@@ -285,7 +285,7 @@ class IndexedBufferCopyTest : public ANGLETest ...@@ -285,7 +285,7 @@ class IndexedBufferCopyTest : public ANGLETest
// The following test covers an ANGLE bug where our index ranges // The following test covers an ANGLE bug where our index ranges
// weren't updated from CopyBufferSubData calls // weren't updated from CopyBufferSubData calls
// https://code.google.com/p/angleproject/issues/detail?id=709 // https://code.google.com/p/angleproject/issues/detail?id=709
TYPED_TEST(IndexedBufferCopyTest, IndexRangeBug) TEST_P(IndexedBufferCopyTest, IndexRangeBug)
{ {
unsigned char vertexData[] = { 255, 0, 0, 0, 0, 0 }; unsigned char vertexData[] = { 255, 0, 0, 0, 0, 0 };
unsigned int indexData[] = { 0, 1 }; unsigned int indexData[] = { 0, 1 };
...@@ -332,18 +332,14 @@ TYPED_TEST(IndexedBufferCopyTest, IndexRangeBug) ...@@ -332,18 +332,14 @@ TYPED_TEST(IndexedBufferCopyTest, IndexRangeBug)
EXPECT_PIXEL_EQ(0, 0, 0, 255, 0, 255); EXPECT_PIXEL_EQ(0, 0, 0, 255, 0, 255);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. class BufferDataTestES3 : public BufferDataTest
ANGLE_TYPED_TEST_CASE(BufferDataTestES3, ES3_D3D11);
template<typename T>
class BufferDataTestES3 : public BufferDataTest<T>
{ {
}; };
// The following test covers an ANGLE bug where the buffer storage // The following test covers an ANGLE bug where the buffer storage
// is not resized by Buffer11::getLatestBufferStorage when needed. // is not resized by Buffer11::getLatestBufferStorage when needed.
// https://code.google.com/p/angleproject/issues/detail?id=897 // https://code.google.com/p/angleproject/issues/detail?id=897
TYPED_TEST(BufferDataTestES3, BufferResizing) TEST_P(BufferDataTestES3, BufferResizing)
{ {
glBindBuffer(GL_ARRAY_BUFFER, mBuffer); glBindBuffer(GL_ARRAY_BUFFER, mBuffer);
ASSERT_GL_NO_ERROR(); ASSERT_GL_NO_ERROR();
...@@ -403,3 +399,12 @@ TYPED_TEST(BufferDataTestES3, BufferResizing) ...@@ -403,3 +399,12 @@ TYPED_TEST(BufferDataTestES3, BufferResizing)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(BufferDataTestES3, ES3_D3D11());
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(IndexedBufferCopyTest, ES3_D3D11());
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(BufferDataTest, ES2_D3D9(), ES2_D3D11(), ES2_OPENGL());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(ClearTest, ES2_D3D9, ES2_D3D11, ES3_D3D11, ES2_OPENGL, ES3_OPENGL);
ANGLE_TYPED_TEST_CASE(ClearTestES3, ES3_D3D11);
template<typename T>
class ClearTestBase : public ANGLETest class ClearTestBase : public ANGLETest
{ {
protected: protected:
ClearTestBase() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) ClearTestBase()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -67,15 +70,10 @@ class ClearTestBase : public ANGLETest ...@@ -67,15 +70,10 @@ class ClearTestBase : public ANGLETest
GLuint mFBO; GLuint mFBO;
}; };
template <typename T> class ClearTest : public ClearTestBase {};
class ClearTest : public ClearTestBase<T> class ClearTestES3 : public ClearTestBase {};
{};
template <typename T>
class ClearTestES3 : public ClearTestBase<T>
{};
TYPED_TEST(ClearTest, ClearIssue) TEST_P(ClearTest, ClearIssue)
{ {
// TODO(geofflang): Figure out why this is broken on Intel OpenGL // TODO(geofflang): Figure out why this is broken on Intel OpenGL
if (isIntel() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE) if (isIntel() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
...@@ -123,7 +121,7 @@ TYPED_TEST(ClearTest, ClearIssue) ...@@ -123,7 +121,7 @@ TYPED_TEST(ClearTest, ClearIssue)
// Requires ES3 // Requires ES3
// This tests a bug where in a masked clear when calling "ClearBuffer", we would // This tests a bug where in a masked clear when calling "ClearBuffer", we would
// mistakenly clear every channel (including the masked-out ones) // mistakenly clear every channel (including the masked-out ones)
TYPED_TEST(ClearTestES3, MaskedClearBufferBug) TEST_P(ClearTestES3, MaskedClearBufferBug)
{ {
unsigned char pixelData[] = { 255, 255, 255, 255 }; unsigned char pixelData[] = { 255, 255, 255, 255 };
...@@ -162,7 +160,7 @@ TYPED_TEST(ClearTestES3, MaskedClearBufferBug) ...@@ -162,7 +160,7 @@ TYPED_TEST(ClearTestES3, MaskedClearBufferBug)
glDeleteTextures(2, textures); glDeleteTextures(2, textures);
} }
TYPED_TEST(ClearTestES3, BadFBOSerialBug) TEST_P(ClearTestES3, BadFBOSerialBug)
{ {
// First make a simple framebuffer, and clear it to green // First make a simple framebuffer, and clear it to green
glBindFramebuffer(GL_FRAMEBUFFER, mFBO); glBindFramebuffer(GL_FRAMEBUFFER, mFBO);
...@@ -209,3 +207,7 @@ TYPED_TEST(ClearTestES3, BadFBOSerialBug) ...@@ -209,3 +207,7 @@ TYPED_TEST(ClearTestES3, BadFBOSerialBug)
glDeleteTextures(2, textures); glDeleteTextures(2, textures);
glDeleteFramebuffers(1, &fbo2); glDeleteFramebuffers(1, &fbo2);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(ClearTest, ES2_D3D9(), ES2_D3D11(), ES3_D3D11(), ES2_OPENGL(), ES3_OPENGL());
ANGLE_INSTANTIATE_TEST(ClearTestES3, ES3_D3D11());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
#include "media/pixel.inl" #include "media/pixel.inl"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(CompressedTextureTest, ES2_D3D9, ES2_D3D11, ES2_D3D11_FL9_3, ES2_OPENGL, ES3_OPENGL);
template<typename T>
class CompressedTextureTest : public ANGLETest class CompressedTextureTest : public ANGLETest
{ {
protected: protected:
CompressedTextureTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) CompressedTextureTest()
{ {
setWindowWidth(512); setWindowWidth(512);
setWindowHeight(512); setWindowHeight(512);
...@@ -70,7 +75,7 @@ protected: ...@@ -70,7 +75,7 @@ protected:
GLint mTextureUniformLocation; GLint mTextureUniformLocation;
}; };
TYPED_TEST(CompressedTextureTest, CompressedTexImage) TEST_P(CompressedTextureTest, CompressedTexImage)
{ {
if (!extensionEnabled("GL_EXT_texture_compression_dxt1")) if (!extensionEnabled("GL_EXT_texture_compression_dxt1"))
{ {
...@@ -111,7 +116,7 @@ TYPED_TEST(CompressedTextureTest, CompressedTexImage) ...@@ -111,7 +116,7 @@ TYPED_TEST(CompressedTextureTest, CompressedTexImage)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(CompressedTextureTest, CompressedTexStorage) TEST_P(CompressedTextureTest, CompressedTexStorage)
{ {
if (!extensionEnabled("GL_EXT_texture_compression_dxt1")) if (!extensionEnabled("GL_EXT_texture_compression_dxt1"))
{ {
...@@ -168,18 +173,11 @@ TYPED_TEST(CompressedTextureTest, CompressedTexStorage) ...@@ -168,18 +173,11 @@ TYPED_TEST(CompressedTextureTest, CompressedTexStorage)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. class CompressedTextureTestES3 : public CompressedTextureTest { };
ANGLE_TYPED_TEST_CASE(CompressedTextureTestES3, ES3_D3D11);
template<typename T>
class CompressedTextureTestES3 : public CompressedTextureTest<T> { };
ANGLE_TYPED_TEST_CASE(CompressedTextureTestD3D11, ES2_D3D11, ES3_D3D11, ES2_D3D11_FL9_3);
template<typename T> class CompressedTextureTestD3D11 : public CompressedTextureTest { };
class CompressedTextureTestD3D11 : public CompressedTextureTest<T> { };
TYPED_TEST(CompressedTextureTestES3, PBOCompressedTexImage) TEST_P(CompressedTextureTestES3, PBOCompressedTexImage)
{ {
GLuint texture; GLuint texture;
glGenTextures(1, &texture); glGenTextures(1, &texture);
...@@ -232,7 +230,7 @@ TYPED_TEST(CompressedTextureTestES3, PBOCompressedTexImage) ...@@ -232,7 +230,7 @@ TYPED_TEST(CompressedTextureTestES3, PBOCompressedTexImage)
} }
TYPED_TEST(CompressedTextureTestD3D11, PBOCompressedTexStorage) TEST_P(CompressedTextureTestD3D11, PBOCompressedTexStorage)
{ {
if (getClientVersion() < 3 && !extensionEnabled("GL_EXT_texture_compression_dxt1")) if (getClientVersion() < 3 && !extensionEnabled("GL_EXT_texture_compression_dxt1"))
{ {
...@@ -302,3 +300,13 @@ TYPED_TEST(CompressedTextureTestD3D11, PBOCompressedTexStorage) ...@@ -302,3 +300,13 @@ TYPED_TEST(CompressedTextureTestD3D11, PBOCompressedTexStorage)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(
CompressedTextureTest,
ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3(), ES2_OPENGL(), ES3_OPENGL());
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(CompressedTextureTestES3, ES3_D3D11());
ANGLE_INSTANTIATE_TEST(CompressedTextureTestD3D11, ES2_D3D11(), ES3_D3D11(), ES2_D3D11_FL9_3());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(CubeMapTextureTest, ES2_D3D11, ES2_D3D11_FL9_3);
template<typename T>
class CubeMapTextureTest : public ANGLETest class CubeMapTextureTest : public ANGLETest
{ {
protected: protected:
CubeMapTextureTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) CubeMapTextureTest()
{ {
setWindowWidth(256); setWindowWidth(256);
setWindowHeight(256); setWindowHeight(256);
...@@ -71,7 +75,7 @@ protected: ...@@ -71,7 +75,7 @@ protected:
}; };
// Verify that rendering to the faces of a cube map consecutively will correctly render to each face. // Verify that rendering to the faces of a cube map consecutively will correctly render to each face.
TYPED_TEST(CubeMapTextureTest, RenderToFacesConsecutively) TEST_P(CubeMapTextureTest, RenderToFacesConsecutively)
{ {
const GLfloat faceColors[] = const GLfloat faceColors[] =
{ {
...@@ -123,3 +127,6 @@ TYPED_TEST(CubeMapTextureTest, RenderToFacesConsecutively) ...@@ -123,3 +127,6 @@ TYPED_TEST(CubeMapTextureTest, RenderToFacesConsecutively)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(CubeMapTextureTest, ES2_D3D11(), ES2_D3D11_FL9_3());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(DepthStencilFormatsTest, ES2_D3D9, ES2_D3D11);
ANGLE_TYPED_TEST_CASE(DepthStencilFormatsTestES3, ES3_D3D11);
template<typename T>
class DepthStencilFormatsTestBase : public ANGLETest class DepthStencilFormatsTestBase : public ANGLETest
{ {
protected: protected:
DepthStencilFormatsTestBase() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) DepthStencilFormatsTestBase()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -112,15 +115,13 @@ class DepthStencilFormatsTestBase : public ANGLETest ...@@ -112,15 +115,13 @@ class DepthStencilFormatsTestBase : public ANGLETest
GLint mTextureUniformLocation; GLint mTextureUniformLocation;
}; };
template <typename T> class DepthStencilFormatsTest : public DepthStencilFormatsTestBase
class DepthStencilFormatsTest : public DepthStencilFormatsTestBase<T>
{}; {};
template <typename T> class DepthStencilFormatsTestES3 : public DepthStencilFormatsTestBase
class DepthStencilFormatsTestES3 : public DepthStencilFormatsTestBase<T>
{}; {};
TYPED_TEST(DepthStencilFormatsTest, DepthTexture) TEST_P(DepthStencilFormatsTest, DepthTexture)
{ {
bool shouldHaveTextureSupport = extensionEnabled("GL_ANGLE_depth_texture"); bool shouldHaveTextureSupport = extensionEnabled("GL_ANGLE_depth_texture");
EXPECT_EQ(shouldHaveTextureSupport, checkTexImageFormatSupport(GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT)); EXPECT_EQ(shouldHaveTextureSupport, checkTexImageFormatSupport(GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT));
...@@ -133,7 +134,7 @@ TYPED_TEST(DepthStencilFormatsTest, DepthTexture) ...@@ -133,7 +134,7 @@ TYPED_TEST(DepthStencilFormatsTest, DepthTexture)
} }
} }
TYPED_TEST(DepthStencilFormatsTest, PackedDepthStencil) TEST_P(DepthStencilFormatsTest, PackedDepthStencil)
{ {
// Expected to fail in D3D9 if GL_OES_packed_depth_stencil is not present. // Expected to fail in D3D9 if GL_OES_packed_depth_stencil is not present.
// Expected to fail in D3D11 if GL_OES_packed_depth_stencil or GL_ANGLE_depth_texture is not present. // Expected to fail in D3D11 if GL_OES_packed_depth_stencil or GL_ANGLE_depth_texture is not present.
...@@ -151,7 +152,7 @@ TYPED_TEST(DepthStencilFormatsTest, PackedDepthStencil) ...@@ -151,7 +152,7 @@ TYPED_TEST(DepthStencilFormatsTest, PackedDepthStencil)
} }
} }
TYPED_TEST(DepthStencilFormatsTestES3, DrawWithDepthStencil) TEST_P(DepthStencilFormatsTestES3, DrawWithDepthStencil)
{ {
GLushort data[16]; GLushort data[16];
for (unsigned int i = 0; i < 16; i++) for (unsigned int i = 0; i < 16; i++)
...@@ -175,3 +176,7 @@ TYPED_TEST(DepthStencilFormatsTestES3, DrawWithDepthStencil) ...@@ -175,3 +176,7 @@ TYPED_TEST(DepthStencilFormatsTestES3, DrawWithDepthStencil)
EXPECT_PIXEL_NEAR(0, 0, 255, 0, 0, 255, 2.0); EXPECT_PIXEL_NEAR(0, 0, 255, 0, 0, 255, 2.0);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(DepthStencilFormatsTest, ES2_D3D9(), ES2_D3D11());
ANGLE_INSTANTIATE_TEST(DepthStencilFormatsTestES3, ES3_D3D11());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(DrawBuffersTest, ES2_D3D11, ES3_D3D11);
template<typename T>
class DrawBuffersTest : public ANGLETest class DrawBuffersTest : public ANGLETest
{ {
protected: protected:
DrawBuffersTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) DrawBuffersTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -201,7 +205,7 @@ class DrawBuffersTest : public ANGLETest ...@@ -201,7 +205,7 @@ class DrawBuffersTest : public ANGLETest
GLuint mBuffer; GLuint mBuffer;
}; };
TYPED_TEST(DrawBuffersTest, Gaps) TEST_P(DrawBuffersTest, Gaps)
{ {
glBindTexture(GL_TEXTURE_2D, mTextures[0]); glBindTexture(GL_TEXTURE_2D, mTextures[0]);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, mTextures[0], 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, mTextures[0], 0);
...@@ -225,7 +229,7 @@ TYPED_TEST(DrawBuffersTest, Gaps) ...@@ -225,7 +229,7 @@ TYPED_TEST(DrawBuffersTest, Gaps)
glDeleteProgram(program); glDeleteProgram(program);
} }
TYPED_TEST(DrawBuffersTest, FirstAndLast) TEST_P(DrawBuffersTest, FirstAndLast)
{ {
glBindTexture(GL_TEXTURE_2D, mTextures[0]); glBindTexture(GL_TEXTURE_2D, mTextures[0]);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[0], 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[0], 0);
...@@ -258,7 +262,7 @@ TYPED_TEST(DrawBuffersTest, FirstAndLast) ...@@ -258,7 +262,7 @@ TYPED_TEST(DrawBuffersTest, FirstAndLast)
glDeleteProgram(program); glDeleteProgram(program);
} }
TYPED_TEST(DrawBuffersTest, FirstHalfNULL) TEST_P(DrawBuffersTest, FirstHalfNULL)
{ {
bool flags[8] = { false }; bool flags[8] = { false };
GLenum bufs[8] = { GL_NONE }; GLenum bufs[8] = { GL_NONE };
...@@ -288,7 +292,7 @@ TYPED_TEST(DrawBuffersTest, FirstHalfNULL) ...@@ -288,7 +292,7 @@ TYPED_TEST(DrawBuffersTest, FirstHalfNULL)
glDeleteProgram(program); glDeleteProgram(program);
} }
TYPED_TEST(DrawBuffersTest, UnwrittenOutputVariablesShouldNotCrash) TEST_P(DrawBuffersTest, UnwrittenOutputVariablesShouldNotCrash)
{ {
// Bind two render targets but use a shader which writes only to the first one. // Bind two render targets but use a shader which writes only to the first one.
glBindTexture(GL_TEXTURE_2D, mTextures[0]); glBindTexture(GL_TEXTURE_2D, mTextures[0]);
...@@ -322,3 +326,6 @@ TYPED_TEST(DrawBuffersTest, UnwrittenOutputVariablesShouldNotCrash) ...@@ -322,3 +326,6 @@ TYPED_TEST(DrawBuffersTest, UnwrittenOutputVariablesShouldNotCrash)
glDeleteProgram(program); glDeleteProgram(program);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(DrawBuffersTest, ES2_D3D11(), ES3_D3D11());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(FenceNVTest, ES2_D3D9, ES2_D3D11, ES3_D3D11, ES2_OPENGL, ES3_OPENGL);
ANGLE_TYPED_TEST_CASE(FenceSyncTest, ES3_D3D11, ES3_OPENGL);
template<typename T>
class FenceNVTest : public ANGLETest class FenceNVTest : public ANGLETest
{ {
protected: protected:
FenceNVTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) FenceNVTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -20,11 +23,10 @@ class FenceNVTest : public ANGLETest ...@@ -20,11 +23,10 @@ class FenceNVTest : public ANGLETest
} }
}; };
template<typename T>
class FenceSyncTest : public ANGLETest class FenceSyncTest : public ANGLETest
{ {
protected: protected:
FenceSyncTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) FenceSyncTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -37,7 +39,7 @@ protected: ...@@ -37,7 +39,7 @@ protected:
}; };
// FenceNV objects should respond false to glIsFenceNV until they've been set // FenceNV objects should respond false to glIsFenceNV until they've been set
TYPED_TEST(FenceNVTest, IsFence) TEST_P(FenceNVTest, IsFence)
{ {
if (!extensionEnabled("GL_NV_fence")) if (!extensionEnabled("GL_NV_fence"))
{ {
...@@ -60,7 +62,7 @@ TYPED_TEST(FenceNVTest, IsFence) ...@@ -60,7 +62,7 @@ TYPED_TEST(FenceNVTest, IsFence)
} }
// Test error cases for all FenceNV functions // Test error cases for all FenceNV functions
TYPED_TEST(FenceNVTest, Errors) TEST_P(FenceNVTest, Errors)
{ {
if (!extensionEnabled("GL_NV_fence")) if (!extensionEnabled("GL_NV_fence"))
{ {
...@@ -107,7 +109,7 @@ TYPED_TEST(FenceNVTest, Errors) ...@@ -107,7 +109,7 @@ TYPED_TEST(FenceNVTest, Errors)
} }
// Test that basic usage works and doesn't generate errors or crash // Test that basic usage works and doesn't generate errors or crash
TYPED_TEST(FenceNVTest, BasicOperations) TEST_P(FenceNVTest, BasicOperations)
{ {
if (!extensionEnabled("GL_NV_fence")) if (!extensionEnabled("GL_NV_fence"))
{ {
...@@ -144,7 +146,7 @@ TYPED_TEST(FenceNVTest, BasicOperations) ...@@ -144,7 +146,7 @@ TYPED_TEST(FenceNVTest, BasicOperations)
} }
// FenceSync objects should respond true to IsSync after they are created with glFenceSync // FenceSync objects should respond true to IsSync after they are created with glFenceSync
TYPED_TEST(FenceSyncTest, IsSync) TEST_P(FenceSyncTest, IsSync)
{ {
GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
...@@ -154,7 +156,7 @@ TYPED_TEST(FenceSyncTest, IsSync) ...@@ -154,7 +156,7 @@ TYPED_TEST(FenceSyncTest, IsSync)
} }
// Test error cases for all FenceSync function // Test error cases for all FenceSync function
TYPED_TEST(FenceSyncTest, Errors) TEST_P(FenceSyncTest, Errors)
{ {
GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
...@@ -206,7 +208,7 @@ TYPED_TEST(FenceSyncTest, Errors) ...@@ -206,7 +208,7 @@ TYPED_TEST(FenceSyncTest, Errors)
} }
// Test usage of glGetSynciv // Test usage of glGetSynciv
TYPED_TEST(FenceSyncTest, BasicQueries) TEST_P(FenceSyncTest, BasicQueries)
{ {
GLsizei length = 0; GLsizei length = 0;
GLint value = 0; GLint value = 0;
...@@ -226,7 +228,7 @@ TYPED_TEST(FenceSyncTest, BasicQueries) ...@@ -226,7 +228,7 @@ TYPED_TEST(FenceSyncTest, BasicQueries)
} }
// Test that basic usage works and doesn't generate errors or crash // Test that basic usage works and doesn't generate errors or crash
TYPED_TEST(FenceSyncTest, BasicOperations) TEST_P(FenceSyncTest, BasicOperations)
{ {
// TODO(geofflang): Figure out why this is broken on Intel OpenGL // TODO(geofflang): Figure out why this is broken on Intel OpenGL
if (isIntel() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE) if (isIntel() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
...@@ -258,3 +260,7 @@ TYPED_TEST(FenceSyncTest, BasicOperations) ...@@ -258,3 +260,7 @@ TYPED_TEST(FenceSyncTest, BasicOperations)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(FenceNVTest, ES2_D3D9(), ES2_D3D11(), ES3_D3D11(), ES2_OPENGL(), ES3_OPENGL());
ANGLE_INSTANTIATE_TEST(FenceSyncTest, ES3_D3D11(), ES3_OPENGL());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(FramebufferFormatsTest, ES2_D3D9, ES2_D3D11, ES3_D3D11);
template<typename T>
class FramebufferFormatsTest : public ANGLETest class FramebufferFormatsTest : public ANGLETest
{ {
protected: protected:
FramebufferFormatsTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) FramebufferFormatsTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -66,7 +70,8 @@ protected: ...@@ -66,7 +70,8 @@ protected:
void testRenderbufferMultisampleFormat(int minESVersion, GLenum attachmentType, GLenum internalFormat) void testRenderbufferMultisampleFormat(int minESVersion, GLenum attachmentType, GLenum internalFormat)
{ {
if (T::GetGlesMajorVersion() < minESVersion) GLint clientVersion = GetParam().mClientVersion;
if (clientVersion < minESVersion)
{ {
return; return;
} }
...@@ -74,7 +79,7 @@ protected: ...@@ -74,7 +79,7 @@ protected:
// Check that multisample is supported with at least two samples (minimum required is 1) // Check that multisample is supported with at least two samples (minimum required is 1)
bool supports2Samples = false; bool supports2Samples = false;
if (T::GetGlesMajorVersion() == 2) if (clientVersion == 2)
{ {
if (extensionEnabled("ANGLE_framebuffer_multisample")) if (extensionEnabled("ANGLE_framebuffer_multisample"))
{ {
...@@ -85,7 +90,7 @@ protected: ...@@ -85,7 +90,7 @@ protected:
} }
else else
{ {
assert(T::GetGlesMajorVersion() >= 3); assert(clientVersion >= 3);
int maxSamples; int maxSamples;
glGetIntegerv(GL_MAX_SAMPLES, &maxSamples); glGetIntegerv(GL_MAX_SAMPLES, &maxSamples);
supports2Samples = maxSamples >= 2; supports2Samples = maxSamples >= 2;
...@@ -125,57 +130,60 @@ protected: ...@@ -125,57 +130,60 @@ protected:
} }
}; };
TYPED_TEST(FramebufferFormatsTest, RGBA4) TEST_P(FramebufferFormatsTest, RGBA4)
{ {
testTextureFormat(GL_RGBA4, 4, 4, 4, 4); testTextureFormat(GL_RGBA4, 4, 4, 4, 4);
} }
TYPED_TEST(FramebufferFormatsTest, RGB565) TEST_P(FramebufferFormatsTest, RGB565)
{ {
testTextureFormat(GL_RGB565, 5, 6, 5, 0); testTextureFormat(GL_RGB565, 5, 6, 5, 0);
} }
TYPED_TEST(FramebufferFormatsTest, RGB8) TEST_P(FramebufferFormatsTest, RGB8)
{ {
testTextureFormat(GL_RGB8_OES, 8, 8, 8, 0); testTextureFormat(GL_RGB8_OES, 8, 8, 8, 0);
} }
TYPED_TEST(FramebufferFormatsTest, BGRA8) TEST_P(FramebufferFormatsTest, BGRA8)
{ {
testTextureFormat(GL_BGRA8_EXT, 8, 8, 8, 8); testTextureFormat(GL_BGRA8_EXT, 8, 8, 8, 8);
} }
TYPED_TEST(FramebufferFormatsTest, RGBA8) TEST_P(FramebufferFormatsTest, RGBA8)
{ {
testTextureFormat(GL_RGBA8_OES, 8, 8, 8, 8); testTextureFormat(GL_RGBA8_OES, 8, 8, 8, 8);
} }
TYPED_TEST(FramebufferFormatsTest, RenderbufferMultisample_DEPTH16) TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH16)
{ {
testRenderbufferMultisampleFormat(2, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT16); testRenderbufferMultisampleFormat(2, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT16);
} }
TYPED_TEST(FramebufferFormatsTest, RenderbufferMultisample_DEPTH24) TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH24)
{ {
testRenderbufferMultisampleFormat(3, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT24); testRenderbufferMultisampleFormat(3, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT24);
} }
TYPED_TEST(FramebufferFormatsTest, RenderbufferMultisample_DEPTH32F) TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH32F)
{ {
testRenderbufferMultisampleFormat(3, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT32F); testRenderbufferMultisampleFormat(3, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT32F);
} }
TYPED_TEST(FramebufferFormatsTest, RenderbufferMultisample_DEPTH24_STENCIL8) TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH24_STENCIL8)
{ {
testRenderbufferMultisampleFormat(3, GL_DEPTH_STENCIL_ATTACHMENT, GL_DEPTH24_STENCIL8); testRenderbufferMultisampleFormat(3, GL_DEPTH_STENCIL_ATTACHMENT, GL_DEPTH24_STENCIL8);
} }
TYPED_TEST(FramebufferFormatsTest, RenderbufferMultisample_DEPTH32F_STENCIL8) TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH32F_STENCIL8)
{ {
testRenderbufferMultisampleFormat(3, GL_DEPTH_STENCIL_ATTACHMENT, GL_DEPTH32F_STENCIL8); testRenderbufferMultisampleFormat(3, GL_DEPTH_STENCIL_ATTACHMENT, GL_DEPTH32F_STENCIL8);
} }
TYPED_TEST(FramebufferFormatsTest, RenderbufferMultisample_STENCIL_INDEX8) TEST_P(FramebufferFormatsTest, RenderbufferMultisample_STENCIL_INDEX8)
{ {
testRenderbufferMultisampleFormat(2, GL_STENCIL_ATTACHMENT, GL_STENCIL_INDEX8); testRenderbufferMultisampleFormat(2, GL_STENCIL_ATTACHMENT, GL_STENCIL_INDEX8);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(FramebufferFormatsTest, ES2_D3D9(), ES2_D3D11(), ES3_D3D11());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(FramebufferRenderMipmapTest, ES2_D3D9, ES2_D3D11, ES3_D3D11, ES2_OPENGL, ES3_OPENGL);
template<typename T>
class FramebufferRenderMipmapTest : public ANGLETest class FramebufferRenderMipmapTest : public ANGLETest
{ {
protected: protected:
FramebufferRenderMipmapTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) FramebufferRenderMipmapTest()
{ {
setWindowWidth(256); setWindowWidth(256);
setWindowHeight(256); setWindowHeight(256);
...@@ -72,7 +76,7 @@ protected: ...@@ -72,7 +76,7 @@ protected:
// Validate that if we are in ES3 or GL_OES_fbo_render_mipmap exists, there are no validation errors // Validate that if we are in ES3 or GL_OES_fbo_render_mipmap exists, there are no validation errors
// when using a non-zero level in glFramebufferTexture2D. // when using a non-zero level in glFramebufferTexture2D.
TYPED_TEST(FramebufferRenderMipmapTest, Validation) TEST_P(FramebufferRenderMipmapTest, Validation)
{ {
bool renderToMipmapSupported = extensionEnabled("GL_OES_fbo_render_mipmap") || getClientVersion() > 2; bool renderToMipmapSupported = extensionEnabled("GL_OES_fbo_render_mipmap") || getClientVersion() > 2;
...@@ -114,7 +118,7 @@ TYPED_TEST(FramebufferRenderMipmapTest, Validation) ...@@ -114,7 +118,7 @@ TYPED_TEST(FramebufferRenderMipmapTest, Validation)
} }
// Render to various levels of a texture and check that they have the correct color data via ReadPixels // Render to various levels of a texture and check that they have the correct color data via ReadPixels
TYPED_TEST(FramebufferRenderMipmapTest, RenderToMipmap) TEST_P(FramebufferRenderMipmapTest, RenderToMipmap)
{ {
// TODO(geofflang): Figure out why this is broken on Intel OpenGL // TODO(geofflang): Figure out why this is broken on Intel OpenGL
if (isIntel() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE) if (isIntel() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
...@@ -186,3 +190,6 @@ TYPED_TEST(FramebufferRenderMipmapTest, RenderToMipmap) ...@@ -186,3 +190,6 @@ TYPED_TEST(FramebufferRenderMipmapTest, RenderToMipmap)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(FramebufferRenderMipmapTest, ES2_D3D9(), ES2_D3D11(), ES3_D3D11(), ES2_OPENGL(), ES3_OPENGL());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
#include <vector> #include <vector>
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(IncompleteTextureTest, ES2_D3D9, ES2_D3D11);
template<typename T>
class IncompleteTextureTest : public ANGLETest class IncompleteTextureTest : public ANGLETest
{ {
protected: protected:
IncompleteTextureTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) IncompleteTextureTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -80,7 +84,7 @@ protected: ...@@ -80,7 +84,7 @@ protected:
GLint mTextureUniformLocation; GLint mTextureUniformLocation;
}; };
TYPED_TEST(IncompleteTextureTest, IncompleteTexture2D) TEST_P(IncompleteTextureTest, IncompleteTexture2D)
{ {
GLuint tex; GLuint tex;
glGenTextures(1, &tex); glGenTextures(1, &tex);
...@@ -114,7 +118,7 @@ TYPED_TEST(IncompleteTextureTest, IncompleteTexture2D) ...@@ -114,7 +118,7 @@ TYPED_TEST(IncompleteTextureTest, IncompleteTexture2D)
glDeleteTextures(1, &tex); glDeleteTextures(1, &tex);
} }
TYPED_TEST(IncompleteTextureTest, UpdateTexture) TEST_P(IncompleteTextureTest, UpdateTexture)
{ {
GLuint tex; GLuint tex;
glGenTextures(1, &tex); glGenTextures(1, &tex);
...@@ -157,3 +161,6 @@ TYPED_TEST(IncompleteTextureTest, UpdateTexture) ...@@ -157,3 +161,6 @@ TYPED_TEST(IncompleteTextureTest, UpdateTexture)
glDeleteTextures(1, &tex); glDeleteTextures(1, &tex);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(IncompleteTextureTest, ES2_D3D9(), ES2_D3D11());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
#include <array> #include <array>
template <typename T, typename IndexType, GLenum IndexTypeName> using namespace angle;
template <typename IndexType, GLenum IndexTypeName>
class IndexedPointsTest : public ANGLETest class IndexedPointsTest : public ANGLETest
{ {
protected: protected:
IndexedPointsTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) IndexedPointsTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -123,53 +132,53 @@ protected: ...@@ -123,53 +132,53 @@ protected:
static const GLuint mPointCount = 4; static const GLuint mPointCount = 4;
}; };
typedef IndexedPointsTest<ES2_D3D11, GLubyte, GL_UNSIGNED_BYTE> IndexedPointsTestUByte; typedef IndexedPointsTest<GLubyte, GL_UNSIGNED_BYTE> IndexedPointsTestUByte;
TEST_F(IndexedPointsTestUByte, UnsignedByteOffset0) TEST_P(IndexedPointsTestUByte, UnsignedByteOffset0)
{ {
runTest(0); runTest(0);
} }
TEST_F(IndexedPointsTestUByte, UnsignedByteOffset1) TEST_P(IndexedPointsTestUByte, UnsignedByteOffset1)
{ {
runTest(1); runTest(1);
} }
TEST_F(IndexedPointsTestUByte, UnsignedByteOffset2) TEST_P(IndexedPointsTestUByte, UnsignedByteOffset2)
{ {
runTest(2); runTest(2);
} }
TEST_F(IndexedPointsTestUByte, UnsignedByteOffset3) TEST_P(IndexedPointsTestUByte, UnsignedByteOffset3)
{ {
runTest(3); runTest(3);
} }
typedef IndexedPointsTest<ES2_D3D11, GLushort, GL_UNSIGNED_SHORT> IndexedPointsTestUShort; typedef IndexedPointsTest<GLushort, GL_UNSIGNED_SHORT> IndexedPointsTestUShort;
TEST_F(IndexedPointsTestUShort, UnsignedShortOffset0) TEST_P(IndexedPointsTestUShort, UnsignedShortOffset0)
{ {
runTest(0); runTest(0);
} }
TEST_F(IndexedPointsTestUShort, UnsignedShortOffset1) TEST_P(IndexedPointsTestUShort, UnsignedShortOffset1)
{ {
runTest(1); runTest(1);
} }
TEST_F(IndexedPointsTestUShort, UnsignedShortOffset2) TEST_P(IndexedPointsTestUShort, UnsignedShortOffset2)
{ {
runTest(2); runTest(2);
} }
TEST_F(IndexedPointsTestUShort, UnsignedShortOffset3) TEST_P(IndexedPointsTestUShort, UnsignedShortOffset3)
{ {
runTest(3); runTest(3);
} }
typedef IndexedPointsTest<ES2_D3D11, GLuint, GL_UNSIGNED_INT> IndexedPointsTestUInt; typedef IndexedPointsTest<GLuint, GL_UNSIGNED_INT> IndexedPointsTestUInt;
TEST_F(IndexedPointsTestUInt, UnsignedIntOffset0) TEST_P(IndexedPointsTestUInt, UnsignedIntOffset0)
{ {
if (getClientVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint")) if (getClientVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint"))
{ {
...@@ -179,7 +188,7 @@ TEST_F(IndexedPointsTestUInt, UnsignedIntOffset0) ...@@ -179,7 +188,7 @@ TEST_F(IndexedPointsTestUInt, UnsignedIntOffset0)
runTest(0); runTest(0);
} }
TEST_F(IndexedPointsTestUInt, UnsignedIntOffset1) TEST_P(IndexedPointsTestUInt, UnsignedIntOffset1)
{ {
if (getClientVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint")) if (getClientVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint"))
{ {
...@@ -189,7 +198,7 @@ TEST_F(IndexedPointsTestUInt, UnsignedIntOffset1) ...@@ -189,7 +198,7 @@ TEST_F(IndexedPointsTestUInt, UnsignedIntOffset1)
runTest(1); runTest(1);
} }
TEST_F(IndexedPointsTestUInt, UnsignedIntOffset2) TEST_P(IndexedPointsTestUInt, UnsignedIntOffset2)
{ {
if (getClientVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint")) if (getClientVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint"))
{ {
...@@ -199,7 +208,7 @@ TEST_F(IndexedPointsTestUInt, UnsignedIntOffset2) ...@@ -199,7 +208,7 @@ TEST_F(IndexedPointsTestUInt, UnsignedIntOffset2)
runTest(2); runTest(2);
} }
TEST_F(IndexedPointsTestUInt, UnsignedIntOffset3) TEST_P(IndexedPointsTestUInt, UnsignedIntOffset3)
{ {
if (getClientVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint")) if (getClientVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint"))
{ {
...@@ -208,3 +217,7 @@ TEST_F(IndexedPointsTestUInt, UnsignedIntOffset3) ...@@ -208,3 +217,7 @@ TEST_F(IndexedPointsTestUInt, UnsignedIntOffset3)
runTest(3); runTest(3);
} }
ANGLE_INSTANTIATE_TEST(IndexedPointsTestUByte, ES2_D3D11());
ANGLE_INSTANTIATE_TEST(IndexedPointsTestUShort, ES2_D3D11());
ANGLE_INSTANTIATE_TEST(IndexedPointsTestUInt, ES2_D3D11());
#include "ANGLETest.h" //
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. #include "ANGLETest.h"
// We test on D3D9 and D3D11 9_3 because they use special codepaths when attribute zero is instanced, unlike D3D11.
ANGLE_TYPED_TEST_CASE(InstancingTestAllConfigs, ES2_D3D9, ES2_D3D11, ES2_D3D11_FL9_3);
// TODO(jmadill): Figure out the situation with DrawInstanced on FL 9_3 using namespace angle;
ANGLE_TYPED_TEST_CASE(InstancingTestNo9_3, ES2_D3D9, ES2_D3D11);
template<typename T>
class InstancingTest : public ANGLETest class InstancingTest : public ANGLETest
{ {
protected: protected:
InstancingTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) InstancingTest()
{ {
setWindowWidth(256); setWindowWidth(256);
setWindowHeight(256); setWindowHeight(256);
...@@ -243,15 +243,13 @@ class InstancingTest : public ANGLETest ...@@ -243,15 +243,13 @@ class InstancingTest : public ANGLETest
const GLfloat quadRadius = 0.30f; const GLfloat quadRadius = 0.30f;
}; };
template<typename T> class InstancingTestAllConfigs : public InstancingTest
class InstancingTestAllConfigs : public InstancingTest<T>
{ {
protected: protected:
InstancingTestAllConfigs() {} InstancingTestAllConfigs() {}
}; };
template<typename T> class InstancingTestNo9_3 : public InstancingTest
class InstancingTestNo9_3 : public InstancingTest<T>
{ {
protected: protected:
InstancingTestNo9_3() {} InstancingTestNo9_3() {}
...@@ -260,7 +258,7 @@ class InstancingTestNo9_3 : public InstancingTest<T> ...@@ -260,7 +258,7 @@ class InstancingTestNo9_3 : public InstancingTest<T>
// This test uses a vertex shader with the first attribute (attribute zero) instanced. // This test uses a vertex shader with the first attribute (attribute zero) instanced.
// On D3D9 and D3D11 FL9_3, this triggers a special codepath that rearranges the input layout sent to D3D, // On D3D9 and D3D11 FL9_3, this triggers a special codepath that rearranges the input layout sent to D3D,
// to ensure that slot/stream zero of the input layout doesn't contain per-instance data. // to ensure that slot/stream zero of the input layout doesn't contain per-instance data.
TYPED_TEST(InstancingTestAllConfigs, AttributeZeroInstanced) TEST_P(InstancingTestAllConfigs, AttributeZeroInstanced)
{ {
const std::string vs = SHADER_SOURCE const std::string vs = SHADER_SOURCE
( (
...@@ -277,7 +275,7 @@ TYPED_TEST(InstancingTestAllConfigs, AttributeZeroInstanced) ...@@ -277,7 +275,7 @@ TYPED_TEST(InstancingTestAllConfigs, AttributeZeroInstanced)
// Same as AttributeZeroInstanced, but attribute zero is not instanced. // Same as AttributeZeroInstanced, but attribute zero is not instanced.
// This ensures the general instancing codepath (i.e. without rearranging the input layout) works as expected. // This ensures the general instancing codepath (i.e. without rearranging the input layout) works as expected.
TYPED_TEST(InstancingTestAllConfigs, AttributeZeroNotInstanced) TEST_P(InstancingTestAllConfigs, AttributeZeroNotInstanced)
{ {
const std::string vs = SHADER_SOURCE const std::string vs = SHADER_SOURCE
( (
...@@ -294,7 +292,7 @@ TYPED_TEST(InstancingTestAllConfigs, AttributeZeroNotInstanced) ...@@ -294,7 +292,7 @@ TYPED_TEST(InstancingTestAllConfigs, AttributeZeroNotInstanced)
// Tests that the "first" parameter to glDrawArraysInstancedANGLE is only an offset into // Tests that the "first" parameter to glDrawArraysInstancedANGLE is only an offset into
// the non-instanced vertex attributes. // the non-instanced vertex attributes.
TYPED_TEST(InstancingTestNo9_3, DrawArraysWithOffset) TEST_P(InstancingTestNo9_3, DrawArraysWithOffset)
{ {
const std::string vs = SHADER_SOURCE const std::string vs = SHADER_SOURCE
( (
...@@ -320,3 +318,10 @@ TYPED_TEST(InstancingTestNo9_3, DrawArraysWithOffset) ...@@ -320,3 +318,10 @@ TYPED_TEST(InstancingTestNo9_3, DrawArraysWithOffset)
glDeleteProgram(program); glDeleteProgram(program);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
// We test on D3D9 and D3D11 9_3 because they use special codepaths when attribute zero is instanced, unlike D3D11.
ANGLE_INSTANTIATE_TEST(InstancingTestAllConfigs, ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3());
// TODO(jmadill): Figure out the situation with DrawInstanced on FL 9_3
ANGLE_INSTANTIATE_TEST(InstancingTestNo9_3, ES2_D3D9(), ES2_D3D11());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(LineLoopTest, ES2_D3D9, ES2_D3D11);
template<typename T>
class LineLoopTest : public ANGLETest class LineLoopTest : public ANGLETest
{ {
protected: protected:
LineLoopTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) LineLoopTest()
{ {
setWindowWidth(256); setWindowWidth(256);
setWindowHeight(256); setWindowHeight(256);
...@@ -130,19 +134,19 @@ protected: ...@@ -130,19 +134,19 @@ protected:
GLint mColorLocation; GLint mColorLocation;
}; };
TYPED_TEST(LineLoopTest, LineLoopUByteIndices) TEST_P(LineLoopTest, LineLoopUByteIndices)
{ {
static const GLubyte indices[] = { 0, 7, 6, 9, 8, 0 }; static const GLubyte indices[] = { 0, 7, 6, 9, 8, 0 };
runTest(GL_UNSIGNED_BYTE, 0, indices + 1); runTest(GL_UNSIGNED_BYTE, 0, indices + 1);
} }
TYPED_TEST(LineLoopTest, LineLoopUShortIndices) TEST_P(LineLoopTest, LineLoopUShortIndices)
{ {
static const GLushort indices[] = { 0, 7, 6, 9, 8, 0 }; static const GLushort indices[] = { 0, 7, 6, 9, 8, 0 };
runTest(GL_UNSIGNED_SHORT, 0, indices + 1); runTest(GL_UNSIGNED_SHORT, 0, indices + 1);
} }
TYPED_TEST(LineLoopTest, LineLoopUIntIndices) TEST_P(LineLoopTest, LineLoopUIntIndices)
{ {
if (!extensionEnabled("GL_OES_element_index_uint")) if (!extensionEnabled("GL_OES_element_index_uint"))
{ {
...@@ -153,7 +157,7 @@ TYPED_TEST(LineLoopTest, LineLoopUIntIndices) ...@@ -153,7 +157,7 @@ TYPED_TEST(LineLoopTest, LineLoopUIntIndices)
runTest(GL_UNSIGNED_INT, 0, indices + 1); runTest(GL_UNSIGNED_INT, 0, indices + 1);
} }
TYPED_TEST(LineLoopTest, LineLoopUByteIndexBuffer) TEST_P(LineLoopTest, LineLoopUByteIndexBuffer)
{ {
static const GLubyte indices[] = { 0, 7, 6, 9, 8, 0 }; static const GLubyte indices[] = { 0, 7, 6, 9, 8, 0 };
...@@ -167,7 +171,7 @@ TYPED_TEST(LineLoopTest, LineLoopUByteIndexBuffer) ...@@ -167,7 +171,7 @@ TYPED_TEST(LineLoopTest, LineLoopUByteIndexBuffer)
glDeleteBuffers(1, &buf); glDeleteBuffers(1, &buf);
} }
TYPED_TEST(LineLoopTest, LineLoopUShortIndexBuffer) TEST_P(LineLoopTest, LineLoopUShortIndexBuffer)
{ {
static const GLushort indices[] = { 0, 7, 6, 9, 8, 0 }; static const GLushort indices[] = { 0, 7, 6, 9, 8, 0 };
...@@ -181,7 +185,7 @@ TYPED_TEST(LineLoopTest, LineLoopUShortIndexBuffer) ...@@ -181,7 +185,7 @@ TYPED_TEST(LineLoopTest, LineLoopUShortIndexBuffer)
glDeleteBuffers(1, &buf); glDeleteBuffers(1, &buf);
} }
TYPED_TEST(LineLoopTest, LineLoopUIntIndexBuffer) TEST_P(LineLoopTest, LineLoopUIntIndexBuffer)
{ {
if (!extensionEnabled("GL_OES_element_index_uint")) if (!extensionEnabled("GL_OES_element_index_uint"))
{ {
...@@ -199,3 +203,6 @@ TYPED_TEST(LineLoopTest, LineLoopUIntIndexBuffer) ...@@ -199,3 +203,6 @@ TYPED_TEST(LineLoopTest, LineLoopUIntIndexBuffer)
glDeleteBuffers(1, &buf); glDeleteBuffers(1, &buf);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(LineLoopTest, ES2_D3D9(), ES2_D3D11());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(MaxTextureSizeTest, ES2_D3D9, ES2_D3D11);
template<typename T>
class MaxTextureSizeTest : public ANGLETest class MaxTextureSizeTest : public ANGLETest
{ {
protected: protected:
MaxTextureSizeTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) MaxTextureSizeTest()
{ {
setWindowWidth(512); setWindowWidth(512);
setWindowHeight(512); setWindowHeight(512);
...@@ -90,7 +94,7 @@ protected: ...@@ -90,7 +94,7 @@ protected:
GLint mMaxRenderbufferSize; GLint mMaxRenderbufferSize;
}; };
TYPED_TEST(MaxTextureSizeTest, SpecificationTexImage) TEST_P(MaxTextureSizeTest, SpecificationTexImage)
{ {
GLuint tex; GLuint tex;
glGenTextures(1, &tex); glGenTextures(1, &tex);
...@@ -145,7 +149,7 @@ TYPED_TEST(MaxTextureSizeTest, SpecificationTexImage) ...@@ -145,7 +149,7 @@ TYPED_TEST(MaxTextureSizeTest, SpecificationTexImage)
} }
} }
TYPED_TEST(MaxTextureSizeTest, SpecificationTexStorage) TEST_P(MaxTextureSizeTest, SpecificationTexStorage)
{ {
if (getClientVersion() < 3 && (!extensionEnabled("GL_EXT_texture_storage") || !extensionEnabled("GL_OES_rgb8_rgba8"))) if (getClientVersion() < 3 && (!extensionEnabled("GL_EXT_texture_storage") || !extensionEnabled("GL_OES_rgb8_rgba8")))
{ {
...@@ -215,7 +219,7 @@ TYPED_TEST(MaxTextureSizeTest, SpecificationTexStorage) ...@@ -215,7 +219,7 @@ TYPED_TEST(MaxTextureSizeTest, SpecificationTexStorage)
} }
} }
TYPED_TEST(MaxTextureSizeTest, RenderToTexture) TEST_P(MaxTextureSizeTest, RenderToTexture)
{ {
GLuint fbo = 0; GLuint fbo = 0;
GLuint textureId = 0; GLuint textureId = 0;
...@@ -280,3 +284,6 @@ TYPED_TEST(MaxTextureSizeTest, RenderToTexture) ...@@ -280,3 +284,6 @@ TYPED_TEST(MaxTextureSizeTest, RenderToTexture)
glDeleteFramebuffers(1, &fbo); glDeleteFramebuffers(1, &fbo);
glDeleteTextures(1, &textureId); glDeleteTextures(1, &textureId);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(MaxTextureSizeTest, ES2_D3D9(), ES2_D3D11());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
// Note: we run these tests against 9_3 on WARP due to hardware driver issues on Win7
ANGLE_TYPED_TEST_CASE(MipmapTest, ES2_D3D9, ES2_D3D11, ES2_D3D11_FL9_3_WARP, ES2_OPENGL, ES3_OPENGL);
ANGLE_TYPED_TEST_CASE(MipmapTestES3, ES3_D3D11);
template<typename T>
class MipmapTest : public ANGLETest class MipmapTest : public ANGLETest
{ {
protected: protected:
MipmapTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) MipmapTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -214,11 +216,10 @@ class MipmapTest : public ANGLETest ...@@ -214,11 +216,10 @@ class MipmapTest : public ANGLETest
GLubyte* mLevelTwoInitData; GLubyte* mLevelTwoInitData;
}; };
template<typename T>
class MipmapTestES3 : public ANGLETest class MipmapTestES3 : public ANGLETest
{ {
protected: protected:
MipmapTestES3() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) MipmapTestES3()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -362,7 +363,7 @@ protected: ...@@ -362,7 +363,7 @@ protected:
// This test uses init data for the first three levels of the texture. It passes the level 0 data in, then renders, then level 1, then renders, etc. // This test uses init data for the first three levels of the texture. It passes the level 0 data in, then renders, then level 1, then renders, etc.
// This ensures that renderers using the zero LOD workaround (e.g. D3D11 FL9_3) correctly pass init data to the mipmapped texture, // This ensures that renderers using the zero LOD workaround (e.g. D3D11 FL9_3) correctly pass init data to the mipmapped texture,
// even if the the zero-LOD texture is currently in use. // even if the the zero-LOD texture is currently in use.
TYPED_TEST(MipmapTest, DISABLED_ThreeLevelsInitData) TEST_P(MipmapTest, DISABLED_ThreeLevelsInitData)
{ {
// Pass in level zero init data. // Pass in level zero init data.
glBindTexture(GL_TEXTURE_2D, mOffscreenTexture2D); glBindTexture(GL_TEXTURE_2D, mOffscreenTexture2D);
...@@ -468,7 +469,7 @@ TYPED_TEST(MipmapTest, DISABLED_ThreeLevelsInitData) ...@@ -468,7 +469,7 @@ TYPED_TEST(MipmapTest, DISABLED_ThreeLevelsInitData)
// To do this, D3D11 has to convert the TextureStorage into a renderable one. // To do this, D3D11 has to convert the TextureStorage into a renderable one.
// This test ensures that the conversion works correctly. // This test ensures that the conversion works correctly.
// In particular, on D3D11 Feature Level 9_3 it ensures that both the zero LOD workaround texture AND the 'normal' texture are copied during conversion. // In particular, on D3D11 Feature Level 9_3 it ensures that both the zero LOD workaround texture AND the 'normal' texture are copied during conversion.
TYPED_TEST(MipmapTest, GenerateMipmapFromInitDataThenRender) TEST_P(MipmapTest, GenerateMipmapFromInitDataThenRender)
{ {
// Pass in initial data so the texture is blue. // Pass in initial data so the texture is blue.
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, getWindowWidth(), getWindowHeight(), 0, GL_RGB, GL_UNSIGNED_BYTE, mLevelZeroBlueInitData); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, getWindowWidth(), getWindowHeight(), 0, GL_RGB, GL_UNSIGNED_BYTE, mLevelZeroBlueInitData);
...@@ -523,7 +524,7 @@ TYPED_TEST(MipmapTest, GenerateMipmapFromInitDataThenRender) ...@@ -523,7 +524,7 @@ TYPED_TEST(MipmapTest, GenerateMipmapFromInitDataThenRender)
// This test ensures that mips are correctly generated from a rendered image. // This test ensures that mips are correctly generated from a rendered image.
// In particular, on D3D11 Feature Level 9_3, the clear call will be performed on the zero-level texture, rather than the mipped one. // In particular, on D3D11 Feature Level 9_3, the clear call will be performed on the zero-level texture, rather than the mipped one.
// The test ensures that the zero-level texture is correctly copied into the mipped texture before the mipmaps are generated. // The test ensures that the zero-level texture is correctly copied into the mipped texture before the mipmaps are generated.
TYPED_TEST(MipmapTest, GenerateMipmapFromRenderedImage) TEST_P(MipmapTest, GenerateMipmapFromRenderedImage)
{ {
// Bind the offscreen framebuffer/texture. // Bind the offscreen framebuffer/texture.
glBindFramebuffer(GL_FRAMEBUFFER, mOffscreenFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER, mOffscreenFramebuffer);
...@@ -554,7 +555,7 @@ TYPED_TEST(MipmapTest, GenerateMipmapFromRenderedImage) ...@@ -554,7 +555,7 @@ TYPED_TEST(MipmapTest, GenerateMipmapFromRenderedImage)
// Test to ensure that rendering to a mipmapped texture works, regardless of whether mipmaps are enabled or not. // Test to ensure that rendering to a mipmapped texture works, regardless of whether mipmaps are enabled or not.
// TODO: This test hits a texture rebind bug in the D3D11 renderer. Fix this. // TODO: This test hits a texture rebind bug in the D3D11 renderer. Fix this.
TYPED_TEST(MipmapTest, RenderOntoLevelZeroAfterGenerateMipmap) TEST_P(MipmapTest, RenderOntoLevelZeroAfterGenerateMipmap)
{ {
// TODO(geofflang): Figure out why this is broken on AMD OpenGL // TODO(geofflang): Figure out why this is broken on AMD OpenGL
if (isAMD() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE) if (isAMD() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
...@@ -630,7 +631,7 @@ TYPED_TEST(MipmapTest, RenderOntoLevelZeroAfterGenerateMipmap) ...@@ -630,7 +631,7 @@ TYPED_TEST(MipmapTest, RenderOntoLevelZeroAfterGenerateMipmap)
// This test ensures that the level-zero workaround for TextureCubes (on D3D11 Feature Level 9_3) // This test ensures that the level-zero workaround for TextureCubes (on D3D11 Feature Level 9_3)
// works as expected. It tests enabling/disabling mipmaps, generating mipmaps, and rendering to level zero. // works as expected. It tests enabling/disabling mipmaps, generating mipmaps, and rendering to level zero.
TYPED_TEST(MipmapTest, TextureCubeGeneralLevelZero) TEST_P(MipmapTest, TextureCubeGeneralLevelZero)
{ {
GLfloat vertexLocations[] = GLfloat vertexLocations[] =
{ {
...@@ -704,7 +705,7 @@ TYPED_TEST(MipmapTest, TextureCubeGeneralLevelZero) ...@@ -704,7 +705,7 @@ TYPED_TEST(MipmapTest, TextureCubeGeneralLevelZero)
} }
// This test ensures that rendering to level-zero of a TextureCube works as expected. // This test ensures that rendering to level-zero of a TextureCube works as expected.
TYPED_TEST(MipmapTest, TextureCubeRenderToLevelZero) TEST_P(MipmapTest, TextureCubeRenderToLevelZero)
{ {
GLfloat vertexLocations[] = GLfloat vertexLocations[] =
{ {
...@@ -756,7 +757,7 @@ TYPED_TEST(MipmapTest, TextureCubeRenderToLevelZero) ...@@ -756,7 +757,7 @@ TYPED_TEST(MipmapTest, TextureCubeRenderToLevelZero)
// Creates a mipmapped 2D array texture with three layers, and calls ANGLE's GenerateMipmap. // Creates a mipmapped 2D array texture with three layers, and calls ANGLE's GenerateMipmap.
// Then tests if the mipmaps are rendered correctly for all three layers. // Then tests if the mipmaps are rendered correctly for all three layers.
TYPED_TEST(MipmapTestES3, MipmapsForTextureArray) TEST_P(MipmapTestES3, MipmapsForTextureArray)
{ {
int px = getWindowWidth() / 2; int px = getWindowWidth() / 2;
int py = getWindowHeight() / 2; int py = getWindowHeight() / 2;
...@@ -838,7 +839,7 @@ TYPED_TEST(MipmapTestES3, MipmapsForTextureArray) ...@@ -838,7 +839,7 @@ TYPED_TEST(MipmapTestES3, MipmapsForTextureArray)
// Creates a mipmapped 3D texture with two layers, and calls ANGLE's GenerateMipmap. // Creates a mipmapped 3D texture with two layers, and calls ANGLE's GenerateMipmap.
// Then tests if the mipmaps are rendered correctly for all two layers. // Then tests if the mipmaps are rendered correctly for all two layers.
TYPED_TEST(MipmapTestES3, MipmapsForTexture3D) TEST_P(MipmapTestES3, MipmapsForTexture3D)
{ {
int px = getWindowWidth() / 2; int px = getWindowWidth() / 2;
int py = getWindowHeight() / 2; int py = getWindowHeight() / 2;
...@@ -916,3 +917,8 @@ TYPED_TEST(MipmapTestES3, MipmapsForTexture3D) ...@@ -916,3 +917,8 @@ TYPED_TEST(MipmapTestES3, MipmapsForTexture3D)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
EXPECT_PIXEL_EQ(px, py, 127, 127, 0, 255); EXPECT_PIXEL_EQ(px, py, 127, 127, 0, 255);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
// Note: we run these tests against 9_3 on WARP due to hardware driver issues on Win7
ANGLE_INSTANTIATE_TEST(MipmapTest, ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3_WARP(), ES2_OPENGL(), ES3_OPENGL());
ANGLE_INSTANTIATE_TEST(MipmapTestES3, ES3_D3D11());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Needed for Sleep() // Needed for Sleep()
#include <Windows.h> #include <Windows.h>
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(OcclusionQueriesTest, ES2_D3D9, ES2_D3D11);
template<typename T>
class OcclusionQueriesTest : public ANGLETest class OcclusionQueriesTest : public ANGLETest
{ {
protected: protected:
OcclusionQueriesTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) OcclusionQueriesTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -62,7 +66,7 @@ protected: ...@@ -62,7 +66,7 @@ protected:
GLuint mProgram; GLuint mProgram;
}; };
TYPED_TEST(OcclusionQueriesTest, IsOccluded) TEST_P(OcclusionQueriesTest, IsOccluded)
{ {
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
...@@ -102,7 +106,7 @@ TYPED_TEST(OcclusionQueriesTest, IsOccluded) ...@@ -102,7 +106,7 @@ TYPED_TEST(OcclusionQueriesTest, IsOccluded)
EXPECT_EQ(result, GL_FALSE); EXPECT_EQ(result, GL_FALSE);
} }
TYPED_TEST(OcclusionQueriesTest, IsNotOccluded) TEST_P(OcclusionQueriesTest, IsNotOccluded)
{ {
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
...@@ -129,7 +133,7 @@ TYPED_TEST(OcclusionQueriesTest, IsNotOccluded) ...@@ -129,7 +133,7 @@ TYPED_TEST(OcclusionQueriesTest, IsNotOccluded)
EXPECT_EQ(result, GL_TRUE); EXPECT_EQ(result, GL_TRUE);
} }
TYPED_TEST(OcclusionQueriesTest, Errors) TEST_P(OcclusionQueriesTest, Errors)
{ {
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
...@@ -183,3 +187,6 @@ TYPED_TEST(OcclusionQueriesTest, Errors) ...@@ -183,3 +187,6 @@ TYPED_TEST(OcclusionQueriesTest, Errors)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(OcclusionQueriesTest, ES2_D3D9(), ES2_D3D11());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(PBOExtensionTest, ES2_D3D11, ES3_D3D11);
template<typename T>
class PBOExtensionTest : public ANGLETest class PBOExtensionTest : public ANGLETest
{ {
protected: protected:
PBOExtensionTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) PBOExtensionTest()
{ {
setWindowWidth(32); setWindowWidth(32);
setWindowHeight(32); setWindowHeight(32);
...@@ -76,7 +80,7 @@ protected: ...@@ -76,7 +80,7 @@ protected:
GLuint mPositionVBO; GLuint mPositionVBO;
}; };
TYPED_TEST(PBOExtensionTest, PBOWithOtherTarget) TEST_P(PBOExtensionTest, PBOWithOtherTarget)
{ {
if (extensionEnabled("NV_pixel_buffer_object")) if (extensionEnabled("NV_pixel_buffer_object"))
{ {
...@@ -104,7 +108,7 @@ TYPED_TEST(PBOExtensionTest, PBOWithOtherTarget) ...@@ -104,7 +108,7 @@ TYPED_TEST(PBOExtensionTest, PBOWithOtherTarget)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(PBOExtensionTest, PBOWithExistingData) TEST_P(PBOExtensionTest, PBOWithExistingData)
{ {
if (extensionEnabled("NV_pixel_buffer_object")) if (extensionEnabled("NV_pixel_buffer_object"))
{ {
...@@ -144,3 +148,6 @@ TYPED_TEST(PBOExtensionTest, PBOWithExistingData) ...@@ -144,3 +148,6 @@ TYPED_TEST(PBOExtensionTest, PBOWithExistingData)
} }
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(PBOExtensionTest, ES2_D3D11(), ES3_D3D11());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(PbufferTest, ES2_D3D9, ES2_D3D11, ES2_OPENGL, ES2_D3D11_WARP, ES2_D3D11_REFERENCE);
template<typename T>
class PbufferTest : public ANGLETest class PbufferTest : public ANGLETest
{ {
protected: protected:
PbufferTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) PbufferTest()
{ {
setWindowWidth(512); setWindowWidth(512);
setWindowHeight(512); setWindowHeight(512);
...@@ -109,7 +113,7 @@ class PbufferTest : public ANGLETest ...@@ -109,7 +113,7 @@ class PbufferTest : public ANGLETest
}; };
// Test clearing a Pbuffer and checking the color is correct // Test clearing a Pbuffer and checking the color is correct
TYPED_TEST(PbufferTest, Clearing) TEST_P(PbufferTest, Clearing)
{ {
if (!mSupportsPbuffers) if (!mSupportsPbuffers)
{ {
...@@ -145,7 +149,7 @@ TYPED_TEST(PbufferTest, Clearing) ...@@ -145,7 +149,7 @@ TYPED_TEST(PbufferTest, Clearing)
} }
// Bind the Pbuffer to a texture and verify it renders correctly // Bind the Pbuffer to a texture and verify it renders correctly
TYPED_TEST(PbufferTest, BindTexImage) TEST_P(PbufferTest, BindTexImage)
{ {
if (!mSupportsPbuffers) if (!mSupportsPbuffers)
{ {
...@@ -208,7 +212,7 @@ TYPED_TEST(PbufferTest, BindTexImage) ...@@ -208,7 +212,7 @@ TYPED_TEST(PbufferTest, BindTexImage)
// Verify that when eglBind/ReleaseTexImage are called, the texture images are freed and their // Verify that when eglBind/ReleaseTexImage are called, the texture images are freed and their
// size information is correctly updated. // size information is correctly updated.
TYPED_TEST(PbufferTest, TextureSizeReset) TEST_P(PbufferTest, TextureSizeReset)
{ {
if (!mSupportsPbuffers) if (!mSupportsPbuffers)
{ {
...@@ -261,3 +265,6 @@ TYPED_TEST(PbufferTest, TextureSizeReset) ...@@ -261,3 +265,6 @@ TYPED_TEST(PbufferTest, TextureSizeReset)
drawQuad(mTextureProgram, "position", 0.5f); drawQuad(mTextureProgram, "position", 0.5f);
EXPECT_PIXEL_EQ(0, 0, 0, 0, 0, 255); EXPECT_PIXEL_EQ(0, 0, 0, 0, 0, 255);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(PbufferTest, ES2_D3D9(), ES2_D3D11(), ES2_OPENGL(), ES2_D3D11_WARP(), ES2_D3D11_REFERENCE());
#include "ANGLETest.h" //
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use this to select which configurations (e.g. which renderer, which GLES // Use of this source code is governed by a BSD-style license that can be
// major version) these tests should be run against. // found in the LICENSE file.
// //
// Some of the pointsprite tests below were ported from Khronos WebGL // Some of the pointsprite tests below were ported from Khronos WebGL
// conformance test suite. // conformance test suite.
// #include "ANGLETest.h"
// We test on D3D11 9_3 because the existing D3D11 PointSprite implementation
// uses Geometry Shaders which are not supported for 9_3. using namespace angle;
// D3D9 and D3D11 are also tested to ensure no regressions.
ANGLE_TYPED_TEST_CASE(PointSpritesTest, ES2_D3D9, ES2_D3D11, ES2_D3D11_FL9_3);
template<typename T>
class PointSpritesTest : public ANGLETest class PointSpritesTest : public ANGLETest
{ {
protected: protected:
const int windowWidth = 256; const int windowWidth = 256;
const int windowHeight = 256; const int windowHeight = 256;
PointSpritesTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) PointSpritesTest()
{ {
setWindowWidth(windowWidth); setWindowWidth(windowWidth);
setWindowHeight(windowHeight); setWindowHeight(windowHeight);
...@@ -41,7 +38,7 @@ class PointSpritesTest : public ANGLETest ...@@ -41,7 +38,7 @@ class PointSpritesTest : public ANGLETest
// Checks gl_PointCoord and gl_PointSize // Checks gl_PointCoord and gl_PointSize
// https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/variables/gl-pointcoord.html // https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/variables/gl-pointcoord.html
TYPED_TEST(PointSpritesTest, PointCoordAndPointSizeCompliance) TEST_P(PointSpritesTest, PointCoordAndPointSizeCompliance)
{ {
const std::string fs = SHADER_SOURCE const std::string fs = SHADER_SOURCE
( (
...@@ -146,7 +143,7 @@ TYPED_TEST(PointSpritesTest, PointCoordAndPointSizeCompliance) ...@@ -146,7 +143,7 @@ TYPED_TEST(PointSpritesTest, PointCoordAndPointSizeCompliance)
// Verify that drawing a point without enabling any attributes succeeds // Verify that drawing a point without enabling any attributes succeeds
// https://www.khronos.org/registry/webgl/sdk/tests/conformance/rendering/point-no-attributes.html // https://www.khronos.org/registry/webgl/sdk/tests/conformance/rendering/point-no-attributes.html
TYPED_TEST(PointSpritesTest, PointWithoutAttributesCompliance) TEST_P(PointSpritesTest, PointWithoutAttributesCompliance)
{ {
const std::string fs = SHADER_SOURCE const std::string fs = SHADER_SOURCE
( (
...@@ -181,7 +178,7 @@ TYPED_TEST(PointSpritesTest, PointWithoutAttributesCompliance) ...@@ -181,7 +178,7 @@ TYPED_TEST(PointSpritesTest, PointWithoutAttributesCompliance)
// This is a regression test for a graphics driver bug affecting end caps on roads in MapsGL // This is a regression test for a graphics driver bug affecting end caps on roads in MapsGL
// https://www.khronos.org/registry/webgl/sdk/tests/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html // https://www.khronos.org/registry/webgl/sdk/tests/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html
TYPED_TEST(PointSpritesTest, PointCoordRegressionTest) TEST_P(PointSpritesTest, PointCoordRegressionTest)
{ {
const std::string fs = SHADER_SOURCE const std::string fs = SHADER_SOURCE
( (
...@@ -266,7 +263,7 @@ TYPED_TEST(PointSpritesTest, PointCoordRegressionTest) ...@@ -266,7 +263,7 @@ TYPED_TEST(PointSpritesTest, PointCoordRegressionTest)
// Verify GL_VERTEX_PROGRAM_POINT_SIZE is enabled // Verify GL_VERTEX_PROGRAM_POINT_SIZE is enabled
// https://www.khronos.org/registry/webgl/sdk/tests/conformance/rendering/point-size.html // https://www.khronos.org/registry/webgl/sdk/tests/conformance/rendering/point-size.html
TYPED_TEST(PointSpritesTest, PointSizeEnabledCompliance) TEST_P(PointSpritesTest, PointSizeEnabledCompliance)
{ {
const std::string fs = SHADER_SOURCE const std::string fs = SHADER_SOURCE
( (
...@@ -390,7 +387,7 @@ TYPED_TEST(PointSpritesTest, PointSizeEnabledCompliance) ...@@ -390,7 +387,7 @@ TYPED_TEST(PointSpritesTest, PointSizeEnabledCompliance)
} }
// Verify that rendering works correctly when gl_PointSize is declared in a shader but isn't used // Verify that rendering works correctly when gl_PointSize is declared in a shader but isn't used
TYPED_TEST(PointSpritesTest, PointSizeDeclaredButUnused) TEST_P(PointSpritesTest, PointSizeDeclaredButUnused)
{ {
const std::string vs = SHADER_SOURCE const std::string vs = SHADER_SOURCE
( (
...@@ -424,3 +421,11 @@ TYPED_TEST(PointSpritesTest, PointSizeDeclaredButUnused) ...@@ -424,3 +421,11 @@ TYPED_TEST(PointSpritesTest, PointSizeDeclaredButUnused)
glDeleteProgram(program); glDeleteProgram(program);
} }
// Use this to select which configurations (e.g. which renderer, which GLES
// major version) these tests should be run against.
//
// We test on D3D11 9_3 because the existing D3D11 PointSprite implementation
// uses Geometry Shaders which are not supported for 9_3.
// D3D9 and D3D11 are also tested to ensure no regressions.
ANGLE_INSTANTIATE_TEST(PointSpritesTest, ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
#include <memory> #include <memory>
#include <stdint.h> #include <stdint.h>
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(ProgramBinaryTest, ES2_D3D9, ES2_D3D11);
template<typename T>
class ProgramBinaryTest : public ANGLETest class ProgramBinaryTest : public ANGLETest
{ {
protected: protected:
ProgramBinaryTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) ProgramBinaryTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -68,7 +73,7 @@ class ProgramBinaryTest : public ANGLETest ...@@ -68,7 +73,7 @@ class ProgramBinaryTest : public ANGLETest
// This tests the assumption that float attribs of different size // This tests the assumption that float attribs of different size
// should not internally cause a vertex shader recompile (for conversion). // should not internally cause a vertex shader recompile (for conversion).
TYPED_TEST(ProgramBinaryTest, FloatDynamicShaderSize) TEST_P(ProgramBinaryTest, FloatDynamicShaderSize)
{ {
glUseProgram(mProgram); glUseProgram(mProgram);
glBindBuffer(GL_ARRAY_BUFFER, mBuffer); glBindBuffer(GL_ARRAY_BUFFER, mBuffer);
...@@ -96,7 +101,7 @@ TYPED_TEST(ProgramBinaryTest, FloatDynamicShaderSize) ...@@ -96,7 +101,7 @@ TYPED_TEST(ProgramBinaryTest, FloatDynamicShaderSize)
} }
// This tests the ability to successfully save and load a program binary. // This tests the ability to successfully save and load a program binary.
TYPED_TEST(ProgramBinaryTest, SaveAndLoadBinary) TEST_P(ProgramBinaryTest, SaveAndLoadBinary)
{ {
GLint programLength = 0; GLint programLength = 0;
GLint writtenLength = 0; GLint writtenLength = 0;
...@@ -152,3 +157,6 @@ TYPED_TEST(ProgramBinaryTest, SaveAndLoadBinary) ...@@ -152,3 +157,6 @@ TYPED_TEST(ProgramBinaryTest, SaveAndLoadBinary)
glDeleteProgram(program2); glDeleteProgram(program2);
} }
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(ProgramBinaryTest, ES2_D3D9(), ES2_D3D11());
...@@ -15,14 +15,12 @@ ...@@ -15,14 +15,12 @@
#include "ANGLETest.h" #include "ANGLETest.h"
#include "com_utils.h" #include "com_utils.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(QueryDisplayAttributeTest, ES2_D3D9, ES2_D3D11);
template<typename T>
class QueryDisplayAttributeTest : public ANGLETest class QueryDisplayAttributeTest : public ANGLETest
{ {
protected: protected:
QueryDisplayAttributeTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) QueryDisplayAttributeTest()
{ {
mQueryDisplayAttribEXT = nullptr; mQueryDisplayAttribEXT = nullptr;
mQueryDeviceAttribEXT = nullptr; mQueryDeviceAttribEXT = nullptr;
...@@ -78,7 +76,7 @@ class QueryDisplayAttributeTest : public ANGLETest ...@@ -78,7 +76,7 @@ class QueryDisplayAttributeTest : public ANGLETest
// This test attempts to obtain a D3D11 device and a D3D9 device using the eglQueryDeviceAttribEXT function. // This test attempts to obtain a D3D11 device and a D3D9 device using the eglQueryDeviceAttribEXT function.
// If the test is configured to use D3D11 then it should succeed to obtain a D3D11 device. // If the test is configured to use D3D11 then it should succeed to obtain a D3D11 device.
// If the test is confitured to use D3D9, then it should succeed to obtain a D3D9 device. // If the test is confitured to use D3D9, then it should succeed to obtain a D3D9 device.
TYPED_TEST(QueryDisplayAttributeTest, QueryDevice) TEST_P(QueryDisplayAttributeTest, QueryDevice)
{ {
EGLAttrib device = 0; EGLAttrib device = 0;
EGLAttrib angleDevice = 0; EGLAttrib angleDevice = 0;
...@@ -108,7 +106,7 @@ TYPED_TEST(QueryDisplayAttributeTest, QueryDevice) ...@@ -108,7 +106,7 @@ TYPED_TEST(QueryDisplayAttributeTest, QueryDevice)
// a D3D11 configured system using the eglQueryDeviceAttribEXT function. // a D3D11 configured system using the eglQueryDeviceAttribEXT function.
// If the test is configured to use D3D11 then it should fail to obtain a D3D11 device. // If the test is configured to use D3D11 then it should fail to obtain a D3D11 device.
// If the test is confitured to use D3D9, then it should fail to obtain a D3D9 device. // If the test is confitured to use D3D9, then it should fail to obtain a D3D9 device.
TYPED_TEST(QueryDisplayAttributeTest, QueryDeviceBadAttrbiute) TEST_P(QueryDisplayAttributeTest, QueryDeviceBadAttrbiute)
{ {
EGLAttrib device = 0; EGLAttrib device = 0;
EGLAttrib angleDevice = 0; EGLAttrib angleDevice = 0;
...@@ -124,3 +122,6 @@ TYPED_TEST(QueryDisplayAttributeTest, QueryDeviceBadAttrbiute) ...@@ -124,3 +122,6 @@ TYPED_TEST(QueryDisplayAttributeTest, QueryDeviceBadAttrbiute)
EXPECT_EQ(EGL_FALSE, mQueryDeviceAttribEXT(reinterpret_cast<EGLDeviceEXT>(angleDevice), EGL_D3D11_DEVICE_ANGLE, &device)); EXPECT_EQ(EGL_FALSE, mQueryDeviceAttribEXT(reinterpret_cast<EGLDeviceEXT>(angleDevice), EGL_D3D11_DEVICE_ANGLE, &device));
} }
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(QueryDisplayAttributeTest, ES2_D3D9(), ES2_D3D11());
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(ReadPixelsTest, ES3_D3D11);
template<typename T>
class ReadPixelsTest : public ANGLETest class ReadPixelsTest : public ANGLETest
{ {
protected: protected:
ReadPixelsTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) ReadPixelsTest()
{ {
setWindowWidth(32); setWindowWidth(32);
setWindowHeight(32); setWindowHeight(32);
...@@ -87,7 +91,7 @@ protected: ...@@ -87,7 +91,7 @@ protected:
GLuint mPositionVBO; GLuint mPositionVBO;
}; };
TYPED_TEST(ReadPixelsTest, OutOfBounds) TEST_P(ReadPixelsTest, OutOfBounds)
{ {
glClearColor(1.0f, 0.0f, 0.0f, 1.0f); glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
...@@ -120,7 +124,7 @@ TYPED_TEST(ReadPixelsTest, OutOfBounds) ...@@ -120,7 +124,7 @@ TYPED_TEST(ReadPixelsTest, OutOfBounds)
} }
} }
TYPED_TEST(ReadPixelsTest, PBOWithOtherTarget) TEST_P(ReadPixelsTest, PBOWithOtherTarget)
{ {
glClearColor(1.0f, 0.0f, 0.0f, 1.0f); glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
...@@ -145,7 +149,7 @@ TYPED_TEST(ReadPixelsTest, PBOWithOtherTarget) ...@@ -145,7 +149,7 @@ TYPED_TEST(ReadPixelsTest, PBOWithOtherTarget)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(ReadPixelsTest, PBOWithExistingData) TEST_P(ReadPixelsTest, PBOWithExistingData)
{ {
// Clear backbuffer to red // Clear backbuffer to red
glClearColor(1.0f, 0.0f, 0.0f, 1.0f); glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
...@@ -183,7 +187,7 @@ TYPED_TEST(ReadPixelsTest, PBOWithExistingData) ...@@ -183,7 +187,7 @@ TYPED_TEST(ReadPixelsTest, PBOWithExistingData)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(ReadPixelsTest, PBOAndSubData) TEST_P(ReadPixelsTest, PBOAndSubData)
{ {
glClearColor(1.0f, 0.0f, 0.0f, 1.0f); glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
...@@ -211,7 +215,7 @@ TYPED_TEST(ReadPixelsTest, PBOAndSubData) ...@@ -211,7 +215,7 @@ TYPED_TEST(ReadPixelsTest, PBOAndSubData)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(ReadPixelsTest, PBOAndSubDataOffset) TEST_P(ReadPixelsTest, PBOAndSubDataOffset)
{ {
glClearColor(1.0f, 0.0f, 0.0f, 1.0f); glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
...@@ -244,7 +248,7 @@ TYPED_TEST(ReadPixelsTest, PBOAndSubDataOffset) ...@@ -244,7 +248,7 @@ TYPED_TEST(ReadPixelsTest, PBOAndSubDataOffset)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(ReadPixelsTest, DrawWithPBO) TEST_P(ReadPixelsTest, DrawWithPBO)
{ {
unsigned char data[4] = { 1, 2, 3, 4 }; unsigned char data[4] = { 1, 2, 3, 4 };
...@@ -297,7 +301,7 @@ TYPED_TEST(ReadPixelsTest, DrawWithPBO) ...@@ -297,7 +301,7 @@ TYPED_TEST(ReadPixelsTest, DrawWithPBO)
EXPECT_EQ(4, data[3]); EXPECT_EQ(4, data[3]);
} }
TYPED_TEST(ReadPixelsTest, MultisampledPBO) TEST_P(ReadPixelsTest, MultisampledPBO)
{ {
if (getClientVersion() < 3 && !extensionEnabled("GL_ANGLE_framebuffer_multisample")) if (getClientVersion() < 3 && !extensionEnabled("GL_ANGLE_framebuffer_multisample"))
{ {
...@@ -340,3 +344,6 @@ TYPED_TEST(ReadPixelsTest, MultisampledPBO) ...@@ -340,3 +344,6 @@ TYPED_TEST(ReadPixelsTest, MultisampledPBO)
glDeleteRenderbuffers(1, &rbo); glDeleteRenderbuffers(1, &rbo);
glDeleteFramebuffers(1, &fbo); glDeleteFramebuffers(1, &fbo);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(ReadPixelsTest, ES3_D3D11());
#include "ANGLETest.h" //
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// RendererTest:
// These tests are designed to ensure that the various configurations of the test fixtures work as expected.
// If one of these tests fails, then it is likely that some of the other tests are being configured incorrectly.
// For example, they might be using the D3D11 renderer when the test is meant to be using the D3D9 renderer.
// These tests are designed to ensure that the various configurations of the test fixtures work as expected. #include "ANGLETest.h"
// If one of these tests fails, then it is likely that some of the other tests are being configured incorrectly.
// For example, they might be using the D3D11 renderer when the test is meant to be using the D3D9 renderer.
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(RendererTest, ES2_D3D9, ES2_D3D11, ES2_D3D11_WARP, ES2_D3D11_REFERENCE, ES3_D3D11, ES3_D3D11_WARP, ES3_D3D11_REFERENCE, ES2_OPENGL, namespace
ES2_D3D9_REFERENCE, ES2_D3D11_FL11_0, ES2_D3D11_FL11_0_WARP, ES2_D3D11_FL11_0_REFERENCE, ES3_D3D11_FL11_0, ES3_D3D11_FL11_0_WARP, ES3_D3D11_FL11_0_REFERENCE, ES3_OPENGL, {
ES2_D3D11_FL10_1, ES2_D3D11_FL10_1_WARP, ES2_D3D11_FL10_1_REFERENCE, ES3_D3D11_FL10_1, ES3_D3D11_FL10_1_WARP, ES3_D3D11_FL10_1_REFERENCE,
ES2_D3D11_FL10_0, ES2_D3D11_FL10_0_WARP, ES2_D3D11_FL10_0_REFERENCE, ES3_D3D11_FL10_0, ES3_D3D11_FL10_0_WARP, ES3_D3D11_FL10_0_REFERENCE,
ES2_D3D11_FL9_3, ES2_D3D11_FL9_3_WARP, ES2_D3D11_FL9_3_REFERENCE);
template<typename T>
class RendererTest : public ANGLETest class RendererTest : public ANGLETest
{ {
protected: protected:
RendererTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) RendererTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
} }
T fixtureType;
}; };
TYPED_TEST(RendererTest, RequestedRendererCreated) TEST_P(RendererTest, RequestedRendererCreated)
{ {
std::string rendererString = std::string(reinterpret_cast<const char*>(glGetString(GL_RENDERER))); std::string rendererString = std::string(reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
std::transform(rendererString.begin(), rendererString.end(), rendererString.begin(), ::tolower); std::transform(rendererString.begin(), rendererString.end(), rendererString.begin(), ::tolower);
...@@ -33,7 +33,7 @@ TYPED_TEST(RendererTest, RequestedRendererCreated) ...@@ -33,7 +33,7 @@ TYPED_TEST(RendererTest, RequestedRendererCreated)
std::string versionString = std::string(reinterpret_cast<const char*>(glGetString(GL_VERSION))); std::string versionString = std::string(reinterpret_cast<const char*>(glGetString(GL_VERSION)));
std::transform(versionString.begin(), versionString.end(), versionString.begin(), ::tolower); std::transform(versionString.begin(), versionString.end(), versionString.begin(), ::tolower);
EGLPlatformParameters platform = fixtureType.GetPlatform(); const EGLPlatformParameters &platform = GetParam().mEGLPlatformParameters;
// Ensure that the renderer string contains D3D11, if we requested a D3D11 renderer. // Ensure that the renderer string contains D3D11, if we requested a D3D11 renderer.
if (platform.renderer == EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE) if (platform.renderer == EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
...@@ -101,7 +101,7 @@ TYPED_TEST(RendererTest, RequestedRendererCreated) ...@@ -101,7 +101,7 @@ TYPED_TEST(RendererTest, RequestedRendererCreated)
ASSERT_TRUE(found); ASSERT_TRUE(found);
} }
EGLint glesMajorVersion = fixtureType.GetGlesMajorVersion(); EGLint glesMajorVersion = GetParam().mClientVersion;
// Ensure that the renderer string contains GL ES 3.0, if we requested a GL ES 3.0 // Ensure that the renderer string contains GL ES 3.0, if we requested a GL ES 3.0
if (glesMajorVersion == 3) if (glesMajorVersion == 3)
...@@ -117,9 +117,23 @@ TYPED_TEST(RendererTest, RequestedRendererCreated) ...@@ -117,9 +117,23 @@ TYPED_TEST(RendererTest, RequestedRendererCreated)
} }
// Perform a simple operation (clear and read pixels) to verify the device is working // Perform a simple operation (clear and read pixels) to verify the device is working
TYPED_TEST(RendererTest, SimpleOperation) TEST_P(RendererTest, SimpleOperation)
{ {
glClearColor(0.0f, 1.0f, 0.0f, 1.0f); glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
EXPECT_PIXEL_EQ(0, 0, 0, 255, 0, 255); EXPECT_PIXEL_EQ(0, 0, 0, 255, 0, 255);
} }
// Select configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(RendererTest,
ES2_D3D9(), ES2_D3D9_REFERENCE(),
ES2_D3D11(), ES2_D3D11_FL11_0(), ES2_D3D11_FL10_1(), ES2_D3D11_FL10_0(), ES2_D3D11_FL9_3(),
ES2_D3D11_WARP(), ES2_D3D11_FL11_0_WARP(), ES2_D3D11_FL10_1_WARP(), ES2_D3D11_FL10_0_WARP(), ES2_D3D11_FL9_3_WARP(),
ES2_D3D11_REFERENCE(), ES2_D3D11_FL11_0_REFERENCE(), ES2_D3D11_FL10_1_REFERENCE(), ES2_D3D11_FL10_0_REFERENCE(), ES2_D3D11_FL9_3_REFERENCE(),
ES3_D3D11(), ES3_D3D11_FL11_0(), ES3_D3D11_FL10_1(), ES3_D3D11_FL10_0(),
ES3_D3D11_WARP(), ES3_D3D11_FL11_0_WARP(), ES3_D3D11_FL10_1_WARP(), ES3_D3D11_FL10_0_WARP(),
ES3_D3D11_REFERENCE(), ES3_D3D11_FL11_0_REFERENCE(), ES3_D3D11_FL10_1_REFERENCE(), ES3_D3D11_FL10_0_REFERENCE(),
ES2_OPENGL(), ES3_OPENGL());
}
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(SRGBTextureTest, ES2_D3D9, ES2_D3D11, ES3_D3D11, ES2_OPENGL);
namespace
{
template<typename T>
class SRGBTextureTest : public ANGLETest class SRGBTextureTest : public ANGLETest
{ {
protected: protected:
SRGBTextureTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) SRGBTextureTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -17,18 +24,18 @@ protected: ...@@ -17,18 +24,18 @@ protected:
setConfigAlphaBits(8); setConfigAlphaBits(8);
} }
virtual void SetUp() void SetUp() override
{ {
ANGLETest::SetUp(); ANGLETest::SetUp();
} }
virtual void TearDown() void TearDown() override
{ {
ANGLETest::TearDown(); ANGLETest::TearDown();
} }
}; };
TYPED_TEST(SRGBTextureTest, SRGBValidation) TEST_P(SRGBTextureTest, SRGBValidation)
{ {
bool supported = extensionEnabled("GL_EXT_sRGB") || getClientVersion() == 3; bool supported = extensionEnabled("GL_EXT_sRGB") || getClientVersion() == 3;
...@@ -56,7 +63,7 @@ TYPED_TEST(SRGBTextureTest, SRGBValidation) ...@@ -56,7 +63,7 @@ TYPED_TEST(SRGBTextureTest, SRGBValidation)
glDeleteTextures(1, &tex); glDeleteTextures(1, &tex);
} }
TYPED_TEST(SRGBTextureTest, SRGBAValidation) TEST_P(SRGBTextureTest, SRGBAValidation)
{ {
bool supported = extensionEnabled("GL_EXT_sRGB") || getClientVersion() == 3; bool supported = extensionEnabled("GL_EXT_sRGB") || getClientVersion() == 3;
...@@ -91,7 +98,7 @@ TYPED_TEST(SRGBTextureTest, SRGBAValidation) ...@@ -91,7 +98,7 @@ TYPED_TEST(SRGBTextureTest, SRGBAValidation)
glDeleteTextures(1, &tex); glDeleteTextures(1, &tex);
} }
TYPED_TEST(SRGBTextureTest, SRGBARenderbuffer) TEST_P(SRGBTextureTest, SRGBARenderbuffer)
{ {
bool supported = extensionEnabled("GL_EXT_sRGB") || getClientVersion() == 3; bool supported = extensionEnabled("GL_EXT_sRGB") || getClientVersion() == 3;
...@@ -135,3 +142,8 @@ TYPED_TEST(SRGBTextureTest, SRGBARenderbuffer) ...@@ -135,3 +142,8 @@ TYPED_TEST(SRGBTextureTest, SRGBARenderbuffer)
glDeleteFramebuffers(1, &fbo); glDeleteFramebuffers(1, &fbo);
glDeleteRenderbuffers(1, &rbo); glDeleteRenderbuffers(1, &rbo);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(SRGBTextureTest, ES2_D3D9(), ES2_D3D11(), ES3_D3D11(), ES2_OPENGL());
} // namespace
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// SimpleOperationTest:
// Basic GL commands such as linking a program, initializing a buffer, etc.
#include "ANGLETest.h" #include "ANGLETest.h"
#include <vector> #include <vector>
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(SimpleOperationTest, ES2_D3D9, ES2_D3D11, ES3_D3D11, ES2_OPENGL, ES3_OPENGL);
namespace
{
template<typename T>
class SimpleOperationTest : public ANGLETest class SimpleOperationTest : public ANGLETest
{ {
protected: protected:
SimpleOperationTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) SimpleOperationTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -20,7 +29,7 @@ class SimpleOperationTest : public ANGLETest ...@@ -20,7 +29,7 @@ class SimpleOperationTest : public ANGLETest
} }
}; };
TYPED_TEST(SimpleOperationTest, CompileVertexShader) TEST_P(SimpleOperationTest, CompileVertexShader)
{ {
const std::string source = SHADER_SOURCE const std::string source = SHADER_SOURCE
( (
...@@ -38,7 +47,7 @@ TYPED_TEST(SimpleOperationTest, CompileVertexShader) ...@@ -38,7 +47,7 @@ TYPED_TEST(SimpleOperationTest, CompileVertexShader)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(SimpleOperationTest, CompileFragmentShader) TEST_P(SimpleOperationTest, CompileFragmentShader)
{ {
const std::string source = SHADER_SOURCE const std::string source = SHADER_SOURCE
( (
...@@ -57,7 +66,7 @@ TYPED_TEST(SimpleOperationTest, CompileFragmentShader) ...@@ -57,7 +66,7 @@ TYPED_TEST(SimpleOperationTest, CompileFragmentShader)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(SimpleOperationTest, LinkProgram) TEST_P(SimpleOperationTest, LinkProgram)
{ {
const std::string vsSource = SHADER_SOURCE const std::string vsSource = SHADER_SOURCE
( (
...@@ -82,7 +91,7 @@ TYPED_TEST(SimpleOperationTest, LinkProgram) ...@@ -82,7 +91,7 @@ TYPED_TEST(SimpleOperationTest, LinkProgram)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(SimpleOperationTest, LinkProgramWithUniforms) TEST_P(SimpleOperationTest, LinkProgramWithUniforms)
{ {
const std::string vsSource = SHADER_SOURCE const std::string vsSource = SHADER_SOURCE
( (
...@@ -113,7 +122,7 @@ TYPED_TEST(SimpleOperationTest, LinkProgramWithUniforms) ...@@ -113,7 +122,7 @@ TYPED_TEST(SimpleOperationTest, LinkProgramWithUniforms)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(SimpleOperationTest, LinkProgramWithAttributes) TEST_P(SimpleOperationTest, LinkProgramWithAttributes)
{ {
const std::string vsSource = SHADER_SOURCE const std::string vsSource = SHADER_SOURCE
( (
...@@ -143,7 +152,7 @@ TYPED_TEST(SimpleOperationTest, LinkProgramWithAttributes) ...@@ -143,7 +152,7 @@ TYPED_TEST(SimpleOperationTest, LinkProgramWithAttributes)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(SimpleOperationTest, BufferDataWithData) TEST_P(SimpleOperationTest, BufferDataWithData)
{ {
GLuint buffer; GLuint buffer;
glGenBuffers(1, &buffer); glGenBuffers(1, &buffer);
...@@ -157,7 +166,7 @@ TYPED_TEST(SimpleOperationTest, BufferDataWithData) ...@@ -157,7 +166,7 @@ TYPED_TEST(SimpleOperationTest, BufferDataWithData)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(SimpleOperationTest, BufferDataWithNoData) TEST_P(SimpleOperationTest, BufferDataWithNoData)
{ {
GLuint buffer; GLuint buffer;
glGenBuffers(1, &buffer); glGenBuffers(1, &buffer);
...@@ -168,7 +177,7 @@ TYPED_TEST(SimpleOperationTest, BufferDataWithNoData) ...@@ -168,7 +177,7 @@ TYPED_TEST(SimpleOperationTest, BufferDataWithNoData)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
TYPED_TEST(SimpleOperationTest, BufferSubData) TEST_P(SimpleOperationTest, BufferSubData)
{ {
GLuint buffer; GLuint buffer;
glGenBuffers(1, &buffer); glGenBuffers(1, &buffer);
...@@ -188,3 +197,10 @@ TYPED_TEST(SimpleOperationTest, BufferSubData) ...@@ -188,3 +197,10 @@ TYPED_TEST(SimpleOperationTest, BufferSubData)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(
SimpleOperationTest,
ES2_D3D9(), ES2_D3D11(), ES3_D3D11(), ES2_OPENGL(), ES3_OPENGL());
} // namespace
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
#include <vector> #include <vector>
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(SwizzleTest, ES3_D3D11);
namespace
{
template<typename T>
class SwizzleTest : public ANGLETest class SwizzleTest : public ANGLETest
{ {
protected: protected:
SwizzleTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) SwizzleTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -48,7 +55,7 @@ protected: ...@@ -48,7 +55,7 @@ protected:
} }
} }
virtual void SetUp() void SetUp() override
{ {
ANGLETest::SetUp(); ANGLETest::SetUp();
...@@ -88,7 +95,7 @@ protected: ...@@ -88,7 +95,7 @@ protected:
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
} }
virtual void TearDown() void TearDown() override
{ {
glDeleteProgram(mProgram); glDeleteProgram(mProgram);
glDeleteTextures(1, &mTexture); glDeleteTextures(1, &mTexture);
...@@ -184,77 +191,77 @@ protected: ...@@ -184,77 +191,77 @@ protected:
std::vector<swizzlePermutation> mPermutations; std::vector<swizzlePermutation> mPermutations;
}; };
TYPED_TEST(SwizzleTest, RGBA8_2D) TEST_P(SwizzleTest, RGBA8_2D)
{ {
GLubyte data[] = { 1, 64, 128, 200 }; GLubyte data[] = { 1, 64, 128, 200 };
init2DTexture(GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, data); init2DTexture(GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, data);
runTest2D(); runTest2D();
} }
TYPED_TEST(SwizzleTest, RGB8_2D) TEST_P(SwizzleTest, RGB8_2D)
{ {
GLubyte data[] = { 77, 66, 55 }; GLubyte data[] = { 77, 66, 55 };
init2DTexture(GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, data); init2DTexture(GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, data);
runTest2D(); runTest2D();
} }
TYPED_TEST(SwizzleTest, RG8_2D) TEST_P(SwizzleTest, RG8_2D)
{ {
GLubyte data[] = { 11, 99 }; GLubyte data[] = { 11, 99 };
init2DTexture(GL_RG8, GL_RG, GL_UNSIGNED_BYTE, data); init2DTexture(GL_RG8, GL_RG, GL_UNSIGNED_BYTE, data);
runTest2D(); runTest2D();
} }
TYPED_TEST(SwizzleTest, R8_2D) TEST_P(SwizzleTest, R8_2D)
{ {
GLubyte data[] = { 2 }; GLubyte data[] = { 2 };
init2DTexture(GL_R8, GL_RED, GL_UNSIGNED_BYTE, data); init2DTexture(GL_R8, GL_RED, GL_UNSIGNED_BYTE, data);
runTest2D(); runTest2D();
} }
TYPED_TEST(SwizzleTest, RGBA32F_2D) TEST_P(SwizzleTest, RGBA32F_2D)
{ {
GLfloat data[] = { 0.25f, 0.5f, 0.75f, 0.8f }; GLfloat data[] = { 0.25f, 0.5f, 0.75f, 0.8f };
init2DTexture(GL_RGBA32F, GL_RGBA, GL_FLOAT, data); init2DTexture(GL_RGBA32F, GL_RGBA, GL_FLOAT, data);
runTest2D(); runTest2D();
} }
TYPED_TEST(SwizzleTest, RGB32F_2D) TEST_P(SwizzleTest, RGB32F_2D)
{ {
GLfloat data[] = { 0.1f, 0.2f, 0.3f }; GLfloat data[] = { 0.1f, 0.2f, 0.3f };
init2DTexture(GL_RGB32F, GL_RGB, GL_FLOAT, data); init2DTexture(GL_RGB32F, GL_RGB, GL_FLOAT, data);
runTest2D(); runTest2D();
} }
TYPED_TEST(SwizzleTest, RG32F_2D) TEST_P(SwizzleTest, RG32F_2D)
{ {
GLfloat data[] = { 0.9f, 0.1f }; GLfloat data[] = { 0.9f, 0.1f };
init2DTexture(GL_RG32F, GL_RG, GL_FLOAT, data); init2DTexture(GL_RG32F, GL_RG, GL_FLOAT, data);
runTest2D(); runTest2D();
} }
TYPED_TEST(SwizzleTest, R32F_2D) TEST_P(SwizzleTest, R32F_2D)
{ {
GLfloat data[] = { 0.5f }; GLfloat data[] = { 0.5f };
init2DTexture(GL_R32F, GL_RED, GL_FLOAT, data); init2DTexture(GL_R32F, GL_RED, GL_FLOAT, data);
runTest2D(); runTest2D();
} }
TYPED_TEST(SwizzleTest, D32F_2D) TEST_P(SwizzleTest, D32F_2D)
{ {
GLfloat data[] = { 0.5f }; GLfloat data[] = { 0.5f };
init2DTexture(GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, data); init2DTexture(GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, data);
runTest2D(); runTest2D();
} }
TYPED_TEST(SwizzleTest, D16_2D) TEST_P(SwizzleTest, D16_2D)
{ {
GLushort data[] = { 0xFF }; GLushort data[] = { 0xFF };
init2DTexture(GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, data); init2DTexture(GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, data);
runTest2D(); runTest2D();
} }
TYPED_TEST(SwizzleTest, D24_2D) TEST_P(SwizzleTest, D24_2D)
{ {
GLuint data[] = { 0xFFFF }; GLuint data[] = { 0xFFFF };
init2DTexture(GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, data); init2DTexture(GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, data);
...@@ -263,7 +270,7 @@ TYPED_TEST(SwizzleTest, D24_2D) ...@@ -263,7 +270,7 @@ TYPED_TEST(SwizzleTest, D24_2D)
#include "media/pixel.inl" #include "media/pixel.inl"
TYPED_TEST(SwizzleTest, CompressedDXT_2D) TEST_P(SwizzleTest, CompressedDXT_2D)
{ {
if (!extensionEnabled("GL_EXT_texture_compression_dxt1")) if (!extensionEnabled("GL_EXT_texture_compression_dxt1"))
{ {
...@@ -273,3 +280,8 @@ TYPED_TEST(SwizzleTest, CompressedDXT_2D) ...@@ -273,3 +280,8 @@ TYPED_TEST(SwizzleTest, CompressedDXT_2D)
init2DCompressedTexture(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, pixel_0_width, pixel_0_height, pixel_0_size, pixel_0_data); init2DCompressedTexture(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, pixel_0_width, pixel_0_height, pixel_0_size, pixel_0_data);
runTest2D(); runTest2D();
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(SwizzleTest, ES3_D3D11());
} // namespace
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(TextureTest, ES2_D3D9, ES2_D3D11, ES2_D3D11_FL9_3);
namespace
{
template<typename T>
class TextureTest : public ANGLETest class TextureTest : public ANGLETest
{ {
protected: protected:
TextureTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) TextureTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -17,7 +24,7 @@ class TextureTest : public ANGLETest ...@@ -17,7 +24,7 @@ class TextureTest : public ANGLETest
setConfigAlphaBits(8); setConfigAlphaBits(8);
} }
virtual void SetUp() void SetUp() override
{ {
ANGLETest::SetUp(); ANGLETest::SetUp();
glGenTextures(1, &mTexture2D); glGenTextures(1, &mTexture2D);
...@@ -93,7 +100,7 @@ class TextureTest : public ANGLETest ...@@ -93,7 +100,7 @@ class TextureTest : public ANGLETest
ASSERT_GL_NO_ERROR(); ASSERT_GL_NO_ERROR();
} }
virtual void TearDown() void TearDown() override
{ {
glDeleteTextures(1, &mTexture2D); glDeleteTextures(1, &mTexture2D);
glDeleteTextures(1, &mTextureCube); glDeleteTextures(1, &mTextureCube);
...@@ -242,7 +249,7 @@ class TextureTest : public ANGLETest ...@@ -242,7 +249,7 @@ class TextureTest : public ANGLETest
GLint mTextureScaleUniformLocation; GLint mTextureScaleUniformLocation;
}; };
TYPED_TEST(TextureTest, NegativeAPISubImage) TEST_P(TextureTest, NegativeAPISubImage)
{ {
glBindTexture(GL_TEXTURE_2D, mTexture2D); glBindTexture(GL_TEXTURE_2D, mTexture2D);
EXPECT_GL_ERROR(GL_NO_ERROR); EXPECT_GL_ERROR(GL_NO_ERROR);
...@@ -252,7 +259,7 @@ TYPED_TEST(TextureTest, NegativeAPISubImage) ...@@ -252,7 +259,7 @@ TYPED_TEST(TextureTest, NegativeAPISubImage)
EXPECT_GL_ERROR(GL_INVALID_VALUE); EXPECT_GL_ERROR(GL_INVALID_VALUE);
} }
TYPED_TEST(TextureTest, ZeroSizedUploads) TEST_P(TextureTest, ZeroSizedUploads)
{ {
glBindTexture(GL_TEXTURE_2D, mTexture2D); glBindTexture(GL_TEXTURE_2D, mTexture2D);
EXPECT_GL_ERROR(GL_NO_ERROR); EXPECT_GL_ERROR(GL_NO_ERROR);
...@@ -275,7 +282,7 @@ TYPED_TEST(TextureTest, ZeroSizedUploads) ...@@ -275,7 +282,7 @@ TYPED_TEST(TextureTest, ZeroSizedUploads)
} }
// Test drawing with two texture types, to trigger an ANGLE bug in validation // Test drawing with two texture types, to trigger an ANGLE bug in validation
TYPED_TEST(TextureTest, CubeMapBug) TEST_P(TextureTest, CubeMapBug)
{ {
glActiveTexture(GL_TEXTURE0); glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, mTexture2D); glBindTexture(GL_TEXTURE_2D, mTexture2D);
...@@ -295,7 +302,7 @@ TYPED_TEST(TextureTest, CubeMapBug) ...@@ -295,7 +302,7 @@ TYPED_TEST(TextureTest, CubeMapBug)
} }
// Copy of a test in conformance/textures/texture-mips, to test generate mipmaps // Copy of a test in conformance/textures/texture-mips, to test generate mipmaps
TYPED_TEST(TextureTest, MipmapsTwice) TEST_P(TextureTest, MipmapsTwice)
{ {
int px = getWindowWidth() / 2; int px = getWindowWidth() / 2;
int py = getWindowHeight() / 2; int py = getWindowHeight() / 2;
...@@ -357,7 +364,7 @@ TYPED_TEST(TextureTest, MipmapsTwice) ...@@ -357,7 +364,7 @@ TYPED_TEST(TextureTest, MipmapsTwice)
// Test creating a FBO with a cube map render target, to test an ANGLE bug // Test creating a FBO with a cube map render target, to test an ANGLE bug
// https://code.google.com/p/angleproject/issues/detail?id=849 // https://code.google.com/p/angleproject/issues/detail?id=849
TYPED_TEST(TextureTest, CubeMapFBO) TEST_P(TextureTest, CubeMapFBO)
{ {
GLuint fbo; GLuint fbo;
glGenFramebuffers(1, &fbo); glGenFramebuffers(1, &fbo);
...@@ -374,7 +381,7 @@ TYPED_TEST(TextureTest, CubeMapFBO) ...@@ -374,7 +381,7 @@ TYPED_TEST(TextureTest, CubeMapFBO)
} }
// Test that glTexSubImage2D works properly when glTexStorage2DEXT has initialized the image with a default color. // Test that glTexSubImage2D works properly when glTexStorage2DEXT has initialized the image with a default color.
TYPED_TEST(TextureTest, TexStorage) TEST_P(TextureTest, TexStorage)
{ {
int width = getWindowWidth(); int width = getWindowWidth();
int height = getWindowHeight(); int height = getWindowHeight();
...@@ -419,7 +426,7 @@ TYPED_TEST(TextureTest, TexStorage) ...@@ -419,7 +426,7 @@ TYPED_TEST(TextureTest, TexStorage)
} }
// Test that glTexSubImage2D combined with a PBO works properly when glTexStorage2DEXT has initialized the image with a default color. // Test that glTexSubImage2D combined with a PBO works properly when glTexStorage2DEXT has initialized the image with a default color.
TYPED_TEST(TextureTest, TexStorageWithPBO) TEST_P(TextureTest, TexStorageWithPBO)
{ {
if (extensionEnabled("NV_pixel_buffer_object")) if (extensionEnabled("NV_pixel_buffer_object"))
{ {
...@@ -470,59 +477,59 @@ TYPED_TEST(TextureTest, TexStorageWithPBO) ...@@ -470,59 +477,59 @@ TYPED_TEST(TextureTest, TexStorageWithPBO)
} }
// See description on testFloatCopySubImage // See description on testFloatCopySubImage
TYPED_TEST(TextureTest, CopySubImageFloat_R_R) TEST_P(TextureTest, CopySubImageFloat_R_R)
{ {
testFloatCopySubImage(1, 1); testFloatCopySubImage(1, 1);
} }
TYPED_TEST(TextureTest, CopySubImageFloat_RG_R) TEST_P(TextureTest, CopySubImageFloat_RG_R)
{ {
testFloatCopySubImage(2, 1); testFloatCopySubImage(2, 1);
} }
TYPED_TEST(TextureTest, CopySubImageFloat_RG_RG) TEST_P(TextureTest, CopySubImageFloat_RG_RG)
{ {
testFloatCopySubImage(2, 2); testFloatCopySubImage(2, 2);
} }
TYPED_TEST(TextureTest, CopySubImageFloat_RGB_R) TEST_P(TextureTest, CopySubImageFloat_RGB_R)
{ {
testFloatCopySubImage(3, 1); testFloatCopySubImage(3, 1);
} }
TYPED_TEST(TextureTest, CopySubImageFloat_RGB_RG) TEST_P(TextureTest, CopySubImageFloat_RGB_RG)
{ {
testFloatCopySubImage(3, 2); testFloatCopySubImage(3, 2);
} }
TYPED_TEST(TextureTest, CopySubImageFloat_RGB_RGB) TEST_P(TextureTest, CopySubImageFloat_RGB_RGB)
{ {
testFloatCopySubImage(3, 3); testFloatCopySubImage(3, 3);
} }
TYPED_TEST(TextureTest, CopySubImageFloat_RGBA_R) TEST_P(TextureTest, CopySubImageFloat_RGBA_R)
{ {
testFloatCopySubImage(4, 1); testFloatCopySubImage(4, 1);
} }
TYPED_TEST(TextureTest, CopySubImageFloat_RGBA_RG) TEST_P(TextureTest, CopySubImageFloat_RGBA_RG)
{ {
testFloatCopySubImage(4, 2); testFloatCopySubImage(4, 2);
} }
TYPED_TEST(TextureTest, CopySubImageFloat_RGBA_RGB) TEST_P(TextureTest, CopySubImageFloat_RGBA_RGB)
{ {
testFloatCopySubImage(4, 3); testFloatCopySubImage(4, 3);
} }
TYPED_TEST(TextureTest, CopySubImageFloat_RGBA_RGBA) TEST_P(TextureTest, CopySubImageFloat_RGBA_RGBA)
{ {
testFloatCopySubImage(4, 4); testFloatCopySubImage(4, 4);
} }
// Port of https://www.khronos.org/registry/webgl/conformance-suites/1.0.3/conformance/textures/texture-npot.html // Port of https://www.khronos.org/registry/webgl/conformance-suites/1.0.3/conformance/textures/texture-npot.html
// Run against GL_ALPHA/UNSIGNED_BYTE format, to ensure that D3D11 Feature Level 9_3 correctly handles GL_ALPHA // Run against GL_ALPHA/UNSIGNED_BYTE format, to ensure that D3D11 Feature Level 9_3 correctly handles GL_ALPHA
TYPED_TEST(TextureTest, TextureNPOT_GL_ALPHA_UBYTE) TEST_P(TextureTest, TextureNPOT_GL_ALPHA_UBYTE)
{ {
const int npotTexSize = 5; const int npotTexSize = 5;
const int potTexSize = 4; // Should be less than npotTexSize const int potTexSize = 4; // Should be less than npotTexSize
...@@ -602,3 +609,8 @@ TYPED_TEST(TextureTest, TextureNPOT_GL_ALPHA_UBYTE) ...@@ -602,3 +609,8 @@ TYPED_TEST(TextureTest, TextureNPOT_GL_ALPHA_UBYTE)
EXPECT_PIXEL_EQ(getWindowWidth() / 2, getWindowHeight() / 2, 0, 0, 0, 64); EXPECT_PIXEL_EQ(getWindowWidth() / 2, getWindowHeight() / 2, 0, 0, 0, 64);
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(TextureTest, ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3());
} // namespace
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(TransformFeedbackTest, ES3_D3D11);
namespace
{
template<typename T>
class TransformFeedbackTest : public ANGLETest class TransformFeedbackTest : public ANGLETest
{ {
protected: protected:
TransformFeedbackTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) TransformFeedbackTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -17,7 +24,7 @@ class TransformFeedbackTest : public ANGLETest ...@@ -17,7 +24,7 @@ class TransformFeedbackTest : public ANGLETest
setConfigAlphaBits(8); setConfigAlphaBits(8);
} }
virtual void SetUp() void SetUp() override
{ {
ANGLETest::SetUp(); ANGLETest::SetUp();
...@@ -56,7 +63,7 @@ class TransformFeedbackTest : public ANGLETest ...@@ -56,7 +63,7 @@ class TransformFeedbackTest : public ANGLETest
ASSERT_GL_NO_ERROR(); ASSERT_GL_NO_ERROR();
} }
virtual void TearDown() void TearDown() override
{ {
glDeleteProgram(mProgram); glDeleteProgram(mProgram);
glDeleteBuffers(1, &mTransformFeedbackBuffer); glDeleteBuffers(1, &mTransformFeedbackBuffer);
...@@ -69,7 +76,7 @@ class TransformFeedbackTest : public ANGLETest ...@@ -69,7 +76,7 @@ class TransformFeedbackTest : public ANGLETest
GLuint mTransformFeedbackBuffer; GLuint mTransformFeedbackBuffer;
}; };
TYPED_TEST(TransformFeedbackTest, ZeroSizedViewport) TEST_P(TransformFeedbackTest, ZeroSizedViewport)
{ {
// Set the program's transform feedback varyings (just gl_Position) // Set the program's transform feedback varyings (just gl_Position)
const GLchar* transformFeedbackVaryings[] = const GLchar* transformFeedbackVaryings[] =
...@@ -115,7 +122,7 @@ TYPED_TEST(TransformFeedbackTest, ZeroSizedViewport) ...@@ -115,7 +122,7 @@ TYPED_TEST(TransformFeedbackTest, ZeroSizedViewport)
} }
// Test that XFB can write back vertices to a buffer and that we can draw from this buffer afterward. // Test that XFB can write back vertices to a buffer and that we can draw from this buffer afterward.
TYPED_TEST(TransformFeedbackTest, RecordAndDraw) TEST_P(TransformFeedbackTest, RecordAndDraw)
{ {
// Set the program's transform feedback varyings (just gl_Position) // Set the program's transform feedback varyings (just gl_Position)
const GLchar* transformFeedbackVaryings[] = const GLchar* transformFeedbackVaryings[] =
...@@ -196,7 +203,7 @@ TYPED_TEST(TransformFeedbackTest, RecordAndDraw) ...@@ -196,7 +203,7 @@ TYPED_TEST(TransformFeedbackTest, RecordAndDraw)
} }
// Test that buffer binding happens only on the current transform feedback object // Test that buffer binding happens only on the current transform feedback object
TYPED_TEST(TransformFeedbackTest, BufferBinding) TEST_P(TransformFeedbackTest, BufferBinding)
{ {
// Reset any state // Reset any state
glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0);
...@@ -252,3 +259,8 @@ TYPED_TEST(TransformFeedbackTest, BufferBinding) ...@@ -252,3 +259,8 @@ TYPED_TEST(TransformFeedbackTest, BufferBinding)
glDeleteTransformFeedbacks(1, &transformFeedbackObject); glDeleteTransformFeedbacks(1, &transformFeedbackObject);
glDeleteBuffers(1, &scratchBuffer); glDeleteBuffers(1, &scratchBuffer);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(TransformFeedbackTest, ES3_D3D11());
} // namespace
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(UniformBufferTest, ES3_D3D11, ES3_D3D11_FL11_1, ES3_D3D11_FL11_1_REFERENCE);
namespace
{
template<typename T>
class UniformBufferTest : public ANGLETest class UniformBufferTest : public ANGLETest
{ {
protected: protected:
UniformBufferTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) UniformBufferTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -70,7 +77,7 @@ class UniformBufferTest : public ANGLETest ...@@ -70,7 +77,7 @@ class UniformBufferTest : public ANGLETest
// Test that using a UBO with a non-zero offset and size actually works. // Test that using a UBO with a non-zero offset and size actually works.
// The first step of this test renders a color from a UBO with a zero offset. // The first step of this test renders a color from a UBO with a zero offset.
// The second step renders a color from a UBO with a non-zero offset. // The second step renders a color from a UBO with a non-zero offset.
TYPED_TEST(UniformBufferTest, UniformBufferRange) TEST_P(UniformBufferTest, UniformBufferRange)
{ {
int px = getWindowWidth() / 2; int px = getWindowWidth() / 2;
int py = getWindowHeight() / 2; int py = getWindowHeight() / 2;
...@@ -141,7 +148,7 @@ TYPED_TEST(UniformBufferTest, UniformBufferRange) ...@@ -141,7 +148,7 @@ TYPED_TEST(UniformBufferTest, UniformBufferRange)
} }
// Test uniform block bindings. // Test uniform block bindings.
TYPED_TEST(UniformBufferTest, UniformBufferBindings) TEST_P(UniformBufferTest, UniformBufferBindings)
{ {
int px = getWindowWidth() / 2; int px = getWindowWidth() / 2;
int py = getWindowHeight() / 2; int py = getWindowHeight() / 2;
...@@ -185,7 +192,7 @@ TYPED_TEST(UniformBufferTest, UniformBufferBindings) ...@@ -185,7 +192,7 @@ TYPED_TEST(UniformBufferTest, UniformBufferBindings)
// Test that ANGLE handles used but unbound UBO. // Test that ANGLE handles used but unbound UBO.
// TODO: A test case shouldn't depend on the error code of an undefined behaviour. Move this to unit tests of the validation layer. // TODO: A test case shouldn't depend on the error code of an undefined behaviour. Move this to unit tests of the validation layer.
TYPED_TEST(UniformBufferTest, UnboundUniformBuffer) TEST_P(UniformBufferTest, UnboundUniformBuffer)
{ {
glUniformBlockBinding(mProgram, mUniformBufferIndex, 0); glUniformBlockBinding(mProgram, mUniformBufferIndex, 0);
glBindBufferBase(GL_UNIFORM_BUFFER, 0, 0); glBindBufferBase(GL_UNIFORM_BUFFER, 0, 0);
...@@ -197,7 +204,7 @@ TYPED_TEST(UniformBufferTest, UnboundUniformBuffer) ...@@ -197,7 +204,7 @@ TYPED_TEST(UniformBufferTest, UnboundUniformBuffer)
// Update a UBO many time and verify that ANGLE uses the latest version of the data. // Update a UBO many time and verify that ANGLE uses the latest version of the data.
// https://code.google.com/p/angleproject/issues/detail?id=965 // https://code.google.com/p/angleproject/issues/detail?id=965
TYPED_TEST(UniformBufferTest, UniformBufferManyUpdates) TEST_P(UniformBufferTest, UniformBufferManyUpdates)
{ {
int px = getWindowWidth() / 2; int px = getWindowWidth() / 2;
int py = getWindowHeight() / 2; int py = getWindowHeight() / 2;
...@@ -230,7 +237,7 @@ TYPED_TEST(UniformBufferTest, UniformBufferManyUpdates) ...@@ -230,7 +237,7 @@ TYPED_TEST(UniformBufferTest, UniformBufferManyUpdates)
} }
// Use a large number of buffer ranges (compared to the actual size of the UBO) // Use a large number of buffer ranges (compared to the actual size of the UBO)
TYPED_TEST(UniformBufferTest, ManyUniformBufferRange) TEST_P(UniformBufferTest, ManyUniformBufferRange)
{ {
int px = getWindowWidth() / 2; int px = getWindowWidth() / 2;
int py = getWindowHeight() / 2; int py = getWindowHeight() / 2;
...@@ -305,3 +312,10 @@ TYPED_TEST(UniformBufferTest, ManyUniformBufferRange) ...@@ -305,3 +312,10 @@ TYPED_TEST(UniformBufferTest, ManyUniformBufferRange)
EXPECT_PIXEL_EQ(px, py, 10 + i, 20 + i, 30 + i, 40 + i); EXPECT_PIXEL_EQ(px, py, 10 + i, 20 + i, 30 + i, 40 + i);
} }
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
INSTANTIATE_TEST_CASE_P(
ANGLE, UniformBufferTest,
testing::Values(ES3_D3D11(), ES3_D3D11_FL11_1(), ES3_D3D11_FL11_1_REFERENCE()));
} // namespace
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(UniformTest, ES2_D3D9, ES2_D3D11, ES2_OPENGL);
namespace
{
template<typename T>
class UniformTest : public ANGLETest class UniformTest : public ANGLETest
{ {
protected: protected:
UniformTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) UniformTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -17,7 +24,7 @@ class UniformTest : public ANGLETest ...@@ -17,7 +24,7 @@ class UniformTest : public ANGLETest
setConfigAlphaBits(8); setConfigAlphaBits(8);
} }
virtual void SetUp() void SetUp() override
{ {
ANGLETest::SetUp(); ANGLETest::SetUp();
...@@ -40,7 +47,7 @@ class UniformTest : public ANGLETest ...@@ -40,7 +47,7 @@ class UniformTest : public ANGLETest
ASSERT_GL_NO_ERROR(); ASSERT_GL_NO_ERROR();
} }
virtual void TearDown() void TearDown() override
{ {
glDeleteProgram(mProgram); glDeleteProgram(mProgram);
ANGLETest::TearDown(); ANGLETest::TearDown();
...@@ -51,7 +58,7 @@ class UniformTest : public ANGLETest ...@@ -51,7 +58,7 @@ class UniformTest : public ANGLETest
GLint mUniformILocation; GLint mUniformILocation;
}; };
TYPED_TEST(UniformTest, GetUniformNoCurrentProgram) TEST_P(UniformTest, GetUniformNoCurrentProgram)
{ {
glUseProgram(mProgram); glUseProgram(mProgram);
glUniform1f(mUniformFLocation, 1.0f); glUniform1f(mUniformFLocation, 1.0f);
...@@ -77,7 +84,7 @@ TYPED_TEST(UniformTest, GetUniformNoCurrentProgram) ...@@ -77,7 +84,7 @@ TYPED_TEST(UniformTest, GetUniformNoCurrentProgram)
EXPECT_EQ(1, i); EXPECT_EQ(1, i);
} }
TYPED_TEST(UniformTest, UniformArrayLocations) TEST_P(UniformTest, UniformArrayLocations)
{ {
// TODO(geofflang): Figure out why this is broken on Intel OpenGL // TODO(geofflang): Figure out why this is broken on Intel OpenGL
if (isIntel() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE) if (isIntel() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
...@@ -147,3 +154,8 @@ TYPED_TEST(UniformTest, UniformArrayLocations) ...@@ -147,3 +154,8 @@ TYPED_TEST(UniformTest, UniformArrayLocations)
glDeleteProgram(program); glDeleteProgram(program);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(UniformTest, ES2_D3D9(), ES2_D3D11(), ES2_OPENGL());
} // namespace
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
#include <array> #include <array>
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
ANGLE_TYPED_TEST_CASE(UnpackAlignmentTest, ES2_D3D9, ES2_D3D11, ES2_OPENGL, ES3_OPENGL);
namespace
{
template<typename T>
class UnpackAlignmentTest : public ANGLETest class UnpackAlignmentTest : public ANGLETest
{ {
protected: protected:
UnpackAlignmentTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) UnpackAlignmentTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -22,7 +29,7 @@ protected: ...@@ -22,7 +29,7 @@ protected:
mProgram = 0; mProgram = 0;
} }
virtual void SetUp() void SetUp() override
{ {
ANGLETest::SetUp(); ANGLETest::SetUp();
...@@ -54,7 +61,7 @@ protected: ...@@ -54,7 +61,7 @@ protected:
} }
} }
virtual void TearDown() void TearDown() override
{ {
glDeleteProgram(mProgram); glDeleteProgram(mProgram);
...@@ -137,7 +144,7 @@ protected: ...@@ -137,7 +144,7 @@ protected:
GLuint mProgram; GLuint mProgram;
}; };
TYPED_TEST(UnpackAlignmentTest, DefaultAlignment) TEST_P(UnpackAlignmentTest, DefaultAlignment)
{ {
GLint defaultAlignment; GLint defaultAlignment;
glGetIntegerv(GL_UNPACK_ALIGNMENT, &defaultAlignment); glGetIntegerv(GL_UNPACK_ALIGNMENT, &defaultAlignment);
...@@ -145,165 +152,172 @@ TYPED_TEST(UnpackAlignmentTest, DefaultAlignment) ...@@ -145,165 +152,172 @@ TYPED_TEST(UnpackAlignmentTest, DefaultAlignment)
} }
TYPED_TEST(UnpackAlignmentTest, Alignment1RGBAUByte) TEST_P(UnpackAlignmentTest, Alignment1RGBAUByte)
{ {
testAlignment(1, 7 * 4, GL_RGBA, GL_UNSIGNED_BYTE); testAlignment(1, 7 * 4, GL_RGBA, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment1RGBUByte) TEST_P(UnpackAlignmentTest, Alignment1RGBUByte)
{ {
testAlignment(1, 7 * 3, GL_RGB, GL_UNSIGNED_BYTE); testAlignment(1, 7 * 3, GL_RGB, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment1RGBAUShort4444) TEST_P(UnpackAlignmentTest, Alignment1RGBAUShort4444)
{ {
testAlignment(1, 7 * 2, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4); testAlignment(1, 7 * 2, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment1RGBAUShort5551) TEST_P(UnpackAlignmentTest, Alignment1RGBAUShort5551)
{ {
testAlignment(1, 7 * 2, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1); testAlignment(1, 7 * 2, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment1RGBAUShort565) TEST_P(UnpackAlignmentTest, Alignment1RGBAUShort565)
{ {
testAlignment(1, 7 * 2, GL_RGB, GL_UNSIGNED_SHORT_5_6_5); testAlignment(1, 7 * 2, GL_RGB, GL_UNSIGNED_SHORT_5_6_5);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment1LAUByte) TEST_P(UnpackAlignmentTest, Alignment1LAUByte)
{ {
testAlignment(1, 7 * 2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE); testAlignment(1, 7 * 2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment1LUByte) TEST_P(UnpackAlignmentTest, Alignment1LUByte)
{ {
testAlignment(1, 7, GL_LUMINANCE, GL_UNSIGNED_BYTE); testAlignment(1, 7, GL_LUMINANCE, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment1AUByte) TEST_P(UnpackAlignmentTest, Alignment1AUByte)
{ {
testAlignment(1, 7, GL_ALPHA, GL_UNSIGNED_BYTE); testAlignment(1, 7, GL_ALPHA, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment2RGBAUByte) TEST_P(UnpackAlignmentTest, Alignment2RGBAUByte)
{ {
testAlignment(2, 7 * 4, GL_RGBA, GL_UNSIGNED_BYTE); testAlignment(2, 7 * 4, GL_RGBA, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment2RGBUByte) TEST_P(UnpackAlignmentTest, Alignment2RGBUByte)
{ {
testAlignment(2, 7 * 3 + 1, GL_RGB, GL_UNSIGNED_BYTE); testAlignment(2, 7 * 3 + 1, GL_RGB, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment2RGBAUShort4444) TEST_P(UnpackAlignmentTest, Alignment2RGBAUShort4444)
{ {
testAlignment(2, 7 * 2, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4); testAlignment(2, 7 * 2, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment2RGBAUShort5551) TEST_P(UnpackAlignmentTest, Alignment2RGBAUShort5551)
{ {
testAlignment(2, 7 * 2, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1); testAlignment(2, 7 * 2, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment2RGBAUShort565) TEST_P(UnpackAlignmentTest, Alignment2RGBAUShort565)
{ {
testAlignment(2, 7 * 2, GL_RGB, GL_UNSIGNED_SHORT_5_6_5); testAlignment(2, 7 * 2, GL_RGB, GL_UNSIGNED_SHORT_5_6_5);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment2LAUByte) TEST_P(UnpackAlignmentTest, Alignment2LAUByte)
{ {
testAlignment(2, 7 * 2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE); testAlignment(2, 7 * 2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment2LAByte) TEST_P(UnpackAlignmentTest, Alignment2LAByte)
{ {
testAlignment(2, 7 + 1, GL_LUMINANCE, GL_UNSIGNED_BYTE); testAlignment(2, 7 + 1, GL_LUMINANCE, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment2AUByte) TEST_P(UnpackAlignmentTest, Alignment2AUByte)
{ {
testAlignment(2, 7 + 1, GL_ALPHA, GL_UNSIGNED_BYTE); testAlignment(2, 7 + 1, GL_ALPHA, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment4RGBAUByte) TEST_P(UnpackAlignmentTest, Alignment4RGBAUByte)
{ {
testAlignment(4, 7 * 4, GL_RGBA, GL_UNSIGNED_BYTE); testAlignment(4, 7 * 4, GL_RGBA, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment4RGBUByte) TEST_P(UnpackAlignmentTest, Alignment4RGBUByte)
{ {
testAlignment(4, 7 * 3 + 3, GL_RGB, GL_UNSIGNED_BYTE); testAlignment(4, 7 * 3 + 3, GL_RGB, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment4RGBAUShort4444) TEST_P(UnpackAlignmentTest, Alignment4RGBAUShort4444)
{ {
testAlignment(4, 7 * 2 + 2, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4); testAlignment(4, 7 * 2 + 2, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment4RGBAUShort5551) TEST_P(UnpackAlignmentTest, Alignment4RGBAUShort5551)
{ {
testAlignment(4, 7 * 2 + 2, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1); testAlignment(4, 7 * 2 + 2, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment4RGBAUShort565) TEST_P(UnpackAlignmentTest, Alignment4RGBAUShort565)
{ {
testAlignment(4, 7 * 2 + 2, GL_RGB, GL_UNSIGNED_SHORT_5_6_5); testAlignment(4, 7 * 2 + 2, GL_RGB, GL_UNSIGNED_SHORT_5_6_5);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment4LAUByte) TEST_P(UnpackAlignmentTest, Alignment4LAUByte)
{ {
testAlignment(4, 7 * 2 + 2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE); testAlignment(4, 7 * 2 + 2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment4LUByte) TEST_P(UnpackAlignmentTest, Alignment4LUByte)
{ {
testAlignment(4, 7 + 1, GL_LUMINANCE, GL_UNSIGNED_BYTE); testAlignment(4, 7 + 1, GL_LUMINANCE, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment4AUByte) TEST_P(UnpackAlignmentTest, Alignment4AUByte)
{ {
testAlignment(4, 7 + 1, GL_ALPHA, GL_UNSIGNED_BYTE); testAlignment(4, 7 + 1, GL_ALPHA, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment8RGBAUByte) TEST_P(UnpackAlignmentTest, Alignment8RGBAUByte)
{ {
testAlignment(8, 7 * 4 + 4, GL_RGBA, GL_UNSIGNED_BYTE); testAlignment(8, 7 * 4 + 4, GL_RGBA, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment8RGBUByte) TEST_P(UnpackAlignmentTest, Alignment8RGBUByte)
{ {
testAlignment(8, 7 * 3 + 3, GL_RGB, GL_UNSIGNED_BYTE); testAlignment(8, 7 * 3 + 3, GL_RGB, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment8RGBAUShort4444) TEST_P(UnpackAlignmentTest, Alignment8RGBAUShort4444)
{ {
testAlignment(8, 7 * 2 + 2, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4); testAlignment(8, 7 * 2 + 2, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment8RGBAUShort5551) TEST_P(UnpackAlignmentTest, Alignment8RGBAUShort5551)
{ {
testAlignment(8, 7 * 2 + 2, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1); testAlignment(8, 7 * 2 + 2, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment8RGBAUShort565) TEST_P(UnpackAlignmentTest, Alignment8RGBAUShort565)
{ {
testAlignment(8, 7 * 2 + 2, GL_RGB, GL_UNSIGNED_SHORT_5_6_5); testAlignment(8, 7 * 2 + 2, GL_RGB, GL_UNSIGNED_SHORT_5_6_5);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment8LAUByte) TEST_P(UnpackAlignmentTest, Alignment8LAUByte)
{ {
testAlignment(8, 7 * 2 + 2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE); testAlignment(8, 7 * 2 + 2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment8LUByte) TEST_P(UnpackAlignmentTest, Alignment8LUByte)
{ {
testAlignment(8, 7 + 1, GL_LUMINANCE, GL_UNSIGNED_BYTE); testAlignment(8, 7 + 1, GL_LUMINANCE, GL_UNSIGNED_BYTE);
} }
TYPED_TEST(UnpackAlignmentTest, Alignment8AUByte) TEST_P(UnpackAlignmentTest, Alignment8AUByte)
{ {
testAlignment(8, 7 + 1, GL_ALPHA, GL_UNSIGNED_BYTE); testAlignment(8, 7 + 1, GL_ALPHA, GL_UNSIGNED_BYTE);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
INSTANTIATE_TEST_CASE_P(
ANGLE, UnpackAlignmentTest,
testing::Values(ES2_D3D9(), ES2_D3D11(), ES2_OPENGL(), ES3_OPENGL()));
} // namespace
#include "ANGLETest.h" //
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. #include "ANGLETest.h"
ANGLE_TYPED_TEST_CASE(UnpackRowLengthTest, ES3_D3D11, ES2_D3D11, ES2_OPENGL, ES3_OPENGL);
#include <array> #include <array>
template<typename T> using namespace angle;
namespace
{
class UnpackRowLengthTest : public ANGLETest class UnpackRowLengthTest : public ANGLETest
{ {
protected: protected:
UnpackRowLengthTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) UnpackRowLengthTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -22,7 +29,7 @@ class UnpackRowLengthTest : public ANGLETest ...@@ -22,7 +29,7 @@ class UnpackRowLengthTest : public ANGLETest
mProgram = 0; mProgram = 0;
} }
virtual void SetUp() override void SetUp() override
{ {
ANGLETest::SetUp(); ANGLETest::SetUp();
...@@ -54,7 +61,7 @@ class UnpackRowLengthTest : public ANGLETest ...@@ -54,7 +61,7 @@ class UnpackRowLengthTest : public ANGLETest
} }
} }
virtual void TearDown() override void TearDown() override
{ {
glDeleteProgram(mProgram); glDeleteProgram(mProgram);
...@@ -102,12 +109,19 @@ class UnpackRowLengthTest : public ANGLETest ...@@ -102,12 +109,19 @@ class UnpackRowLengthTest : public ANGLETest
GLuint mProgram; GLuint mProgram;
}; };
TYPED_TEST(UnpackRowLengthTest, RowLength128) TEST_P(UnpackRowLengthTest, RowLength128)
{ {
testRowLength(128, 128); testRowLength(128, 128);
} }
TYPED_TEST(UnpackRowLengthTest, RowLength1024) TEST_P(UnpackRowLengthTest, RowLength1024)
{ {
testRowLength(128, 1024); testRowLength(128, 1024);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
INSTANTIATE_TEST_CASE_P(
ANGLE, UnpackRowLengthTest,
testing::Values(ES3_D3D11(), ES2_D3D11(), ES2_OPENGL(), ES3_OPENGL()));
} // namespace
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
// D3D11 Feature Level 9_3 uses different D3D formats for vertex attribs compared to Feature Levels 10_0+, so we should test them separately.
ANGLE_TYPED_TEST_CASE(VertexAttributeTest, ES2_D3D9, ES2_D3D11, ES2_D3D11_FL9_3, ES2_OPENGL, ES3_OPENGL); namespace
{
template<typename T>
class VertexAttributeTest : public ANGLETest class VertexAttributeTest : public ANGLETest
{ {
protected: protected:
VertexAttributeTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) VertexAttributeTest()
{ {
setWindowWidth(128); setWindowWidth(128);
setWindowHeight(128); setWindowHeight(128);
...@@ -70,7 +76,7 @@ class VertexAttributeTest : public ANGLETest ...@@ -70,7 +76,7 @@ class VertexAttributeTest : public ANGLETest
} }
} }
virtual void SetUp() void SetUp() override
{ {
ANGLETest::SetUp(); ANGLETest::SetUp();
...@@ -116,7 +122,7 @@ class VertexAttributeTest : public ANGLETest ...@@ -116,7 +122,7 @@ class VertexAttributeTest : public ANGLETest
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
} }
virtual void TearDown() void TearDown() override
{ {
glDeleteProgram(mProgram); glDeleteProgram(mProgram);
...@@ -130,7 +136,7 @@ class VertexAttributeTest : public ANGLETest ...@@ -130,7 +136,7 @@ class VertexAttributeTest : public ANGLETest
GLint mExpectedAttrib; GLint mExpectedAttrib;
}; };
TYPED_TEST(VertexAttributeTest, UnsignedByteUnnormalized) TEST_P(VertexAttributeTest, UnsignedByteUnnormalized)
{ {
GLubyte inputData[mVertexCount] = { 0, 1, 2, 3, 4, 5, 6, 7, 125, 126, 127, 128, 129, 250, 251, 252, 253, 254, 255 }; GLubyte inputData[mVertexCount] = { 0, 1, 2, 3, 4, 5, 6, 7, 125, 126, 127, 128, 129, 250, 251, 252, 253, 254, 255 };
GLfloat expectedData[mVertexCount]; GLfloat expectedData[mVertexCount];
...@@ -143,7 +149,7 @@ TYPED_TEST(VertexAttributeTest, UnsignedByteUnnormalized) ...@@ -143,7 +149,7 @@ TYPED_TEST(VertexAttributeTest, UnsignedByteUnnormalized)
runTest(data); runTest(data);
} }
TYPED_TEST(VertexAttributeTest, UnsignedByteNormalized) TEST_P(VertexAttributeTest, UnsignedByteNormalized)
{ {
GLubyte inputData[mVertexCount] = { 0, 1, 2, 3, 4, 5, 6, 7, 125, 126, 127, 128, 129, 250, 251, 252, 253, 254, 255 }; GLubyte inputData[mVertexCount] = { 0, 1, 2, 3, 4, 5, 6, 7, 125, 126, 127, 128, 129, 250, 251, 252, 253, 254, 255 };
GLfloat expectedData[mVertexCount]; GLfloat expectedData[mVertexCount];
...@@ -156,7 +162,7 @@ TYPED_TEST(VertexAttributeTest, UnsignedByteNormalized) ...@@ -156,7 +162,7 @@ TYPED_TEST(VertexAttributeTest, UnsignedByteNormalized)
runTest(data); runTest(data);
} }
TYPED_TEST(VertexAttributeTest, ByteUnnormalized) TEST_P(VertexAttributeTest, ByteUnnormalized)
{ {
GLbyte inputData[mVertexCount] = { 0, 1, 2, 3, 4, -1, -2, -3, -4, 125, 126, 127, -128, -127, -126 }; GLbyte inputData[mVertexCount] = { 0, 1, 2, 3, 4, -1, -2, -3, -4, 125, 126, 127, -128, -127, -126 };
GLfloat expectedData[mVertexCount]; GLfloat expectedData[mVertexCount];
...@@ -169,7 +175,7 @@ TYPED_TEST(VertexAttributeTest, ByteUnnormalized) ...@@ -169,7 +175,7 @@ TYPED_TEST(VertexAttributeTest, ByteUnnormalized)
runTest(data); runTest(data);
} }
TYPED_TEST(VertexAttributeTest, ByteNormalized) TEST_P(VertexAttributeTest, ByteNormalized)
{ {
GLbyte inputData[mVertexCount] = { 0, 1, 2, 3, 4, -1, -2, -3, -4, 125, 126, 127, -128, -127, -126 }; GLbyte inputData[mVertexCount] = { 0, 1, 2, 3, 4, -1, -2, -3, -4, 125, 126, 127, -128, -127, -126 };
GLfloat expectedData[mVertexCount]; GLfloat expectedData[mVertexCount];
...@@ -182,7 +188,7 @@ TYPED_TEST(VertexAttributeTest, ByteNormalized) ...@@ -182,7 +188,7 @@ TYPED_TEST(VertexAttributeTest, ByteNormalized)
runTest(data); runTest(data);
} }
TYPED_TEST(VertexAttributeTest, UnsignedShortUnnormalized) TEST_P(VertexAttributeTest, UnsignedShortUnnormalized)
{ {
GLushort inputData[mVertexCount] = { 0, 1, 2, 3, 254, 255, 256, 32766, 32767, 32768, 65533, 65534, 65535 }; GLushort inputData[mVertexCount] = { 0, 1, 2, 3, 254, 255, 256, 32766, 32767, 32768, 65533, 65534, 65535 };
GLfloat expectedData[mVertexCount]; GLfloat expectedData[mVertexCount];
...@@ -195,7 +201,7 @@ TYPED_TEST(VertexAttributeTest, UnsignedShortUnnormalized) ...@@ -195,7 +201,7 @@ TYPED_TEST(VertexAttributeTest, UnsignedShortUnnormalized)
runTest(data); runTest(data);
} }
TYPED_TEST(VertexAttributeTest, UnsignedShortNormalized) TEST_P(VertexAttributeTest, UnsignedShortNormalized)
{ {
GLushort inputData[mVertexCount] = { 0, 1, 2, 3, 254, 255, 256, 32766, 32767, 32768, 65533, 65534, 65535 }; GLushort inputData[mVertexCount] = { 0, 1, 2, 3, 254, 255, 256, 32766, 32767, 32768, 65533, 65534, 65535 };
GLfloat expectedData[mVertexCount]; GLfloat expectedData[mVertexCount];
...@@ -208,7 +214,7 @@ TYPED_TEST(VertexAttributeTest, UnsignedShortNormalized) ...@@ -208,7 +214,7 @@ TYPED_TEST(VertexAttributeTest, UnsignedShortNormalized)
runTest(data); runTest(data);
} }
TYPED_TEST(VertexAttributeTest, ShortUnnormalized) TEST_P(VertexAttributeTest, ShortUnnormalized)
{ {
GLshort inputData[mVertexCount] = { 0, 1, 2, 3, -1, -2, -3, -4, 32766, 32767, -32768, -32767, -32766 }; GLshort inputData[mVertexCount] = { 0, 1, 2, 3, -1, -2, -3, -4, 32766, 32767, -32768, -32767, -32766 };
GLfloat expectedData[mVertexCount]; GLfloat expectedData[mVertexCount];
...@@ -221,7 +227,7 @@ TYPED_TEST(VertexAttributeTest, ShortUnnormalized) ...@@ -221,7 +227,7 @@ TYPED_TEST(VertexAttributeTest, ShortUnnormalized)
runTest(data); runTest(data);
} }
TYPED_TEST(VertexAttributeTest, ShortNormalized) TEST_P(VertexAttributeTest, ShortNormalized)
{ {
GLshort inputData[mVertexCount] = { 0, 1, 2, 3, -1, -2, -3, -4, 32766, 32767, -32768, -32767, -32766 }; GLshort inputData[mVertexCount] = { 0, 1, 2, 3, -1, -2, -3, -4, 32766, 32767, -32768, -32767, -32766 };
GLfloat expectedData[mVertexCount]; GLfloat expectedData[mVertexCount];
...@@ -233,3 +239,11 @@ TYPED_TEST(VertexAttributeTest, ShortNormalized) ...@@ -233,3 +239,11 @@ TYPED_TEST(VertexAttributeTest, ShortNormalized)
TestData data = { GL_SHORT, GL_TRUE, inputData, expectedData }; TestData data = { GL_SHORT, GL_TRUE, inputData, expectedData };
runTest(data); runTest(data);
} }
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
// D3D11 Feature Level 9_3 uses different D3D formats for vertex attribs compared to Feature Levels 10_0+, so we should test them separately.
INSTANTIATE_TEST_CASE_P(
ANGLE, VertexAttributeTest,
testing::Values(ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3(), ES2_OPENGL(), ES3_OPENGL()));
} // namespace
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. using namespace angle;
// D3D11 Feature Level 9 and D3D9 emulate large and negative viewports in the vertex shader. We should test both of these as well as D3D11 Feature Level 10_0+.
ANGLE_TYPED_TEST_CASE(ViewportTest, ES2_D3D9, ES2_D3D11, ES2_D3D11_FL9_3); namespace
{
template<typename T>
class ViewportTest : public ANGLETest class ViewportTest : public ANGLETest
{ {
protected: protected:
ViewportTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform()) ViewportTest()
{ {
setWindowWidth(512); setWindowWidth(512);
setWindowHeight(512); setWindowHeight(512);
...@@ -112,7 +118,7 @@ class ViewportTest : public ANGLETest ...@@ -112,7 +118,7 @@ class ViewportTest : public ANGLETest
} }
} }
virtual void SetUp() void SetUp() override
{ {
ANGLETest::SetUp(); ANGLETest::SetUp();
...@@ -152,7 +158,7 @@ class ViewportTest : public ANGLETest ...@@ -152,7 +158,7 @@ class ViewportTest : public ANGLETest
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
} }
virtual void TearDown() void TearDown() override
{ {
glDeleteProgram(mProgram); glDeleteProgram(mProgram);
...@@ -162,7 +168,7 @@ class ViewportTest : public ANGLETest ...@@ -162,7 +168,7 @@ class ViewportTest : public ANGLETest
GLuint mProgram; GLuint mProgram;
}; };
TYPED_TEST(ViewportTest, QuarterWindow) TEST_P(ViewportTest, QuarterWindow)
{ {
glViewport(0, 0, getWindowWidth() / 4, getWindowHeight() / 4); glViewport(0, 0, getWindowWidth() / 4, getWindowHeight() / 4);
...@@ -171,7 +177,7 @@ TYPED_TEST(ViewportTest, QuarterWindow) ...@@ -171,7 +177,7 @@ TYPED_TEST(ViewportTest, QuarterWindow)
runScissoredTest(); runScissoredTest();
} }
TYPED_TEST(ViewportTest, QuarterWindowCentered) TEST_P(ViewportTest, QuarterWindowCentered)
{ {
glViewport(getWindowWidth() * 3 / 8, getWindowHeight() * 3 / 8, getWindowWidth() / 4, getWindowHeight() / 4); glViewport(getWindowWidth() * 3 / 8, getWindowHeight() * 3 / 8, getWindowWidth() / 4, getWindowHeight() / 4);
...@@ -180,7 +186,7 @@ TYPED_TEST(ViewportTest, QuarterWindowCentered) ...@@ -180,7 +186,7 @@ TYPED_TEST(ViewportTest, QuarterWindowCentered)
runScissoredTest(); runScissoredTest();
} }
TYPED_TEST(ViewportTest, FullWindow) TEST_P(ViewportTest, FullWindow)
{ {
glViewport(0, 0, getWindowWidth(), getWindowHeight()); glViewport(0, 0, getWindowWidth(), getWindowHeight());
...@@ -189,7 +195,7 @@ TYPED_TEST(ViewportTest, FullWindow) ...@@ -189,7 +195,7 @@ TYPED_TEST(ViewportTest, FullWindow)
runScissoredTest(); runScissoredTest();
} }
TYPED_TEST(ViewportTest, FullWindowOffCenter) TEST_P(ViewportTest, FullWindowOffCenter)
{ {
glViewport(-getWindowWidth() / 2, getWindowHeight() / 2, getWindowWidth(), getWindowHeight()); glViewport(-getWindowWidth() / 2, getWindowHeight() / 2, getWindowWidth(), getWindowHeight());
...@@ -198,7 +204,7 @@ TYPED_TEST(ViewportTest, FullWindowOffCenter) ...@@ -198,7 +204,7 @@ TYPED_TEST(ViewportTest, FullWindowOffCenter)
runScissoredTest(); runScissoredTest();
} }
TYPED_TEST(ViewportTest, DoubleWindow) TEST_P(ViewportTest, DoubleWindow)
{ {
glViewport(0, 0, getWindowWidth() * 2, getWindowHeight() * 2); glViewport(0, 0, getWindowWidth() * 2, getWindowHeight() * 2);
...@@ -207,7 +213,7 @@ TYPED_TEST(ViewportTest, DoubleWindow) ...@@ -207,7 +213,7 @@ TYPED_TEST(ViewportTest, DoubleWindow)
runScissoredTest(); runScissoredTest();
} }
TYPED_TEST(ViewportTest, DoubleWindowCentered) TEST_P(ViewportTest, DoubleWindowCentered)
{ {
glViewport(-getWindowWidth() / 2, -getWindowHeight() / 2, getWindowWidth() * 2, getWindowHeight() * 2); glViewport(-getWindowWidth() / 2, -getWindowHeight() / 2, getWindowWidth() * 2, getWindowHeight() * 2);
...@@ -216,7 +222,7 @@ TYPED_TEST(ViewportTest, DoubleWindowCentered) ...@@ -216,7 +222,7 @@ TYPED_TEST(ViewportTest, DoubleWindowCentered)
runScissoredTest(); runScissoredTest();
} }
TYPED_TEST(ViewportTest, DoubleWindowOffCenter) TEST_P(ViewportTest, DoubleWindowOffCenter)
{ {
glViewport(-getWindowWidth() * 3 / 4, getWindowHeight() * 3 / 4, getWindowWidth(), getWindowHeight()); glViewport(-getWindowWidth() * 3 / 4, getWindowHeight() * 3 / 4, getWindowWidth(), getWindowHeight());
...@@ -225,7 +231,7 @@ TYPED_TEST(ViewportTest, DoubleWindowOffCenter) ...@@ -225,7 +231,7 @@ TYPED_TEST(ViewportTest, DoubleWindowOffCenter)
runScissoredTest(); runScissoredTest();
} }
TYPED_TEST(ViewportTest, TripleWindow) TEST_P(ViewportTest, TripleWindow)
{ {
glViewport(0, 0, getWindowWidth() * 3, getWindowHeight() * 3); glViewport(0, 0, getWindowWidth() * 3, getWindowHeight() * 3);
...@@ -234,7 +240,7 @@ TYPED_TEST(ViewportTest, TripleWindow) ...@@ -234,7 +240,7 @@ TYPED_TEST(ViewportTest, TripleWindow)
runScissoredTest(); runScissoredTest();
} }
TYPED_TEST(ViewportTest, TripleWindowCentered) TEST_P(ViewportTest, TripleWindowCentered)
{ {
glViewport(-getWindowWidth(), -getWindowHeight(), getWindowWidth() * 3, getWindowHeight() * 3); glViewport(-getWindowWidth(), -getWindowHeight(), getWindowWidth() * 3, getWindowHeight() * 3);
...@@ -243,11 +249,17 @@ TYPED_TEST(ViewportTest, TripleWindowCentered) ...@@ -243,11 +249,17 @@ TYPED_TEST(ViewportTest, TripleWindowCentered)
runScissoredTest(); runScissoredTest();
} }
TYPED_TEST(ViewportTest, TripleWindowOffCenter) TEST_P(ViewportTest, TripleWindowOffCenter)
{ {
glViewport(-getWindowWidth() * 3 / 2, -getWindowHeight() * 3 / 2, getWindowWidth() * 3, getWindowHeight() * 3); glViewport(-getWindowWidth() * 3 / 2, -getWindowHeight() * 3 / 2, getWindowWidth() * 3, getWindowHeight() * 3);
runNonScissoredTest(); runNonScissoredTest();
runScissoredTest(); runScissoredTest();
} }
\ No newline at end of file
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
// D3D11 Feature Level 9 and D3D9 emulate large and negative viewports in the vertex shader. We should test both of these as well as D3D11 Feature Level 10_0+.
ANGLE_INSTANTIATE_TEST(ViewportTest, ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3());
} // namespace
...@@ -4,16 +4,18 @@ ...@@ -4,16 +4,18 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
#include <gtest/gtest.h>
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include "gtest/gtest.h"
template <int clientVersion> class EGLQueryContextTest : public testing::TestWithParam<int>
class EGLQueryContextTest : public testing::Test
{ {
public: public:
virtual void SetUp() void SetUp() override
{ {
int clientVersion = GetParam();
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT")); PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"));
EXPECT_TRUE(eglGetPlatformDisplayEXT != NULL); EXPECT_TRUE(eglGetPlatformDisplayEXT != NULL);
...@@ -71,12 +73,7 @@ class EGLQueryContextTest : public testing::Test ...@@ -71,12 +73,7 @@ class EGLQueryContextTest : public testing::Test
EGLSurface mSurface; EGLSurface mSurface;
}; };
typedef EGLQueryContextTest<2> EGLQueryContextTestES2; TEST_P(EGLQueryContextTest, GetConfigID)
typedef EGLQueryContextTest<3> EGLQueryContextTestES3;
TEST_F(EGLQueryContextTestES2, GetConfigID)
{ {
EGLint configId, contextConfigId; EGLint configId, contextConfigId;
EXPECT_TRUE(eglGetConfigAttrib(mDisplay, mConfig, EGL_CONFIG_ID, &configId) != EGL_FALSE); EXPECT_TRUE(eglGetConfigAttrib(mDisplay, mConfig, EGL_CONFIG_ID, &configId) != EGL_FALSE);
...@@ -84,28 +81,28 @@ TEST_F(EGLQueryContextTestES2, GetConfigID) ...@@ -84,28 +81,28 @@ TEST_F(EGLQueryContextTestES2, GetConfigID)
EXPECT_TRUE(configId == contextConfigId); EXPECT_TRUE(configId == contextConfigId);
} }
TEST_F(EGLQueryContextTestES2, GetClientType) TEST_P(EGLQueryContextTest, GetClientType)
{ {
EGLint clientType; EGLint clientType;
EXPECT_TRUE(eglQueryContext(mDisplay, mContext, EGL_CONTEXT_CLIENT_TYPE, &clientType) != EGL_FALSE); EXPECT_TRUE(eglQueryContext(mDisplay, mContext, EGL_CONTEXT_CLIENT_TYPE, &clientType) != EGL_FALSE);
EXPECT_TRUE(clientType == EGL_OPENGL_ES_API); EXPECT_TRUE(clientType == EGL_OPENGL_ES_API);
} }
TEST_F(EGLQueryContextTestES2, GetClientVersion) TEST_P(EGLQueryContextTest, GetClientVersion)
{ {
EGLint clientVersion; EGLint clientVersion;
EXPECT_TRUE(eglQueryContext(mDisplay, mContext, EGL_CONTEXT_CLIENT_VERSION, &clientVersion) != EGL_FALSE); EXPECT_TRUE(eglQueryContext(mDisplay, mContext, EGL_CONTEXT_CLIENT_VERSION, &clientVersion) != EGL_FALSE);
EXPECT_TRUE(clientVersion == 2); EXPECT_TRUE(clientVersion == GetParam());
} }
TEST_F(EGLQueryContextTestES2, GetRenderBufferNoSurface) TEST_P(EGLQueryContextTest, GetRenderBufferNoSurface)
{ {
EGLint renderBuffer; EGLint renderBuffer;
EXPECT_TRUE(eglQueryContext(mDisplay, mContext, EGL_RENDER_BUFFER, &renderBuffer) != EGL_FALSE); EXPECT_TRUE(eglQueryContext(mDisplay, mContext, EGL_RENDER_BUFFER, &renderBuffer) != EGL_FALSE);
EXPECT_TRUE(renderBuffer == EGL_NONE); EXPECT_TRUE(renderBuffer == EGL_NONE);
} }
TEST_F(EGLQueryContextTestES2, GetRenderBufferBoundSurface) TEST_P(EGLQueryContextTest, GetRenderBufferBoundSurface)
{ {
EGLint renderBuffer, contextRenderBuffer; EGLint renderBuffer, contextRenderBuffer;
EXPECT_TRUE(eglQuerySurface(mDisplay, mSurface, EGL_RENDER_BUFFER, &renderBuffer) != EGL_FALSE); EXPECT_TRUE(eglQuerySurface(mDisplay, mSurface, EGL_RENDER_BUFFER, &renderBuffer) != EGL_FALSE);
...@@ -114,14 +111,14 @@ TEST_F(EGLQueryContextTestES2, GetRenderBufferBoundSurface) ...@@ -114,14 +111,14 @@ TEST_F(EGLQueryContextTestES2, GetRenderBufferBoundSurface)
EXPECT_TRUE(renderBuffer == contextRenderBuffer); EXPECT_TRUE(renderBuffer == contextRenderBuffer);
} }
TEST_F(EGLQueryContextTestES2, BadDisplay) TEST_P(EGLQueryContextTest, BadDisplay)
{ {
EGLint val; EGLint val;
EXPECT_TRUE(eglQueryContext(EGL_NO_DISPLAY, mContext, EGL_CONTEXT_CLIENT_TYPE, &val) == EGL_FALSE); EXPECT_TRUE(eglQueryContext(EGL_NO_DISPLAY, mContext, EGL_CONTEXT_CLIENT_TYPE, &val) == EGL_FALSE);
EXPECT_TRUE(eglGetError() == EGL_BAD_DISPLAY); EXPECT_TRUE(eglGetError() == EGL_BAD_DISPLAY);
} }
TEST_F(EGLQueryContextTestES2, NotInitialized) TEST_P(EGLQueryContextTest, NotInitialized)
{ {
EGLint val; EGLint val;
TearDown(); TearDown();
...@@ -133,23 +130,18 @@ TEST_F(EGLQueryContextTestES2, NotInitialized) ...@@ -133,23 +130,18 @@ TEST_F(EGLQueryContextTestES2, NotInitialized)
mContext = EGL_NO_CONTEXT; mContext = EGL_NO_CONTEXT;
} }
TEST_F(EGLQueryContextTestES2, BadContext) TEST_P(EGLQueryContextTest, BadContext)
{ {
EGLint val; EGLint val;
EXPECT_TRUE(eglQueryContext(mDisplay, EGL_NO_CONTEXT, EGL_CONTEXT_CLIENT_TYPE, &val) == EGL_FALSE); EXPECT_TRUE(eglQueryContext(mDisplay, EGL_NO_CONTEXT, EGL_CONTEXT_CLIENT_TYPE, &val) == EGL_FALSE);
EXPECT_TRUE(eglGetError() == EGL_BAD_CONTEXT); EXPECT_TRUE(eglGetError() == EGL_BAD_CONTEXT);
} }
TEST_F(EGLQueryContextTestES2, BadAttribute) TEST_P(EGLQueryContextTest, BadAttribute)
{ {
EGLint val; EGLint val;
EXPECT_TRUE(eglQueryContext(mDisplay, mContext, EGL_HEIGHT, &val) == EGL_FALSE); EXPECT_TRUE(eglQueryContext(mDisplay, mContext, EGL_HEIGHT, &val) == EGL_FALSE);
EXPECT_TRUE(eglGetError() == EGL_BAD_ATTRIBUTE); EXPECT_TRUE(eglGetError() == EGL_BAD_ATTRIBUTE);
} }
TEST_F(EGLQueryContextTestES3, GetClientVersion) INSTANTIATE_TEST_CASE_P(ANGLE, EGLQueryContextTest, testing::Values(2, 3));
{
EGLint clientVersion;
EXPECT_TRUE(eglQueryContext(mDisplay, mContext, EGL_CONTEXT_CLIENT_VERSION, &clientVersion) != EGL_FALSE);
EXPECT_TRUE(clientVersion == 3);
}
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#ifndef UTIL_TEST_FIXTURE_TYPES_H
#define UTIL_TEST_FIXTURE_TYPES_H
#include "EGLWindow.h"
#include <EGL/egl.h>
#include <EGL/eglext.h>
template<EGLint platform, EGLint platformMajorVersion, EGLint platformMinorVersion, EGLint warp>
struct Platform
{
static EGLPlatformParameters GetPlatform()
{
return EGLPlatformParameters(platform, platformMajorVersion, platformMinorVersion, warp);
}
};
// Typedefs of common platform types
#define DEFINE_ANGLE_TEST_PLATFORM(name, platform, majorVersion, minorVersion, useWarp) \
struct name : public Platform<platform, majorVersion, minorVersion, useWarp> { }
DEFINE_ANGLE_TEST_PLATFORM(D3D9, EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D9_REFERENCE, EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL11_1, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 11, 1, EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL11_0, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 11, 0, EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL10_1, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 10, 1, EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL10_0, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 10, 0, EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL9_3, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 9, 3, EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_WARP, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL11_1_WARP, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 11, 1, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL11_0_WARP, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 11, 0, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL10_1_WARP, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 10, 1, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL10_0_WARP, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 10, 0, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL9_3_WARP, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 9, 3, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_REFERENCE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL11_1_REFERENCE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 11, 1, EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL11_0_REFERENCE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 11, 0, EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL10_1_REFERENCE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 10, 1, EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL10_0_REFERENCE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 10, 0, EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(D3D11_FL9_3_REFERENCE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, 9, 3, EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(OPENGL, EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
DEFINE_ANGLE_TEST_PLATFORM(OPENGLES, EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
#undef DEFINE_ANGLE_TEST_PLATFORM
// Test Fixture Type
template<GLint GLESMajorVersion, typename platformT>
struct TestFixture
{
static EGLint GetGlesMajorVersion()
{
return GLESMajorVersion;
}
static EGLPlatformParameters GetPlatform()
{
return platformT::GetPlatform();
}
};
// Typedefs of common fixture types
typedef TestFixture<2, D3D9> ES2_D3D9;
typedef TestFixture<2, D3D9_REFERENCE> ES2_D3D9_REFERENCE;
typedef TestFixture<2, D3D11> ES2_D3D11;
typedef TestFixture<2, D3D11_FL11_0> ES2_D3D11_FL11_0;
typedef TestFixture<2, D3D11_FL10_1> ES2_D3D11_FL10_1;
typedef TestFixture<2, D3D11_FL10_0> ES2_D3D11_FL10_0;
typedef TestFixture<2, D3D11_FL9_3> ES2_D3D11_FL9_3;
typedef TestFixture<2, D3D11_WARP> ES2_D3D11_WARP;
typedef TestFixture<2, D3D11_FL11_0_WARP> ES2_D3D11_FL11_0_WARP;
typedef TestFixture<2, D3D11_FL10_1_WARP> ES2_D3D11_FL10_1_WARP;
typedef TestFixture<2, D3D11_FL10_0_WARP> ES2_D3D11_FL10_0_WARP;
typedef TestFixture<2, D3D11_FL9_3_WARP> ES2_D3D11_FL9_3_WARP;
typedef TestFixture<2, D3D11_REFERENCE> ES2_D3D11_REFERENCE;
typedef TestFixture<2, D3D11_FL11_0_REFERENCE> ES2_D3D11_FL11_0_REFERENCE;
typedef TestFixture<2, D3D11_FL10_1_REFERENCE> ES2_D3D11_FL10_1_REFERENCE;
typedef TestFixture<2, D3D11_FL10_0_REFERENCE> ES2_D3D11_FL10_0_REFERENCE;
typedef TestFixture<2, D3D11_FL9_3_REFERENCE> ES2_D3D11_FL9_3_REFERENCE;
typedef TestFixture<2, OPENGL> ES2_OPENGL;
typedef TestFixture<2, OPENGLES> ES2_OPENGLES;
typedef TestFixture<3, D3D11> ES3_D3D11;
typedef TestFixture<3, D3D11_FL11_1> ES3_D3D11_FL11_1;
typedef TestFixture<3, D3D11_FL11_0> ES3_D3D11_FL11_0;
typedef TestFixture<3, D3D11_FL10_1> ES3_D3D11_FL10_1;
typedef TestFixture<3, D3D11_FL10_0> ES3_D3D11_FL10_0;
typedef TestFixture<3, D3D11_WARP> ES3_D3D11_WARP;
typedef TestFixture<3, D3D11_FL11_0_WARP> ES3_D3D11_FL11_0_WARP;
typedef TestFixture<3, D3D11_FL10_1_WARP> ES3_D3D11_FL10_1_WARP;
typedef TestFixture<3, D3D11_FL10_0_WARP> ES3_D3D11_FL10_0_WARP;
typedef TestFixture<3, D3D11_REFERENCE> ES3_D3D11_REFERENCE;
typedef TestFixture<3, D3D11_FL11_1_REFERENCE> ES3_D3D11_FL11_1_REFERENCE;
typedef TestFixture<3, D3D11_FL11_0_REFERENCE> ES3_D3D11_FL11_0_REFERENCE;
typedef TestFixture<3, D3D11_FL10_1_REFERENCE> ES3_D3D11_FL10_1_REFERENCE;
typedef TestFixture<3, D3D11_FL10_0_REFERENCE> ES3_D3D11_FL10_0_REFERENCE;
typedef TestFixture<3, OPENGL> ES3_OPENGL;
typedef TestFixture<3, OPENGLES> ES3_OPENGLES;
#define ANGLE_TYPED_TEST_CASE(testName, ...) \
typedef ::testing::Types<__VA_ARGS__> Helper##testName; \
TYPED_TEST_CASE(testName, Helper##testName);
#endif // UTIL_TEST_FIXTURE_TYPES_H
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
'random_utils.h', 'random_utils.h',
'shader_utils.cpp', 'shader_utils.cpp',
'shader_utils.h', 'shader_utils.h',
'testfixturetypes.h',
'EGLWindow.cpp', 'EGLWindow.cpp',
'EGLWindow.h', 'EGLWindow.h',
'Event.h', 'Event.h',
......
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