//==========================================================================// // Testcases // TEST_F( UniqueGCFactoryBaseTest, number_constructor ) { ContextFactory *contextFactory = new ContextFactory(10); contextFactory->produce("/"); contextFactory->produce("ab/c"); ASSERT_EQ( 2, contextFactory->size()); delete contextFactory; }
TEST_F( UniqueGCFactoryBaseTest, unique_produce2 ) { ContextFactory *contextFactory = new ContextFactory(10); LDContext* context1 = contextFactory->produce("abc/def"); contextFactory->produce("ab/c"); ASSERT_EQ( 2, contextFactory->size()); LDContext* context2 = contextFactory->produce("ttt/../abc/def"); ASSERT_EQ( context1, context2 ); delete contextFactory; }
TEST_F( UniqueGCFactoryBaseTest, unique_produce ) { ContextFactory *contextFactory = new ContextFactory(10); LDContext* context1 = contextFactory->produce("/"); contextFactory->produce("ab/c"); ASSERT_TRUE( 2 == contextFactory->size()); LDContext* context2 = contextFactory->produce("/"); ASSERT_EQ( context1, context2 ); delete contextFactory; }
FboRenderContext::FboRenderContext (const ContextFactory& factory, const RenderConfig& config, const tcu::CommandLine& cmdLine) : m_context (DE_NULL) , m_framebuffer (0) , m_colorBuffer (0) , m_depthStencilBuffer (0) , m_renderTarget () { try { RenderConfig nativeRenderConfig; nativeRenderConfig.type = config.type; nativeRenderConfig.windowVisibility = config.windowVisibility; // \note All other properties are defaults, mostly DONT_CARE m_context = factory.createContext(nativeRenderConfig, cmdLine, DE_NULL); createFramebuffer(config); } catch (...) { delete m_context; throw; } }