os/graphics/fbs/fontandbitmapserver/tfbs/tfbsglyphdatapanic.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/fbs/fontandbitmapserver/tfbs/tfbsglyphdatapanic.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,470 @@
     1.4 +// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @internalComponent - Internal Symbian test code
    1.22 +*/
    1.23 +
    1.24 +#include <test/graphicsfontutils.h>
    1.25 +#include <graphics/fbsglyphmetricsarray.h> 
    1.26 +#include <graphics/fbsglyphdataiterator.h>
    1.27 +#include "tfbsglyphdatapanic.h"
    1.28 +
    1.29 +_LIT(KTypefaceName, "DejaVu Sans Condensed");
    1.30 +const TInt KNumGlyphCodes = 96;
    1.31 +
    1.32 +CTFbsGlyphDataPanic::CTFbsGlyphDataPanic(CTestStep* aStep):
    1.33 +    CTGraphicsBase(aStep)
    1.34 +    {
    1.35 +    }
    1.36 +
    1.37 +CTFbsGlyphDataPanic::~CTFbsGlyphDataPanic()
    1.38 +    {
    1.39 +    iSgDriver.Close();
    1.40 +    if (iTs)
    1.41 +         {
    1.42 +         iTs->ReleaseFont(iFont);
    1.43 +         delete iTs;
    1.44 +         }
    1.45 +    }
    1.46 +
    1.47 +void CTFbsGlyphDataPanic::ConstructL()
    1.48 +    {
    1.49 +    User::LeaveIfNull(iFbs = RFbsSession::GetSession());
    1.50 +    User::LeaveIfNull(iTs = (CFbsTypefaceStore*)CFbsTypefaceStore::NewL(NULL));
    1.51 +    User::LeaveIfError(iTs->GetNearestFontToDesignHeightInPixels((CFont*&)iFont, TFontSpec(KTypefaceName, 15)));
    1.52 +    User::LeaveIfError(iSgDriver.Open());
    1.53 +    
    1.54 +    //initialize the array with ASCII characters from 0020 to 007F
    1.55 +    CCharCodeConverter* converter = CCharCodeConverter::NewLC();
    1.56 +    converter->UseFontL(iFont);
    1.57 +    iGlyphCodes = new(ELeave) TUint[KNumGlyphCodes];
    1.58 +    for (TInt i = 0; i < KNumGlyphCodes; ++i)
    1.59 +        {
    1.60 +        TUint asciiCode = i + 0x20; 
    1.61 +        iGlyphCodes[i] = converter->GlyphCodeL(asciiCode);
    1.62 +        }
    1.63 +    CleanupStack::PopAndDestroy(1); // converter
    1.64 +    }
    1.65 +
    1.66 +void CTFbsGlyphDataPanic::RunTestCaseL(TInt /*aCurTestCase*/)
    1.67 +    {
    1.68 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
    1.69 +    TInt testCase = -1;
    1.70 +    _LIT(KCaseNumber, "CaseNumber");
    1.71 +    TEST(iStep->GetIntFromConfig(iStep->ConfigSection(), KCaseNumber, testCase));
    1.72 +    
    1.73 +    switch(testCase)
    1.74 +        {
    1.75 +    case 1:
    1.76 +        TestGlyphDataIteratorNotInitializedNext();
    1.77 +        break;
    1.78 +    case 2:
    1.79 +        TestGlyphDataIteratorNotInitializedImage();
    1.80 +        break;
    1.81 +    case 3:
    1.82 +        TestGlyphDataIteratorNotInitializedMetrics();
    1.83 +        break;
    1.84 +    case 4:
    1.85 +        TestGlyphDataIteratorNotInitializedGlyphCode();
    1.86 +        break;
    1.87 +    case 5:
    1.88 +        TestGlyphDataIteratorClosedNext();
    1.89 +        break;
    1.90 +    case 6:
    1.91 +        TestGlyphDataIteratorClosedImage();
    1.92 +        break;
    1.93 +    case 7:
    1.94 +        TestGlyphDataIteratorClosedMetrics();
    1.95 +        break;
    1.96 +    case 8:
    1.97 +        TestGlyphDataIteratorClosedGlyphCode();
    1.98 +        break;
    1.99 +    case 9:
   1.100 +        TestGlyphDataIteratorDiscardUsedFont();
   1.101 +        break;
   1.102 +    case 10:
   1.103 +        TestGlyphMetricsArrayIndexNegative();
   1.104 +        break;
   1.105 +    case 11:
   1.106 +    	TestGlyphMetricsArrayIndexTooHigh();
   1.107 +        break;
   1.108 +    case 12:
   1.109 +    	TestGlyphDataIteratorOpenFailed();
   1.110 +    	break;
   1.111 +    default:
   1.112 +        break;
   1.113 +        }
   1.114 +    TEST(EFalse); // shouldn't reach this point as the test will panic at the end of each test case function
   1.115 +    
   1.116 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
   1.117 +    ((CTFbsGlyphDataPanicStep*)iStep)->CloseTMSGraphicsStep();
   1.118 +    TestComplete();     
   1.119 +    ((CTFbsGlyphDataPanicStep*)iStep)->RecordTestResultL();
   1.120 +    }
   1.121 +
   1.122 +/**
   1.123 +@SYMTestCaseID      GRAPHICS-FBSERV-0651
   1.124 +@SYMTestPriority    High
   1.125 +@SYMTestType        UT
   1.126 +@SYMTestStatus      Implemented
   1.127 +@SYMPREQ            PREQ2678
   1.128 +
   1.129 +@SYMTestCaseDesc
   1.130 +	To ensure that calling Next() on an unopened iterator will panic.
   1.131 +
   1.132 +@SYMTestActions
   1.133 +	Call Next() on an RFbsGlyphDataIterator instance without opening it.
   1.134 +
   1.135 +@SYMTestExpectedResults
   1.136 +	The call to Next() should panic with FBSCLI 31.
   1.137 +*/
   1.138 +void CTFbsGlyphDataPanic::TestGlyphDataIteratorNotInitializedNext()
   1.139 +    {
   1.140 +    INFO_PRINTF1(_L("Ensure that Next() operation applied on null iterator will panic"));
   1.141 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0651"));
   1.142 +    RFbsGlyphDataIterator iter;
   1.143 +    iter.Next(); //expect to panic here
   1.144 +    }
   1.145 +
   1.146 +/**
   1.147 +@SYMTestCaseID      GRAPHICS-FBSERV-0652
   1.148 +@SYMTestPriority    High
   1.149 +@SYMTestType        UT
   1.150 +@SYMTestStatus      Implemented
   1.151 +@SYMPREQ            PREQ2678
   1.152 +
   1.153 +@SYMTestCaseDesc
   1.154 +	To ensure that Image() function applied on an unopened iterator will panic.
   1.155 +
   1.156 +@SYMTestActions
   1.157 +	Call Image() on an RFbsGlyphDataIterator instance without opening it.
   1.158 +
   1.159 +@SYMTestExpectedResults
   1.160 +	The call to Image() should panic with FBSCLI 31.
   1.161 +*/
   1.162 +void CTFbsGlyphDataPanic::TestGlyphDataIteratorNotInitializedImage()
   1.163 +    {
   1.164 +    INFO_PRINTF1(_L("Ensure that Image() operation applied on null iterator will panic"));
   1.165 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0652"));
   1.166 +    RFbsGlyphDataIterator iter;
   1.167 +    iter.Image(); //expect to panic here
   1.168 +    }
   1.169 +
   1.170 +/**
   1.171 +@SYMTestCaseID      GRAPHICS-FBSERV-0653
   1.172 +@SYMTestPriority    High
   1.173 +@SYMTestType        UT
   1.174 +@SYMTestStatus      Implemented
   1.175 +@SYMPREQ            PREQ2678
   1.176 +
   1.177 +@SYMTestCaseDesc
   1.178 +	To ensure that Metrics() function applied on null iterator will panic.
   1.179 +
   1.180 +@SYMTestActions
   1.181 +	Call Metrics() on an RFbsGlyphDataIterator instance without opening it.
   1.182 +
   1.183 +@SYMTestExpectedResults
   1.184 +	The call to Metrics() should panic with FBSCLI 31.
   1.185 +*/
   1.186 +void CTFbsGlyphDataPanic::TestGlyphDataIteratorNotInitializedMetrics()
   1.187 +    {
   1.188 +    INFO_PRINTF1(_L("Ensure that Metrics() operation applied on null iterator will panic"));
   1.189 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0653"));
   1.190 +    RFbsGlyphDataIterator iter;
   1.191 +    iter.Metrics(); //expect to panic here
   1.192 +    }
   1.193 +
   1.194 +/**
   1.195 +@SYMTestCaseID      GRAPHICS-FBSERV-0654
   1.196 +@SYMTestPriority    High
   1.197 +@SYMTestType        UT
   1.198 +@SYMTestStatus      Implemented
   1.199 +@SYMPREQ            PREQ2678
   1.200 +
   1.201 +@SYMTestCaseDesc
   1.202 +	To ensure that calling GlyphCode() on an unopened iterator will panic.
   1.203 +
   1.204 +@SYMTestActions
   1.205 +	Call GlyphCode() on an RFbsGlyphDataIterator instance without opening it.
   1.206 +
   1.207 +@SYMTestExpectedResults
   1.208 +	The call to GlyphCode() should panic with FBSCLI 31.
   1.209 +*/
   1.210 +void CTFbsGlyphDataPanic::TestGlyphDataIteratorNotInitializedGlyphCode()
   1.211 +    {
   1.212 +    INFO_PRINTF1(_L("Ensure that GlyphCode() operation applied on null iterator will panic"));
   1.213 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0654"));
   1.214 +    RFbsGlyphDataIterator iter;
   1.215 +    iter.GlyphCode(); //expect to panic here
   1.216 +    }
   1.217 +
   1.218 +/**
   1.219 +@SYMTestCaseID      GRAPHICS-FBSERV-0655
   1.220 +@SYMTestPriority    High
   1.221 +@SYMTestType        UT
   1.222 +@SYMTestStatus      Implemented
   1.223 +@SYMPREQ            PREQ2678
   1.224 +
   1.225 +@SYMTestCaseDesc
   1.226 +	To ensure that calling Next() on an iterator which has been closed will panic.
   1.227 +
   1.228 +@SYMTestActions
   1.229 +	i. Open the glyph data iterator with 1 glyph code.
   1.230 +	ii. Call Next() to attempt to move the iterator past the end of the array of glyph codes.
   1.231 +	iii. Call Close() and repeat ii.
   1.232 +
   1.233 +@SYMTestExpectedResults
   1.234 +	The call to Next() should fail with KErrNotFound, signifying the iterator is still open.
   1.235 +	The final call to Next() should panic with FBSCLI 31.
   1.236 +*/
   1.237 +void CTFbsGlyphDataPanic::TestGlyphDataIteratorClosedNext()
   1.238 +    {
   1.239 +    INFO_PRINTF1(_L("Ensure that Next() operation applied on iterator which has been closed will panic"));
   1.240 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0655"));
   1.241 +    RFbsGlyphDataIterator iter;
   1.242 +    TESTNOERROR(iter.Open(*iFont, iGlyphCodes, 1));
   1.243 +    TInt iterErr = iter.Next();
   1.244 +    TESTE(iterErr == KErrNotFound, iterErr);
   1.245 +    iter.Close();
   1.246 +    iter.Next(); //expect to panic here
   1.247 +    }
   1.248 +
   1.249 +/**
   1.250 +@SYMTestCaseID      GRAPHICS-FBSERV-0656
   1.251 +@SYMTestPriority    High
   1.252 +@SYMTestType        UT
   1.253 +@SYMTestStatus      Implemented
   1.254 +@SYMPREQ            PREQ2678
   1.255 +
   1.256 +@SYMTestCaseDesc
   1.257 +	To ensure that calling Image() on an iterator which has been closed will panic.
   1.258 +
   1.259 +@SYMTestActions
   1.260 +	i. Open the glyph data iterator.
   1.261 +	ii. Close the glyph data iterator.
   1.262 +	iii. Call Image() on an RFbsGlyphDataIterator instance which has been closed.
   1.263 +
   1.264 +@SYMTestExpectedResults
   1.265 +	The call to Image() should panic with FBSCLI 31.
   1.266 +*/
   1.267 +void CTFbsGlyphDataPanic::TestGlyphDataIteratorClosedImage()
   1.268 +    {
   1.269 +    INFO_PRINTF1(_L("Ensure that Image() operation applied on iterator which has been closed will panic"));
   1.270 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0656"));
   1.271 +    RFbsGlyphDataIterator iter;
   1.272 +    OpenAndCloseIterator(iter);
   1.273 +    iter.Image(); //expect to panic here
   1.274 +    }
   1.275 +
   1.276 +/**
   1.277 +@SYMTestCaseID      GRAPHICS-FBSERV-0657
   1.278 +@SYMTestPriority    High
   1.279 +@SYMTestType        UT
   1.280 +@SYMTestStatus      Implemented
   1.281 +@SYMPREQ            PREQ2678
   1.282 +
   1.283 +@SYMTestCaseDesc
   1.284 +	To ensure that calling Metrics() on an iterator which has been closed will panic.
   1.285 +
   1.286 +@SYMTestActions
   1.287 +	i. Open the glyph data iterator.
   1.288 +	ii. Close the glyph data iterator.
   1.289 +	iii. Call Metrics() on an RFbsGlyphDataIterator instance which has been closed.
   1.290 +
   1.291 +@SYMTestExpectedResults
   1.292 +	The call to Metrics() should panic with FBSCLI 31.
   1.293 +*/
   1.294 +void CTFbsGlyphDataPanic::TestGlyphDataIteratorClosedMetrics()
   1.295 +    {
   1.296 +    INFO_PRINTF1(_L("Ensure that Metrics()operation applied on iterator which has been closed will panic"));
   1.297 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0657"));
   1.298 +    RFbsGlyphDataIterator iter;
   1.299 +    OpenAndCloseIterator(iter);
   1.300 +    iter.Metrics(); //expect to panic here
   1.301 +    }
   1.302 +
   1.303 +/**
   1.304 +@SYMTestCaseID      GRAPHICS-FBSERV-0658
   1.305 +@SYMTestPriority    High
   1.306 +@SYMTestType        UT
   1.307 +@SYMTestStatus      In development
   1.308 +@SYMPREQ            PREQ2678
   1.309 +
   1.310 +@SYMTestCaseDesc
   1.311 +	To ensure that calling GlyphCode() on an iterator which has been closed will panic.
   1.312 +
   1.313 +@SYMTestActions
   1.314 +	i. Open the glyph data iterator.
   1.315 +	ii. Close the glyph data iterator.
   1.316 +	iii. Call GlyphCode() on an RFbsGlyphDataIterator instance which has been closed.
   1.317 +
   1.318 +@SYMTestExpectedResults
   1.319 +	The call to GlyphCode() should panic with FBSCLI 31.
   1.320 +*/
   1.321 +void CTFbsGlyphDataPanic::TestGlyphDataIteratorClosedGlyphCode()
   1.322 +    {
   1.323 +    INFO_PRINTF1(_L("Ensure that GlyphCode() operation applied on iterator which has been closed will panic"));
   1.324 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0658"));
   1.325 +    RFbsGlyphDataIterator iter;
   1.326 +    OpenAndCloseIterator(iter);
   1.327 +    iter.GlyphCode(); //expect to panic here
   1.328 +    }
   1.329 +
   1.330 +// the function opens and then closes an iterator
   1.331 +void CTFbsGlyphDataPanic::OpenAndCloseIterator(RFbsGlyphDataIterator& aIterator) 
   1.332 +    {
   1.333 +    TESTNOERROR(aIterator.Open(*iFont, iGlyphCodes, 1));
   1.334 +    aIterator.Close();
   1.335 +    }
   1.336 +
   1.337 +/**
   1.338 +@SYMTestCaseID      GRAPHICS-FBSERV-0647
   1.339 +@SYMTestPriority    High
   1.340 +@SYMTestType        UT
   1.341 +@SYMTestStatus      Implemented
   1.342 +@SYMPREQ            PREQ2678
   1.343 +
   1.344 +@SYMTestCaseDesc
   1.345 +	To ensure that attempting to use an invalid Font handle will cause a panic when iterating through an RFbsGlyphDataIterator. 
   1.346 +
   1.347 +@SYMTestActions
   1.348 +	i. Open the glyph data iterator.
   1.349 +	ii. Release the font associated with the iterator.
   1.350 +	iii. Attempt to use invalid Font handle by iterating through the iterator.
   1.351 +
   1.352 +@SYMTestExpectedResults
   1.353 +	The call to Next() after the associated Font has been released should cause panic FBSERV -8 when the invalid Font handle is passed to FBServ.
   1.354 +*/
   1.355 +void CTFbsGlyphDataPanic::TestGlyphDataIteratorDiscardUsedFont()
   1.356 +    {
   1.357 +    INFO_PRINTF1(_L("Ensure that attempting to use an invalid Font handle will cause a panic when iterating through an RFbsGlyphDataIterator"));
   1.358 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0647"));
   1.359 +    
   1.360 +    RFbsGlyphDataIterator iter;
   1.361 +    TESTNOERROR(iter.Open(*iFont, iGlyphCodes, KNumGlyphCodes));
   1.362 +    iTs->ReleaseFont(iFont);
   1.363 +    
   1.364 +    for (TInt i = 0; i < KNumGlyphCodes; i++)
   1.365 +        {
   1.366 +        //should panic when attempt is made to use invalid Font handle
   1.367 +        iter.Next();
   1.368 +        }
   1.369 +
   1.370 +    iter.Close(); //shouldn't reach this line. If for some reason the code doesn't panic test should fail.
   1.371 +    TEST(EFalse);  
   1.372 +    }
   1.373 +    
   1.374 +
   1.375 +/**
   1.376 +@SYMTestCaseID      GRAPHICS-FBSERV-0648
   1.377 +@SYMTestPriority    High
   1.378 +@SYMTestType        UT
   1.379 +@SYMTestStatus      Implemented
   1.380 +@SYMPREQ            PREQ2678
   1.381 +
   1.382 +@SYMTestCaseDesc
   1.383 +	To ensure that accessing the glyph metrics entry with negative index will cause a panic.
   1.384 +
   1.385 +@SYMTestActions
   1.386 +	i. Retrieve glyph metrics array.
   1.387 +	ii. Try to access glyph metrics entry with a negative index.
   1.388 +
   1.389 +@SYMTestExpectedResults
   1.390 +	Should panic with FBSCLI 32.
   1.391 +*/
   1.392 +void CTFbsGlyphDataPanic::TestGlyphMetricsArrayIndexNegative()
   1.393 +    {
   1.394 +    INFO_PRINTF1(_L("Ensure that accessing the glyph metrics entry with negative index will cause a panic"));
   1.395 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0648"));
   1.396 +    RFbsGlyphMetricsArray glyphMetricsArray;
   1.397 +
   1.398 +    // Retrieve list of metrics
   1.399 +    TESTNOERROR(glyphMetricsArray.Get(*iFont, iGlyphCodes, 2));
   1.400 +    TEST(2 == glyphMetricsArray.Count());
   1.401 +    glyphMetricsArray[-1];
   1.402 +    }
   1.403 +
   1.404 +/**
   1.405 +@SYMTestCaseID      GRAPHICS-FBSERV-0649
   1.406 +@SYMTestPriority    High
   1.407 +@SYMTestType        UT
   1.408 +@SYMTestStatus      Implemented
   1.409 +@SYMPREQ            PREQ2678
   1.410 +
   1.411 +@SYMTestCaseDesc
   1.412 +	To ensure that accessing the glyph metrics entry with an index greater than number
   1.413 +	of elements in array will cause a panic.
   1.414 +
   1.415 +@SYMTestActions
   1.416 +	i. Retrieve a glyph metrics array with total number of elements equals 2 
   1.417 +	ii. Try to access glyph metrics entry with index equals 2.
   1.418 +
   1.419 +@SYMTestExpectedResults
   1.420 +	Should panic with FBSCLI 32.
   1.421 +*/
   1.422 +void CTFbsGlyphDataPanic::TestGlyphMetricsArrayIndexTooHigh()
   1.423 +    {
   1.424 +    INFO_PRINTF1(_L("Ensure that accessing the glyph metrics entry with index greater than number of elemnets in array will cause a panic"));
   1.425 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0649"));
   1.426 +    RFbsGlyphMetricsArray glyphMetricsArray;
   1.427 +
   1.428 +    // Retrieve list of metrics
   1.429 +    TESTNOERROR(glyphMetricsArray.Get(*iFont, iGlyphCodes, 2));
   1.430 +    TEST(2 == glyphMetricsArray.Count());
   1.431 +    glyphMetricsArray[2]; //expect to panic here as index varies 0..1
   1.432 +    }
   1.433 +
   1.434 +/**
   1.435 +@SYMTestCaseID      GRAPHICS-FBSERV-0667
   1.436 +@SYMTestPriority    High
   1.437 +@SYMTestType        UT
   1.438 +@SYMTestStatus      Implemented
   1.439 +@SYMPREQ            PREQ2678
   1.440 +
   1.441 +@SYMTestCaseDesc
   1.442 +	To ensure that if RFbsGlyphDataIterator::Open() fails, it is still in the closed state
   1.443 +	and cannot be used.
   1.444 +
   1.445 +@SYMTestActions
   1.446 +	i. Open an RFbsGlyphDataIterator on a font.  
   1.447 +	ii. Attempt to open a second RFbsGlyphDataIterator on the same font.
   1.448 +	ii. Attempt to use the properties of the iterator.
   1.449 +
   1.450 +@SYMTestExpectedResults
   1.451 +	The call to GlyphCode() should panic with FBSCLI 31 since the iterator should be in a closed state.
   1.452 +*/
   1.453 +void CTFbsGlyphDataPanic::TestGlyphDataIteratorOpenFailed()
   1.454 +	{
   1.455 +    INFO_PRINTF1(_L("Ensure that if RFbsGlyphDataIterator::Open() fails, it is still in the closed state and cannot be used"));
   1.456 +    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0667"));
   1.457 +   
   1.458 +    CFbsFont* bitmapFont = NULL;
   1.459 +    TInt err = iTs->GetNearestFontToDesignHeightInPixels((CFont*&)bitmapFont, TFontSpec(_L("Digital"), 14));
   1.460 +    TESTNOERROR(err);
   1.461 +    TEST(!bitmapFont->IsOpenFont());
   1.462 +    
   1.463 +    RFbsGlyphDataIterator iter;
   1.464 +    err = iter.Open(*bitmapFont, iGlyphCodes, 2);
   1.465 +    TEST(err == KErrNotSupported);
   1.466 +        
   1.467 +    iter.GlyphCode(); // Should panic here as iter should be closed.
   1.468 +    TEST(EFalse);     //shouldn't reach this line. If for some reason the code doesn't panic test should fail.
   1.469 +    
   1.470 +	}
   1.471 +//--------------
   1.472 +__CONSTRUCT_STEP__(FbsGlyphDataPanic)
   1.473 +