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

« back to all changes in this revision

Viewing changes to tests/test_search_input_controller.cc

  • 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:
17
17
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
18
// Boston, MA 02111-1307, USA.
19
19
 
20
 
#ifdef HAVE_GTK
21
 
 
22
20
#include <generic/apt/matching/compare_patterns.h>
23
21
#include <generic/apt/matching/pattern.h>
24
 
#include <gtk/controllers/search_input.h>
25
 
#include <gtk/views/mocks/search_input.h>
 
22
#include <generic/controllers/search_input.h>
 
23
#include <generic/views/mocks/search_input.h>
26
24
 
27
25
#include <boost/make_shared.hpp>
28
26
#include <boost/test/unit_test.hpp>
30
28
#include <gmock/gmock.h>
31
29
#include <gtest/gtest.h>
32
30
 
33
 
namespace ctrls = gui::controllers;
34
 
namespace views = gui::views;
35
 
namespace mocks = gui::views::mocks;
 
31
namespace ctrls = aptitude::controllers;
 
32
namespace views = aptitude::views;
 
33
namespace mocks = aptitude::views::mocks;
36
34
 
37
35
using aptitude::matching::compare_patterns;
38
36
using aptitude::matching::pattern;
60
58
  class controller_callbacks
61
59
  {
62
60
  public:
63
 
    MOCK_METHOD2(activated, void(Glib::ustring, cwidget::util::ref_ptr<aptitude::matching::pattern>));
 
61
    MOCK_METHOD2(activated, void(std::wstring, cwidget::util::ref_ptr<aptitude::matching::pattern>));
64
62
  };
65
63
 
66
64
  struct SearchInputTest
126
124
BOOST_FIXTURE_TEST_CASE(testEnteringCorrectTextSearches, SearchInputTest)
127
125
{
128
126
  ref_ptr<pattern> p = pattern::make_installed();
129
 
  Glib::ustring p_text = "?installed";
 
127
  std::wstring p_text = L"?installed";
130
128
 
131
129
  // The controller isn't required to call set_error_message(), but it
132
130
  // should set it to "" if it does.
133
 
  EXPECT_CALL(*view, set_error_message(Glib::ustring())).Times(AnyNumber());
 
131
  EXPECT_CALL(*view, set_error_message(std::wstring())).Times(AnyNumber());
134
132
 
135
133
  Expectation set_search_text;
136
134
  {
148
146
 
149
147
  get_controller()->enter_text(p_text);
150
148
}
151
 
 
152
 
#endif // HAVE_GTK