~ubuntu-branches/ubuntu/precise/aptitude/precise-proposed

« back to all changes in this revision

Viewing changes to .pc/download-big-files.patch/src/generic/views/mocks/download_progress.h

  • Committer: Package Import Robot
  • Author(s): Marcin Juszkiewicz
  • Date: 2012-09-10 14:22:56 UTC
  • Revision ID: package-import@ubuntu.com-20120910142256-23x8q2opcpybkukv
Tags: 0.6.6-1ubuntu1.1
* Apply cherry-picked patches from upstream:
  - fix changelog fetching. LP: #824708
  - avoid dpkg and infinite loop in download-only mode. LP: #975793

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** \file download_progress.h */    // -*-c++-*-
 
2
 
 
3
// Copyright (C) 2010 Daniel Burrows
 
4
//
 
5
// This program is free software; you can redistribute it and/or
 
6
// modify it under the terms of the GNU General Public License as
 
7
// published by the Free Software Foundation; either version 2 of the
 
8
// License, or (at your option) any later version.
 
9
//
 
10
// This program is distributed in the hope that it will be useful, but
 
11
// WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
// General Public License for more details.
 
14
//
 
15
// You should have received a copy of the GNU General Public License
 
16
// along with this program; see the file COPYING.  If not, write to
 
17
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
18
// Boston, MA 02111-1307, USA.
 
19
 
 
20
#ifndef APTITUDE_GENERIC_VIEWS_MOCKS_DOWNLOAD_PROGRESS_H
 
21
#define APTITUDE_GENERIC_VIEWS_MOCKS_DOWNLOAD_PROGRESS_H
 
22
 
 
23
// Local includes:
 
24
#include <generic/util/mocks/mock_util.h>
 
25
#include <generic/views/download_progress.h>
 
26
 
 
27
// System includes:
 
28
#include <boost/make_shared.hpp>
 
29
 
 
30
#include <gmock/gmock.h>
 
31
 
 
32
namespace aptitude
 
33
{
 
34
  namespace views
 
35
  {
 
36
    namespace mocks
 
37
    {
 
38
      class download_progress : public aptitude::views::download_progress,
 
39
                                public aptitude::util::mocks::Mock<download_progress>
 
40
      {
 
41
        download_progress();
 
42
        friend boost::shared_ptr<download_progress> boost::make_shared<download_progress>();
 
43
        MOCK_FRIENDS();
 
44
 
 
45
      public:
 
46
        MOCK_METHOD1(update_progress, bool(const status &));
 
47
        MOCK_METHOD3(file_started, void(const std::string &,
 
48
                                        const boost::optional<unsigned long> &,
 
49
                                        const boost::optional<unsigned long> &));
 
50
        MOCK_METHOD4(error, void(bool,
 
51
                                 const std::string &,
 
52
                                 const std::string &,
 
53
                                 const boost::optional<unsigned long> &));
 
54
        MOCK_METHOD2(file_finished, void(const std::string &,
 
55
                                         const boost::optional<unsigned long> &));
 
56
        MOCK_METHOD3(done, void(double, unsigned long, double));
 
57
        MOCK_METHOD3(media_change, void(const std::string &,
 
58
                                        const std::string &,
 
59
                                        const sigc::slot1<void, bool> &));
 
60
      };
 
61
    }
 
62
  }
 
63
}
 
64
 
 
65
#endif // APTITUDE_GENERIC_VIEWS_MOCKS_DOWNLOAD_PROGRESS_H