diff options
author | Cosmic Linden <cosmic@lindenlab.com> | 2023-02-14 15:44:02 -0800 |
---|---|---|
committer | Cosmic Linden <cosmic@lindenlab.com> | 2023-02-15 09:42:35 -0800 |
commit | d1531eb2cec851e663e1bdde2e2858a939a6cb81 (patch) | |
tree | 6bdda7972b912c4bc2b58f9ce78088e1f7d2d8a4 /indra/llprimitive/tests/llgltfmaterial_test.cpp | |
parent | df440f3f33a277f927035d051bc98341227bbea5 (diff) |
SL-19121: Add additional test at request of review
Diffstat (limited to 'indra/llprimitive/tests/llgltfmaterial_test.cpp')
-rw-r--r-- | indra/llprimitive/tests/llgltfmaterial_test.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/llprimitive/tests/llgltfmaterial_test.cpp b/indra/llprimitive/tests/llgltfmaterial_test.cpp index b3f56788f7..88b6fae3a7 100644 --- a/indra/llprimitive/tests/llgltfmaterial_test.cpp +++ b/indra/llprimitive/tests/llgltfmaterial_test.cpp @@ -339,4 +339,31 @@ namespace tut } } } + + // Test non-persistence of default value flags in overrides + template<> template<> + void llgltfmaterial_object_t::test<11>() + { + const S32 non_default_alpha_modes[] = { LLGLTFMaterial::ALPHA_MODE_BLEND, LLGLTFMaterial::ALPHA_MODE_MASK }; + for (S32 non_default_alpha_mode : non_default_alpha_modes) + { + LLGLTFMaterial material; + // Set default alpha mode + material.setAlphaMode(LLGLTFMaterial::ALPHA_MODE_OPAQUE, true); + ensure_equals("LLGLTFMaterial: alpha mode override flag set", material.mOverrideAlphaMode, true); + // Set non-default alpha mode + material.setAlphaMode(non_default_alpha_mode, true); + ensure_equals("LLGLTFMaterial: alpha mode override flag unset", material.mOverrideAlphaMode, false); + } + + { + // Set default double sided + LLGLTFMaterial material; + material.setDoubleSided(false, true); + ensure_equals("LLGLTFMaterial: double sided override flag set", material.mOverrideDoubleSided, true); + // Set non-default double sided + material.setDoubleSided(true, true); + ensure_equals("LLGLTFMaterial: double sided override flag unset", material.mOverrideDoubleSided, false); + } + } } |