Hash :
89e38b57
Author :
Date :
2022-06-22T15:04:08
Refactor to use ANGLETest vs ANGLETestWithParam Bug: angleproject:6747 Change-Id: I72ad52d0268eae0e1a401f12f3e94cc5efa402f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3719002 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
//
// Copyright 2020 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.
//
// PrimtestTests.cpp:
// GLES1 conformance primtest tests.
//
#include "GLES/gl.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
#ifdef __cplusplus
extern "C" {
#endif
// ES 1.0
extern void DrawPrims(void);
#include "primtest/driver.h"
#include "primtest/tproto.h"
#ifdef __cplusplus
}
#endif
namespace angle
{
class GLES1PrimtestTest : public ANGLETest<>
{
protected:
GLES1PrimtestTest()
{
setWindowWidth(48);
setWindowHeight(48);
setConfigRedBits(8);
setConfigGreenBits(8);
setConfigBlueBits(8);
setConfigAlphaBits(8);
setConfigDepthBits(24);
setConfigStencilBits(8);
}
void testTearDown() override
{
if (mTestData != nullptr)
{
free(mTestData);
}
}
void execTest(long test)
{
long i;
for (i = 0; driver[i].test != TEST_NULL; i++)
{
if (driver[i].test == test)
{
break;
}
}
ASSERT_NE(TEST_NULL, driver[i].test);
driverRec &op = driver[i];
op.funcInit((void *)&mTestData);
op.finish = 0;
ASSERT_GL_NO_ERROR();
for (;;)
{
op.funcStatus(1, mTestData);
ASSERT_GL_NO_ERROR();
op.funcSet(1, mTestData);
ASSERT_GL_NO_ERROR();
DrawPrims();
ASSERT_GL_NO_ERROR();
long finish = op.funcUpdate(mTestData);
ASSERT_GL_NO_ERROR();
if (finish)
{
break;
}
};
}
protected:
void *mTestData;
};
TEST_P(GLES1PrimtestTest, Hint)
{
execTest(TEST_HINT);
}
TEST_P(GLES1PrimtestTest, Alias)
{
execTest(TEST_ALIAS);
}
TEST_P(GLES1PrimtestTest, Alpha)
{
execTest(TEST_ALPHA);
}
TEST_P(GLES1PrimtestTest, Blend)
{
execTest(TEST_BLEND);
}
TEST_P(GLES1PrimtestTest, Depth)
{
execTest(TEST_DEPTH);
}
TEST_P(GLES1PrimtestTest, Dither)
{
execTest(TEST_DITHER);
}
TEST_P(GLES1PrimtestTest, Fog)
{
execTest(TEST_FOG);
}
TEST_P(GLES1PrimtestTest, Light)
{
execTest(TEST_LIGHT);
}
TEST_P(GLES1PrimtestTest, Logic)
{
execTest(TEST_LOGICOP);
}
TEST_P(GLES1PrimtestTest, Scissor)
{
execTest(TEST_SCISSOR);
}
TEST_P(GLES1PrimtestTest, Shade)
{
execTest(TEST_SHADE);
}
TEST_P(GLES1PrimtestTest, Stencil)
{
execTest(TEST_STENCIL);
}
TEST_P(GLES1PrimtestTest, Texture)
{
execTest(TEST_TEXTURE);
}
ANGLE_INSTANTIATE_TEST(GLES1PrimtestTest, ES1_OPENGL(), ES1_VULKAN());
} // namespace angle
// Included here to fix a compile error due to white box tests using angle_end2end_tests_main.
void RegisterContextCompatibilityTests() {}