~ubuntu-branches/ubuntu/oneiric/poppler/oneiric-security

« back to all changes in this revision

Viewing changes to qt4/tests/check_strings.cpp

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2011-02-08 16:00:17 UTC
  • mfrom: (1.5.4)
  • Revision ID: package-import@ubuntu.com-20110208160017-w4sgfa0vqj9bd3n6
Tags: 0.16.2-0ubuntu1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2010, Pino Toscano <pino@kde.org>
 
2
 * Copyright (C) 2010, 2011, Pino Toscano <pino@kde.org>
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU General Public License as published by
21
21
#include <poppler-qt4.h>
22
22
#include <poppler-private.h>
23
23
 
 
24
#include <GlobalParams.h>
 
25
 
24
26
Q_DECLARE_METATYPE(GooString*)
25
27
Q_DECLARE_METATYPE(Unicode*)
26
28
 
51
53
{
52
54
    qRegisterMetaType<GooString*>("GooString*");
53
55
    qRegisterMetaType<Unicode*>("Unicode*");
 
56
 
 
57
    globalParams = new GlobalParams();
54
58
}
55
59
 
56
60
void TestStrings::cleanupTestCase()
57
61
{
58
62
    qDeleteAll(m_gooStrings);
 
63
 
 
64
    delete globalParams;
59
65
}
60
66
 
61
67
void TestStrings::check_unicodeToQString_data()
90
96
    u[1] = 0x0161;
91
97
    QTest::newRow("a\u0161") << u << l << QString::fromUtf8("a\u0161");
92
98
    }
 
99
    {
 
100
    const int l = 2;
 
101
    Unicode *u = new Unicode[l];
 
102
    u[0] = 0x5c01;
 
103
    u[1] = 0x9762;
 
104
    QTest::newRow("\xe5\xb0\x81\xe9\x9d\xa2") << u << l << QString::fromUtf8("\xe5\xb0\x81\xe9\x9d\xa2");
 
105
    }
 
106
    {
 
107
    const int l = 3;
 
108
    Unicode *u = new Unicode[l];
 
109
    u[0] = 0x5c01;
 
110
    u[1] = 0x9762;
 
111
    u[2] = 0x0;
 
112
    QTest::newRow("\xe5\xb0\x81\xe9\x9d\xa2 + 0") << u << l << QString::fromUtf8("\xe5\xb0\x81\xe9\x9d\xa2");
 
113
    }
93
114
}
94
115
 
95
116
void TestStrings::check_unicodeToQString()