blob: 98fc452d198f86917a65dc04629e5f0cd89ee42a [file] [log] [blame]
Lingfeng Yang0e6868f2020-11-03 12:32:59 -08001// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#include "GLSnapshotTesting.h"
16
17#include <gtest/gtest.h>
18
Jason Macnaked0c9e62023-03-30 15:58:24 -070019namespace gfxstream {
20namespace gl {
21namespace {
Lingfeng Yang0e6868f2020-11-03 12:32:59 -080022
23class SnapshotGlUnpackAlignmentTest
24 : public SnapshotSetValueTest<GLuint>,
25 public ::testing::WithParamInterface<GLuint> {
26 void stateCheck(GLuint expected) override {
27 EXPECT_TRUE(compareGlobalGlInt(gl, GL_UNPACK_ALIGNMENT, expected));
28 }
29 void stateChange() override {
30 gl->glPixelStorei(GL_UNPACK_ALIGNMENT, *m_changed_value);
31 }
32};
33
34TEST_P(SnapshotGlUnpackAlignmentTest, SetUnpackAlign) {
35 setExpectedValues(4, GetParam());
36 doCheckedSnapshot();
37}
38
Kaiyi Li1f6758c2021-02-07 10:26:13 -080039INSTANTIATE_TEST_SUITE_P(GLES2SnapshotPixels,
40 SnapshotGlUnpackAlignmentTest,
41 ::testing::Values(1, 2, 4, 8));
Lingfeng Yang0e6868f2020-11-03 12:32:59 -080042
43class SnapshotGlPackAlignmentTest
44 : public SnapshotSetValueTest<GLuint>,
45 public ::testing::WithParamInterface<GLuint> {
46 void stateCheck(GLuint expected) override {
47 EXPECT_TRUE(compareGlobalGlInt(gl, GL_PACK_ALIGNMENT, expected));
48 }
49 void stateChange() override {
50 gl->glPixelStorei(GL_PACK_ALIGNMENT, *m_changed_value);
51 }
52};
53
54TEST_P(SnapshotGlPackAlignmentTest, SetPackAlign) {
55 setExpectedValues(4, GetParam());
56 doCheckedSnapshot();
57}
58
Kaiyi Li1f6758c2021-02-07 10:26:13 -080059INSTANTIATE_TEST_SUITE_P(GLES2SnapshotPixels,
60 SnapshotGlPackAlignmentTest,
61 ::testing::Values(1, 2, 4, 8));
Lingfeng Yang0e6868f2020-11-03 12:32:59 -080062
Jason Macnaked0c9e62023-03-30 15:58:24 -070063} // namespace
64} // namespace gl
65} // namespace gfxstream