From cfc03c44eeea3713518c81b15a169495c5c668ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9drik=20Fuoco?= Date: Tue, 16 May 2023 16:31:24 -0400 Subject: [PATCH 1/2] Fixing a warning in one of the python unit test Removing expected info log in some python unit test Removing expected info log about inactive colorspace in Cpp unit test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cédrik Fuoco --- tests/cpu/Config_tests.cpp | 6 +++++- tests/python/ConfigTest.py | 8 ++++++-- tests/python/UnitTestUtils.py | 5 +++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/cpu/Config_tests.cpp b/tests/cpu/Config_tests.cpp index eb42a7201b..fb1f9ea1c0 100644 --- a/tests/cpu/Config_tests.cpp +++ b/tests/cpu/Config_tests.cpp @@ -5670,8 +5670,12 @@ OCIO_ADD_TEST(Config, inactive_colorspaces) config = OCIO::Config::CreateFromBuiltinConfig(cgConfigName.c_str()) ); OCIO_REQUIRE_ASSERT(config); - + + OCIO::LogGuard logGuard; OCIO_CHECK_NO_THROW(config->validate()); + // Mute expected logs about inactive colorspaces. + OCIO::muteInactiveColorspaceInfo(logGuard); + logGuard.print(); { // Test various combinations of input. diff --git a/tests/python/ConfigTest.py b/tests/python/ConfigTest.py index ebc170c3df..b7fa93aa91 100644 --- a/tests/python/ConfigTest.py +++ b/tests/python/ConfigTest.py @@ -1212,7 +1212,9 @@ def lutExists(filepath): def test_inactive_colorspaces(self): config = OCIO.Config.CreateFromBuiltinConfig("cg-config-v1.0.0_aces-v1.3_ocio-v2.1") - config.validate() + log = MuteLogging() + with log: + config.validate() # Test various combinations of input. @@ -1229,7 +1231,9 @@ def test_inactive_colorspaces(self): def test_roles(self): config = OCIO.Config.CreateFromBuiltinConfig("cg-config-v1.0.0_aces-v1.3_ocio-v2.1") - config.validate() + log = MuteLogging() + with log: + config.validate() # ***************************** # Test getRoleNames interface. diff --git a/tests/python/UnitTestUtils.py b/tests/python/UnitTestUtils.py index 1b83c1cb92..dd41586547 100644 --- a/tests/python/UnitTestUtils.py +++ b/tests/python/UnitTestUtils.py @@ -180,6 +180,11 @@ def __exit__(self, exc_type, exc_val, exc_tb): - ! name: c3 categories: [sample] + + - ! + name: c4 + encoding: log + categories: [sample] """ SAMPLE_CONFIG = """ocio_profile_version: 2 From f47ad9dc92a28d5c5b01dd1666abc38b5d2121c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9drik=20Fuoco?= Date: Thu, 18 May 2023 08:45:50 -0400 Subject: [PATCH 2/2] Using sudio config instead of cg config where it makes sense renaming unit test inactive_colospace to is_inactive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cédrik Fuoco --- tests/cpu/Config_tests.cpp | 9 ++------- tests/python/ConfigTest.py | 12 ++++-------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/tests/cpu/Config_tests.cpp b/tests/cpu/Config_tests.cpp index fb1f9ea1c0..50c929b50a 100644 --- a/tests/cpu/Config_tests.cpp +++ b/tests/cpu/Config_tests.cpp @@ -5660,22 +5660,17 @@ OCIO_ADD_TEST(Config, inactive_color_space) OCIO::COLORSPACE_ALL, 1)); } -OCIO_ADD_TEST(Config, inactive_colorspaces) +OCIO_ADD_TEST(Config, is_inactive) { // Using Built-in config to test the getInactiveColorSpace method. - const std::string cgConfigName = "cg-config-v1.0.0_aces-v1.3_ocio-v2.1"; + const std::string cgConfigName = "studio-config-v1.0.0_aces-v1.3_ocio-v2.1"; OCIO::ConstConfigRcPtr config; OCIO_CHECK_NO_THROW( config = OCIO::Config::CreateFromBuiltinConfig(cgConfigName.c_str()) ); OCIO_REQUIRE_ASSERT(config); - - OCIO::LogGuard logGuard; OCIO_CHECK_NO_THROW(config->validate()); - // Mute expected logs about inactive colorspaces. - OCIO::muteInactiveColorspaceInfo(logGuard); - logGuard.print(); { // Test various combinations of input. diff --git a/tests/python/ConfigTest.py b/tests/python/ConfigTest.py index b7fa93aa91..941cb88237 100644 --- a/tests/python/ConfigTest.py +++ b/tests/python/ConfigTest.py @@ -1211,10 +1211,8 @@ def lutExists(filepath): def test_inactive_colorspaces(self): - config = OCIO.Config.CreateFromBuiltinConfig("cg-config-v1.0.0_aces-v1.3_ocio-v2.1") - log = MuteLogging() - with log: - config.validate() + config = OCIO.Config.CreateFromBuiltinConfig("studio-config-v1.0.0_aces-v1.3_ocio-v2.1") + config.validate() # Test various combinations of input. @@ -1230,10 +1228,8 @@ def test_inactive_colorspaces(self): self.assertTrue(config.isInactiveColorSpace("Rec.1886 Rec.2020 - Display")) def test_roles(self): - config = OCIO.Config.CreateFromBuiltinConfig("cg-config-v1.0.0_aces-v1.3_ocio-v2.1") - log = MuteLogging() - with log: - config.validate() + config = OCIO.Config.CreateFromBuiltinConfig("studio-config-v1.0.0_aces-v1.3_ocio-v2.1") + config.validate() # ***************************** # Test getRoleNames interface.