sl@0: // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: */ sl@0: sl@0: #include "egltest_reference.h" sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-EGL-REF-0001 sl@0: sl@0: @SYMPREQ 2400 sl@0: sl@0: @SYMTestPriority 1 sl@0: sl@0: @SYMTestCaseDesc sl@0: Test eglQueryString returns the expected string for Reference EGL sl@0: sl@0: @SYMTestActions sl@0: Get default display sl@0: Check the return value is not EGL_NO_DISPLAY and error code is EGL_SUCCESS sl@0: Initialise display sl@0: Check return value is true, error code is EGL_SUCCESS and version is updated sl@0: Query string for version sl@0: Check return value is “1.4 Reference EGL” and error code is EGL_SUCCESS sl@0: Query string for vendor sl@0: Check return value is “Nokia” and error code is EGL_SUCCESS sl@0: Query string for client APIs sl@0: Check return value is “” and error code is EGL_SUCCESS sl@0: Query string for extensions sl@0: Check return value is “EGL_KHR_reusable_sync EGL_NOK__private__signal_sync” and error code is EGL_SUCCESS sl@0: Terminate display sl@0: Check return value is true and error code is EGL_SUCCESS sl@0: Release thread sl@0: Check return value is true sl@0: sl@0: @SYMTestExpectedResults sl@0: Non-null pointer is returned and all strings contain the expected value sl@0: */ sl@0: TVerdict CEglTest_QueryString::doTestStepL() sl@0: { sl@0: SetTestStepID(_L("GRAPHICS-EGL-REF-0001")); sl@0: INFO_PRINTF1(_L("CEglTest_QueryString::doTestStepL")); sl@0: sl@0: INFO_PRINTF1(_L("Create display object")); sl@0: GetDisplayL(); sl@0: TEST(eglGetError() == EGL_SUCCESS); sl@0: sl@0: // Initialize display object sl@0: EGLint major = -1, minor = -1; sl@0: INFO_PRINTF1(_L("Calling eglInitialize")); sl@0: TEST_EGL_ERROR(eglInitialize(iDisplay, &major, &minor), EGL_SUCCESS); sl@0: TEST(major == 1 && minor == 4); // Version is updated sl@0: sl@0: // Query string for version sl@0: const char* strEglVersion = eglQueryString(iDisplay, EGL_VERSION); sl@0: TPtrC8 ptrEglVersion(reinterpret_cast(strEglVersion)); sl@0: TEST_EGL_ERROR(ptrEglVersion.Compare(_L8("1.4 Reference EGL")) == 0, EGL_SUCCESS); sl@0: sl@0: // Query string for vendor sl@0: const char* strEglVendor = eglQueryString(iDisplay, EGL_VENDOR); sl@0: TPtrC8 ptrEglVendor(reinterpret_cast(strEglVendor)); sl@0: TEST_EGL_ERROR(ptrEglVendor.Compare(_L8("Nokia")) == 0, EGL_SUCCESS); sl@0: sl@0: // Query string for client APIs sl@0: const char* strEglClinentAPI = eglQueryString(iDisplay, EGL_CLIENT_APIS); sl@0: TPtrC8 ptrEglClinentAPI(reinterpret_cast(strEglClinentAPI)); sl@0: TEST_EGL_ERROR(ptrEglClinentAPI.Compare(_L8("")) == 0, EGL_SUCCESS); sl@0: sl@0: // Query string for extensions sl@0: const char* strEglExtensions = eglQueryString(iDisplay, EGL_EXTENSIONS); sl@0: TPtrC8 ptrEglExtensions(reinterpret_cast(strEglExtensions)); sl@0: TEST_EGL_ERROR(ptrEglExtensions.Compare(_L8("EGL_KHR_reusable_sync EGL_NOK__private__signal_sync")) == 0, EGL_SUCCESS); sl@0: sl@0: // Terminate display object sl@0: INFO_PRINTF1(_L("Terminate display")); sl@0: TerminateDisplayL(); sl@0: TEST(eglGetError() == EGL_SUCCESS); sl@0: sl@0: TEST_EGL_ERROR(eglReleaseThread() == EGL_TRUE, EGL_SUCCESS); sl@0: RecordTestResultL(); sl@0: CloseTMSGraphicsStep(); sl@0: return TestStepResult(); sl@0: } sl@0: