~ubuntu-branches/ubuntu/vivid/aptitude/vivid

« back to all changes in this revision

Viewing changes to src/gtk/views/mocks/search_input.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2011-06-22 12:32:56 UTC
  • mfrom: (1.8.6 sid)
  • Revision ID: james.westby@ubuntu.com-20110622123256-8aox9w9ch3x72dci
Tags: 0.6.4-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/05aptitude: never autoremove kernels
  - drop aptitude-doc to Suggests
  - 03_branding.dpatch: ubuntu branding
  - 04_changelog.dpatch: take changelogs from changelogs.ubuntu.com
  - 09_ubuntu_fortify_source.dpatch: Suppress a number of warnings (turned
    into errors by -Werror) triggered by Ubuntu's default of
    -D_FORTIFY_SOURCE=2.
  - 11_ubuntu_uses_sudo.dpatch: fix status line of 'Become root' menu entry
    to not refer to su.
  - 12_point_manpage_to_doc_package.dpatch: point Finnish manpage to the
    correct place for further info
  - 14_html2text_preferred.dpatch: switch back to html2text in favor of
    elinks, since html2text is in main and elinks isn't.
* dropped 01_intltool_update.dpatch
* updated 15_ftbfs_new_apt

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/** \file search_input.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_GTK_VIEWS_MOCKS_SEARCH_INPUT_H
21
 
#define APTITUDE_GTK_VIEWS_MOCKS_SEARCH_INPUT_H
22
 
 
23
 
#include <gmock/gmock.h>
24
 
#include <gtk/views/search_input.h>
25
 
 
26
 
namespace gui
27
 
{
28
 
  namespace views
29
 
  {
30
 
    namespace mocks
31
 
    {
32
 
      /** \brief Mock implementation of search_input for use in unit
33
 
       *  tests.
34
 
       *
35
 
       *  Provides signals which, by default, are connected by the
36
 
       *  connect_() methods.
37
 
       */
38
 
      class search_input : public views::search_input
39
 
      {
40
 
      public:
41
 
        MOCK_METHOD0(get_search_text, Glib::ustring());
42
 
        MOCK_METHOD1(set_search_text, void(const Glib::ustring &));
43
 
        MOCK_METHOD1(set_error_message, void(const Glib::ustring &));
44
 
        MOCK_METHOD1(set_input_validity, void(bool));
45
 
        MOCK_METHOD1(set_find_sensitivity, void(bool));
46
 
        MOCK_METHOD1(connect_search_text_changed, sigc::connection(const sigc::slot<void> &));
47
 
        MOCK_METHOD1(connect_search, sigc::connection(const sigc::slot<void> &));
48
 
 
49
 
        sigc::signal<void> signal_search_text_changed;
50
 
        sigc::signal<void> signal;
51
 
 
52
 
        search_input()
53
 
        {
54
 
          using testing::_;
55
 
          using testing::Invoke;
56
 
 
57
 
          ON_CALL(*this, connect_search_text_changed(_))
58
 
            .WillByDefault(Invoke(&signal_search_text_changed,
59
 
                                  &sigc::signal<void>::connect));
60
 
 
61
 
          ON_CALL(*this, connect_search(_))
62
 
            .WillByDefault(Invoke(&signal,
63
 
                                  &sigc::signal<void>::connect));
64
 
        }
65
 
      };
66
 
    }
67
 
  }
68
 
}
69
 
 
70
 
#endif // APTITUDE_GTK_VIEWS_MOCKS_SEARCH_INPUT_H