~ubuntu-branches/ubuntu/oneiric/psi/oneiric

« back to all changes in this revision

Viewing changes to iris/src/xmpp/base64/unittest/base64test.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2009-09-25 17:49:51 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090925174951-lvm7kdap82o8xhn3
Tags: 0.13-1
* Updated to upstream version 0.13
* Set Standards-Version to 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2008  <Your Name>
 
3
 * See COPYING for license details.
 
4
 */
 
5
 
 
6
#include <QObject>
 
7
#include <QtTest/QtTest>
 
8
 
 
9
#include "qttestutil/qttestutil.h"
 
10
#include "xmpp/base64/base64.h"
 
11
 
 
12
using namespace XMPP;
 
13
 
 
14
class Base64Test : public QObject
 
15
{
 
16
     Q_OBJECT
 
17
        
 
18
        private slots:
 
19
                void testEncode() {
 
20
                        QString result = Base64::encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890");
 
21
                        QCOMPARE(result, QString("QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejEyMzQ1Njc4OTA="));
 
22
                }
 
23
 
 
24
                void testDecode() {
 
25
                        QString result = Base64::decode("QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejEyMzQ1Njc4OTA=");
 
26
                        QCOMPARE(result, QString("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"));
 
27
                }
 
28
};
 
29
 
 
30
QTTESTUTIL_REGISTER_TEST(Base64Test);
 
31
#include "base64test.moc"