From cc3b496aa8b79f6b5743298dec979797a4262fd8 Mon Sep 17 00:00:00 2001 From: lilike-adsk <134404162+lilike-adsk@users.noreply.github.com> Date: Thu, 3 Oct 2024 09:40:06 -0400 Subject: [PATCH] HYDRA-1207 - fix and re-enable case testSceneBrowser (#182) * adjust test code in sceneBrowser to make the case happy on SdfPathVector value * fix the build failure on old USD version for Maya 2025 * update the comment --- .../test/adskHydraSceneBrowserTestFixture.cpp | 14 ++++++++++++++ test/lib/mayaUsd/render/mayaToHydra/CMakeLists.txt | 3 +-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/adskHydraSceneBrowser/test/adskHydraSceneBrowserTestFixture.cpp b/lib/adskHydraSceneBrowser/test/adskHydraSceneBrowserTestFixture.cpp index 0e9e93c24f..f36b93ad9b 100644 --- a/lib/adskHydraSceneBrowser/test/adskHydraSceneBrowserTestFixture.cpp +++ b/lib/adskHydraSceneBrowser/test/adskHydraSceneBrowserTestFixture.cpp @@ -257,7 +257,21 @@ void AdskHydraSceneBrowserTestFixture::CompareValueContent(const pxr::VtValue& v std::string actualValue = valueText.toStdString(); std::ostringstream valueStream; +#if PXR_VERSION < 2408 valueStream << value; +#else + if (value.IsHolding()) { + // Special case for SdfPathVector. + // See https://github.com/PixarAnimationStudios/OpenUSD/commit/1d19b1d + pxr::SdfPathVector paths = value.Get(); + for (pxr::SdfPath const& path : paths) { + valueStream << path << "\n"; + } + } + else { + valueStream << value; + } +#endif std::string expectedValue = valueStream.str(); if (!MatchesFallbackTextOutput(expectedValue)) { diff --git a/test/lib/mayaUsd/render/mayaToHydra/CMakeLists.txt b/test/lib/mayaUsd/render/mayaToHydra/CMakeLists.txt index af7ac68d7a..6775756cce 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/CMakeLists.txt +++ b/test/lib/mayaUsd/render/mayaToHydra/CMakeLists.txt @@ -94,8 +94,7 @@ endif(MayaUsd_FOUND) # Code coverage is not computed for the Hydra scene browser. if (NOT CODE_COVERAGE) - # To be reenabled after investigation: HYDRA-1207 - #list(APPEND INTERACTIVE_TEST_SCRIPT_FILES testSceneBrowser.py) + list(APPEND INTERACTIVE_TEST_SCRIPT_FILES testSceneBrowser.py) endif() # Interactive Unit test scripts for mesh adapter (launched with maya.exe instead of mayapy.exe)