2
* Spandex benchmark and test framework.
4
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
6
* Contact: Kari J. Kangas <kari.j.kangas@nokia.com>
8
* This framework is free software; you can redistribute it and/or modify it
9
* under the terms of the GNU Lesser General Public License as published by the
10
* Free Software Foundation, version 2.1 of the License.
12
* This framework is distributed in the hope that it will be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
17
* You should have received a copy of the GNU Lesser General Public License
18
* along with this framework; if not, see <http://www.gnu.org/licenses/>.
22
#include "sct_openvgcheckextensionaction.h"
23
#include "sct_sicommon.h"
24
#include "sct_utils.h"
34
void* sctiCreateOpenVGCheckExtensionActionContext( void* moduleContext, SCTAttributeList* attributes )
36
SCTOpenVGCheckExtensionActionContext* context;
38
SCT_ASSERT_ALWAYS( moduleContext != NULL );
39
SCT_ASSERT_ALWAYS( attributes != NULL );
41
context = ( SCTOpenVGCheckExtensionActionContext* )( siCommonMemoryAlloc( NULL, sizeof( SCTOpenVGCheckExtensionActionContext ) ) );
44
SCT_LOG_ERROR( "Allocation failed in CheckExtension@OpenVG action context creation." );
47
memset( context, 0, sizeof( SCTOpenVGCheckExtensionActionContext ) );
49
if( sctiParseOpenVGCheckExtensionActionAttributes( &( context->data ), attributes ) == SCT_FALSE )
51
sctiDestroyOpenVGCheckExtensionActionContext( context );
62
void sctiDestroyOpenVGCheckExtensionActionContext( void* context )
68
siCommonMemoryFree( NULL, context );
75
SCTBoolean sctiOpenVGCheckExtensionActionExecute( SCTAction* action, int frameNumber )
77
SCTOpenVGCheckExtensionActionContext* context;
80
SCT_ASSERT_ALWAYS( action != NULL );
81
SCT_ASSERT_ALWAYS( action->context != NULL );
82
SCT_USE_VARIABLE( frameNumber );
84
context = ( SCTOpenVGCheckExtensionActionContext* )( action->context );
86
/* Get VG extension string. */
87
str = ( const char* )( vgGetString( VG_EXTENSIONS ) );
90
SCT_LOG_ERROR( "Getting extension string failed in CheckExtension@OpenVG action execute." );
94
if( strstr( str, context->data.extension ) == NULL )
97
sprintf( buf, "Extension %s not found in CheckExtension@OpenVG action execute.", context->data.extension );
110
void sctiOpenVGCheckExtensionActionDestroy( SCTAction* action )
112
SCTOpenVGCheckExtensionActionContext* context;
114
SCT_ASSERT_ALWAYS( action != NULL );
116
context = ( SCTOpenVGCheckExtensionActionContext* )( action->context );
118
action->context = NULL;
119
sctiDestroyOpenVGCheckExtensionActionContext( context );