fbs/fontandbitmapserver/tfbs/tfbsglyphdatapanic.h
author hgs
Fri, 30 Jul 2010 11:41:40 +0300
changeset 136 62bb7c97884c
parent 121 d72fc2aace31
permissions -rw-r--r--
201030_2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
121
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     1
// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     2
// All rights reserved.
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     3
// This component and the accompanying materials are made available
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     5
// which accompanies this distribution, and is available
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     7
//
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     8
// Initial Contributors:
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    10
//
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    11
// Contributors:
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    12
//
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    13
// Description:
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    14
//
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    15
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    16
#ifndef TFBSGLYPHDATAPANIC_H
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    17
#define TFBSGLYPHDATAPANIC_H
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    18
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    19
#include <sgresource/sgresource.h>
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    20
#include "test/TGraphicsHarness.h"
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    21
class RFbsGlyphDataIterator;
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    22
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    23
/**
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    24
Test class which exercises all panics for the glyph data extensions 
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    25
RFbsGlyphDataIterator and RFbsGlyphMetricsArray. 
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    26
Negative tests
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    27
*/
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    28
class CTFbsGlyphDataPanic : public CTGraphicsBase
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    29
    {
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    30
public:
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    31
    CTFbsGlyphDataPanic(CTestStep* aStep);
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    32
    ~CTFbsGlyphDataPanic();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    33
protected:
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    34
//from  CTGraphicsBase
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    35
    virtual void RunTestCaseL(TInt aCurTestCase);
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    36
    void ConstructL();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    37
    
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    38
//test cases
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    39
    void TestGlyphDataIteratorNotInitializedNext();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    40
    void TestGlyphDataIteratorNotInitializedImage();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    41
    void TestGlyphDataIteratorNotInitializedMetrics();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    42
    void TestGlyphDataIteratorNotInitializedGlyphCode();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    43
    void TestGlyphDataIteratorClosedNext();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    44
    void TestGlyphDataIteratorClosedImage();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    45
    void TestGlyphDataIteratorClosedMetrics();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    46
    void TestGlyphDataIteratorClosedGlyphCode();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    47
    void TestGlyphDataIteratorDiscardUsedFont();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    48
    void TestGlyphMetricsArrayIndexNegative();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    49
    void TestGlyphMetricsArrayIndexTooHigh();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    50
    void TestGlyphDataIteratorOpenFailed();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    51
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    52
    //helper function
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    53
    void OpenAndCloseIterator(RFbsGlyphDataIterator& aIterator); // the function opens and then closes an iterator
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    54
private:
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    55
    RFbsSession* iFbs;
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    56
    CFbsTypefaceStore* iTs;
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    57
    CFbsFont* iFont;
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    58
    RSgDriver iSgDriver;
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    59
    TUint* iGlyphCodes;
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    60
   };
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    61
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    62
class CTFbsGlyphDataPanicStep : public CTGraphicsStep
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    63
    {
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    64
public:
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    65
    CTFbsGlyphDataPanicStep();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    66
protected:  
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    67
    //from CTGraphicsStep
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    68
    virtual CTGraphicsBase* CreateTestL();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    69
    };
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    70
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    71
_LIT(KTFbsGlyphDataPanicStep,"TFbsGlyphDataPanic");
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    72
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    73
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    74
#endif /* TFBSGLYPHDATAPANIC_H */