@@ -8657,6 +8657,10 @@ active_views: []
86578657 OCIO_CHECK_EQUAL (2 , cfg->getNumViews (OCIO::VIEW_DISPLAY_DEFINED, displayName.c_str ()));
86588658 OCIO_CHECK_EQUAL (1 , cfg->getNumViews (OCIO::VIEW_SHARED, displayName.c_str ()));
86598659
8660+ // The new display is marked as temporary.
8661+ OCIO_CHECK_ASSERT (!cfg->isDisplayTemporary (config->getNumDisplays () - 1 ));
8662+ OCIO_CHECK_ASSERT (cfg->isDisplayTemporary (config->getNumDisplays ()));
8663+
86608664 // Check the created display color space.
86618665
86628666 OCIO::ConstColorSpaceRcPtr cs = cfg->getColorSpace (displayName.c_str ());
@@ -8707,6 +8711,33 @@ active_views: []
87078711 OCIO_CHECK_EQUAL (cfg->getNumColorSpaces () - 1 , config2->getNumColorSpaces ());
87088712 }
87098713
8714+ // Check that the display may be marked as non-temporary and therefore serialized in a config.
8715+
8716+ {
8717+ OCIO_CHECK_ASSERT (cfg->isDisplayTemporary (config->getNumDisplays ()));
8718+ cfg->setDisplayTemporary (config->getNumDisplays (), false );
8719+ OCIO_CHECK_ASSERT (!cfg->isDisplayTemporary (config->getNumDisplays ()));
8720+
8721+ std::ostringstream oss2;
8722+ OCIO_CHECK_NO_THROW (oss2 << *cfg.get ());
8723+
8724+ std::istringstream iss2;
8725+ iss2.str (oss2.str ());
8726+
8727+ OCIO::ConstConfigRcPtr config2;
8728+ OCIO_CHECK_NO_THROW (config2 = OCIO::Config::CreateFromStream (iss2));
8729+
8730+ // Check that (display, view) pair created by the virtual display instantiation is present.
8731+
8732+ OCIO_CHECK_EQUAL (config->getNumDisplays () + 1 , config2->getNumDisplays ());
8733+ OCIO_CHECK_EQUAL (cfg->getNumDisplays (), config2->getNumDisplays ());
8734+
8735+ // And the display color space is also present.
8736+
8737+ OCIO_CHECK_EQUAL (config->getNumColorSpaces () + 1 , config2->getNumColorSpaces ());
8738+ OCIO_CHECK_EQUAL (cfg->getNumColorSpaces (), config2->getNumColorSpaces ());
8739+ }
8740+
87108741 // Step 4 - 2 - Create a (display, view) using a custom ICC profile.
87118742
87128743 cfg = config->createEditableCopy (); // Reset the instance to the original content.
0 commit comments