~ps-jenkins/ubuntu-download-manager/latestsnapshot-0.2+13.10.20131104-0ubuntu1

« back to all changes in this revision

Viewing changes to ubuntu-download-manager-tests/base_testcase.cpp

  • Committer: Tarmac
  • Author(s): Manuel de la Pena
  • Date: 2013-09-27 21:48:08 UTC
  • mfrom: (105.6.5 remove-tests-qdebug)
  • Revision ID: tarmac-20130927214808-43v60wqrjhgxmua8
Add BaseTestCase that removes the qDebug output so that we have a cleaner tests results output. Fixes: https://bugs.launchpad.net/bugs/1230210.

Approved by Mike McCracken, Rodney Dawes, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2013 Canonical Ltd.
 
3
 *
 
4
 * This library is free software; you can redistribute it and/or
 
5
 * modify it under the terms of version 3 of the GNU Lesser General Public
 
6
 * License as published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
 * General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public
 
14
 * License along with this library; if not, write to the
 
15
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
16
 * Boston, MA 02110-1301, USA.
 
17
 */
 
18
 
 
19
#include <QtGlobal>
 
20
#include "./base_testcase.h"
 
21
 
 
22
void
 
23
noMessageOutput(QtMsgType type,
 
24
                const QMessageLogContext& context,
 
25
                const QString &message) {
 
26
    Q_UNUSED(type);
 
27
    Q_UNUSED(context);
 
28
    Q_UNUSED(message);
 
29
    // do nothing
 
30
}
 
31
 
 
32
BaseTestCase::BaseTestCase(QObject *parent)
 
33
    : QObject(parent) {
 
34
}
 
35
 
 
36
void
 
37
BaseTestCase::init() {
 
38
    qInstallMessageHandler(noMessageOutput);
 
39
}