Update contrib.
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #include "egltest_reference.h"
24 @SYMTestCaseID GRAPHICS-EGL-REF-0001
31 Test eglQueryString returns the expected string for Reference EGL
35 Check the return value is not EGL_NO_DISPLAY and error code is EGL_SUCCESS
37 Check return value is true, error code is EGL_SUCCESS and version is updated
38 Query string for version
39 Check return value is “1.4 Reference EGL” and error code is EGL_SUCCESS
40 Query string for vendor
41 Check return value is “Nokia” and error code is EGL_SUCCESS
42 Query string for client APIs
43 Check return value is “” and error code is EGL_SUCCESS
44 Query string for extensions
45 Check return value is “EGL_KHR_reusable_sync EGL_NOK__private__signal_sync” and error code is EGL_SUCCESS
47 Check return value is true and error code is EGL_SUCCESS
49 Check return value is true
51 @SYMTestExpectedResults
52 Non-null pointer is returned and all strings contain the expected value
54 TVerdict CEglTest_QueryString::doTestStepL()
56 SetTestStepID(_L("GRAPHICS-EGL-REF-0001"));
57 INFO_PRINTF1(_L("CEglTest_QueryString::doTestStepL"));
59 INFO_PRINTF1(_L("Create display object"));
61 TEST(eglGetError() == EGL_SUCCESS);
63 // Initialize display object
64 EGLint major = -1, minor = -1;
65 INFO_PRINTF1(_L("Calling eglInitialize"));
66 TEST_EGL_ERROR(eglInitialize(iDisplay, &major, &minor), EGL_SUCCESS);
67 TEST(major == 1 && minor == 4); // Version is updated
69 // Query string for version
70 const char* strEglVersion = eglQueryString(iDisplay, EGL_VERSION);
71 TPtrC8 ptrEglVersion(reinterpret_cast<const TUint8*>(strEglVersion));
72 TEST_EGL_ERROR(ptrEglVersion.Compare(_L8("1.4 Reference EGL")) == 0, EGL_SUCCESS);
74 // Query string for vendor
75 const char* strEglVendor = eglQueryString(iDisplay, EGL_VENDOR);
76 TPtrC8 ptrEglVendor(reinterpret_cast<const TUint8*>(strEglVendor));
77 TEST_EGL_ERROR(ptrEglVendor.Compare(_L8("Nokia")) == 0, EGL_SUCCESS);
79 // Query string for client APIs
80 const char* strEglClinentAPI = eglQueryString(iDisplay, EGL_CLIENT_APIS);
81 TPtrC8 ptrEglClinentAPI(reinterpret_cast<const TUint8*>(strEglClinentAPI));
82 TEST_EGL_ERROR(ptrEglClinentAPI.Compare(_L8("")) == 0, EGL_SUCCESS);
84 // Query string for extensions
85 const char* strEglExtensions = eglQueryString(iDisplay, EGL_EXTENSIONS);
86 TPtrC8 ptrEglExtensions(reinterpret_cast<const TUint8*>(strEglExtensions));
87 TEST_EGL_ERROR(ptrEglExtensions.Compare(_L8("EGL_KHR_reusable_sync EGL_NOK__private__signal_sync")) == 0, EGL_SUCCESS);
89 // Terminate display object
90 INFO_PRINTF1(_L("Terminate display"));
92 TEST(eglGetError() == EGL_SUCCESS);
94 TEST_EGL_ERROR(eglReleaseThread() == EGL_TRUE, EGL_SUCCESS);
96 CloseTMSGraphicsStep();
97 return TestStepResult();