os/graphics/egl/eglrefimpl/test/src/egltest_reference.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @test
sl@0
    19
 */
sl@0
    20
sl@0
    21
#include "egltest_reference.h"
sl@0
    22
sl@0
    23
/**
sl@0
    24
@SYMTestCaseID GRAPHICS-EGL-REF-0001
sl@0
    25
sl@0
    26
@SYMPREQ 2400
sl@0
    27
sl@0
    28
@SYMTestPriority 1
sl@0
    29
sl@0
    30
@SYMTestCaseDesc
sl@0
    31
Test eglQueryString returns the expected string for Reference EGL
sl@0
    32
sl@0
    33
@SYMTestActions
sl@0
    34
Get default display
sl@0
    35
	Check the return value is not EGL_NO_DISPLAY and error code is EGL_SUCCESS
sl@0
    36
Initialise display
sl@0
    37
	Check return value is true, error code is EGL_SUCCESS and version is updated
sl@0
    38
Query string for version
sl@0
    39
	Check return value is “1.4 Reference EGL” and error code is EGL_SUCCESS
sl@0
    40
Query string for vendor
sl@0
    41
	Check return value is “Nokia” and error code is EGL_SUCCESS
sl@0
    42
Query string for client APIs
sl@0
    43
	Check return value is “” and error code is EGL_SUCCESS
sl@0
    44
Query string for extensions
sl@0
    45
	Check return value is “EGL_KHR_reusable_sync EGL_NOK__private__signal_sync” and error code is EGL_SUCCESS
sl@0
    46
Terminate display
sl@0
    47
	Check return value is true and error code is EGL_SUCCESS
sl@0
    48
Release thread
sl@0
    49
	Check return value is true
sl@0
    50
sl@0
    51
@SYMTestExpectedResults
sl@0
    52
Non-null pointer is returned and all strings contain the expected value
sl@0
    53
*/
sl@0
    54
TVerdict CEglTest_QueryString::doTestStepL()
sl@0
    55
    {
sl@0
    56
    SetTestStepID(_L("GRAPHICS-EGL-REF-0001"));
sl@0
    57
    INFO_PRINTF1(_L("CEglTest_QueryString::doTestStepL"));
sl@0
    58
sl@0
    59
    INFO_PRINTF1(_L("Create display object"));
sl@0
    60
    GetDisplayL();
sl@0
    61
    TEST(eglGetError() == EGL_SUCCESS);
sl@0
    62
   
sl@0
    63
    // Initialize display object
sl@0
    64
    EGLint major = -1, minor = -1;
sl@0
    65
    INFO_PRINTF1(_L("Calling eglInitialize"));
sl@0
    66
    TEST_EGL_ERROR(eglInitialize(iDisplay, &major, &minor), EGL_SUCCESS);
sl@0
    67
    TEST(major == 1 && minor == 4);   // Version is updated
sl@0
    68
    
sl@0
    69
    // Query string for version
sl@0
    70
    const char* strEglVersion = eglQueryString(iDisplay, EGL_VERSION);    
sl@0
    71
    TPtrC8 ptrEglVersion(reinterpret_cast<const TUint8*>(strEglVersion));
sl@0
    72
    TEST_EGL_ERROR(ptrEglVersion.Compare(_L8("1.4 Reference EGL")) == 0, EGL_SUCCESS);
sl@0
    73
    
sl@0
    74
    // Query string for vendor
sl@0
    75
    const char* strEglVendor = eglQueryString(iDisplay, EGL_VENDOR);
sl@0
    76
    TPtrC8 ptrEglVendor(reinterpret_cast<const TUint8*>(strEglVendor));
sl@0
    77
    TEST_EGL_ERROR(ptrEglVendor.Compare(_L8("Nokia")) == 0, EGL_SUCCESS);
sl@0
    78
    
sl@0
    79
    // Query string for client APIs
sl@0
    80
    const char* strEglClinentAPI = eglQueryString(iDisplay, EGL_CLIENT_APIS);
sl@0
    81
    TPtrC8 ptrEglClinentAPI(reinterpret_cast<const TUint8*>(strEglClinentAPI));
sl@0
    82
    TEST_EGL_ERROR(ptrEglClinentAPI.Compare(_L8("")) == 0, EGL_SUCCESS);
sl@0
    83
    
sl@0
    84
    // Query string for extensions
sl@0
    85
    const char* strEglExtensions = eglQueryString(iDisplay, EGL_EXTENSIONS);
sl@0
    86
    TPtrC8 ptrEglExtensions(reinterpret_cast<const TUint8*>(strEglExtensions));
sl@0
    87
    TEST_EGL_ERROR(ptrEglExtensions.Compare(_L8("EGL_KHR_reusable_sync EGL_NOK__private__signal_sync")) == 0, EGL_SUCCESS);
sl@0
    88
 
sl@0
    89
    // Terminate display object
sl@0
    90
    INFO_PRINTF1(_L("Terminate display"));
sl@0
    91
    TerminateDisplayL();
sl@0
    92
    TEST(eglGetError() == EGL_SUCCESS);
sl@0
    93
    
sl@0
    94
    TEST_EGL_ERROR(eglReleaseThread() == EGL_TRUE, EGL_SUCCESS);
sl@0
    95
    RecordTestResultL();
sl@0
    96
    CloseTMSGraphicsStep();
sl@0
    97
    return TestStepResult();
sl@0
    98
    }
sl@0
    99