Path: blob/main_old/src/tests/compiler_tests/ConstructCompiler_test.cpp
1693 views
//1// Copyright 2016 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4//5// ConstructCompiler_test.cpp6// Test the sh::ConstructCompiler interface with different parameters.7//89#include "GLSLANG/ShaderLang.h"10#include "angle_gl.h"11#include "gtest/gtest.h"1213// Test default parameters.14TEST(ConstructCompilerTest, DefaultParameters)15{16ShBuiltInResources resources;17sh::InitBuiltInResources(&resources);18ShHandle compiler = sh::ConstructCompiler(GL_FRAGMENT_SHADER, SH_WEBGL_SPEC,19SH_GLSL_COMPATIBILITY_OUTPUT, &resources);20ASSERT_NE(nullptr, compiler);21}2223// Test invalid MaxDrawBuffers zero.24TEST(ConstructCompilerTest, InvalidMaxDrawBuffers)25{26ShBuiltInResources resources;27sh::InitBuiltInResources(&resources);28resources.MaxDrawBuffers = 0;29ShHandle compiler = sh::ConstructCompiler(GL_FRAGMENT_SHADER, SH_WEBGL_SPEC,30SH_GLSL_COMPATIBILITY_OUTPUT, &resources);31ASSERT_EQ(nullptr, compiler);32}3334// Test invalid MaxDualSourceDrawBuffers zero.35TEST(ConstructCompilerTest, InvalidMaxDualSourceDrawBuffers)36{37ShBuiltInResources resources;38sh::InitBuiltInResources(&resources);39resources.EXT_blend_func_extended = 1;40resources.MaxDualSourceDrawBuffers = 0;41ShHandle compiler = sh::ConstructCompiler(GL_FRAGMENT_SHADER, SH_WEBGL_SPEC,42SH_GLSL_COMPATIBILITY_OUTPUT, &resources);43ASSERT_EQ(nullptr, compiler);44}454647