summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cmdline/cmdline_progress_display.cc11
-rw-r--r--src/cmdline/cmdline_progress_display.h37
-rw-r--r--src/cmdline/cmdline_search.cc10
-rw-r--r--src/cmdline/cmdline_search_progress.cc11
-rw-r--r--src/cmdline/cmdline_search_progress.h10
-rw-r--r--src/cmdline/cmdline_versions.cc9
-rw-r--r--src/cmdline/text_progress.cc7
-rw-r--r--src/cmdline/text_progress.h8
-rw-r--r--src/generic/views/Makefile.am4
-rw-r--r--src/generic/views/SConscript2
-rw-r--r--src/generic/views/mocks/Makefile.am3
-rw-r--r--src/generic/views/mocks/progress.h (renamed from src/cmdline/mocks/cmdline_progress_display.h)14
-rw-r--r--src/generic/views/progress.cc31
-rw-r--r--src/generic/views/progress.h61
-rw-r--r--tests/SConscript1
-rw-r--r--tests/test_cmdline_progress_display.cc5
-rw-r--r--tests/test_cmdline_search_progress.cc47
17 files changed, 177 insertions, 94 deletions
diff --git a/src/cmdline/cmdline_progress_display.cc b/src/cmdline/cmdline_progress_display.cc
index 74abeb94..e4465972 100644
--- a/src/cmdline/cmdline_progress_display.cc
+++ b/src/cmdline/cmdline_progress_display.cc
@@ -30,6 +30,7 @@
#include <generic/apt/apt.h>
#include <generic/apt/config_signal.h>
#include <generic/util/progress_info.h>
+#include <generic/views/progress.h>
// System includes:
#include <boost/format.hpp>
@@ -57,7 +58,7 @@ namespace aptitude
// \todo This should be configurable.
const int progress_update_interval = 0.25;
- class progress_display_impl : public progress_display
+ class progress_display_impl : public views::progress
{
// Set to "true" when done() is called, and to "false" when
// any other method is called. Used to suppress calls to
@@ -181,11 +182,7 @@ namespace aptitude
}
}
- progress_display::~progress_display()
- {
- }
-
- shared_ptr<progress_display>
+ shared_ptr<views::progress>
create_progress_display(const shared_ptr<transient_message> &message,
bool old_style_percentage,
bool retain_completed)
@@ -195,7 +192,7 @@ namespace aptitude
retain_completed);
}
- shared_ptr<progress_display>
+ shared_ptr<views::progress>
create_progress_display(const shared_ptr<terminal> &term,
const shared_ptr<terminal_locale> &term_locale)
{
diff --git a/src/cmdline/cmdline_progress_display.h b/src/cmdline/cmdline_progress_display.h
index 74339af4..9ab4150a 100644
--- a/src/cmdline/cmdline_progress_display.h
+++ b/src/cmdline/cmdline_progress_display.h
@@ -25,9 +25,9 @@
namespace aptitude
{
- namespace util
+ namespace views
{
- class progress_info;
+ class progress;
}
namespace cmdline
@@ -36,35 +36,6 @@ namespace aptitude
class terminal_locale;
class transient_message;
- /** \brief A general class for displaying a single line of
- * progress information.
- *
- * The progress information is delivered as a progress_info
- * object. A blank progress_info causes the display to be
- * erased. A "pulse" mode progress_info displays a message with
- * no percent indicator. And a "bar" mode progress_info displays
- * a message with a percent indicator.
- */
- class progress_display
- {
- public:
- virtual ~progress_display();
-
- /** \brief Set the currently displayed progress.
- *
- * \param progress The new progress information to display.
- */
- virtual void set_progress(const aptitude::util::progress_info &progress) = 0;
-
- /** \brief Mark the currently displayed progress as done.
- *
- * Depending on the current configuration, this will either
- * blank the output line or display a "done" message and
- * advance to the next line.
- */
- virtual void done() = 0;
- };
-
/** \brief Create a blank progress display.
*
* \param message The message object used to display the progress
@@ -76,7 +47,7 @@ namespace aptitude
* \param retain_completed If \b true, completed messages will be
* retained instead of being deleted.
*/
- boost::shared_ptr<progress_display>
+ boost::shared_ptr<views::progress>
create_progress_display(const boost::shared_ptr<transient_message> &message,
bool old_style_percentage,
bool retain_completed);
@@ -86,7 +57,7 @@ namespace aptitude
* This is a convenience routine, equivalent to creating a new
* transient message with the given terminal objects.
*/
- boost::shared_ptr<progress_display>
+ boost::shared_ptr<views::progress>
create_progress_display(const boost::shared_ptr<terminal> &term,
const boost::shared_ptr<terminal_locale> &term_locale);
}
diff --git a/src/cmdline/cmdline_search.cc b/src/cmdline/cmdline_search.cc
index 530af04a..0104ae20 100644
--- a/src/cmdline/cmdline_search.cc
+++ b/src/cmdline/cmdline_search.cc
@@ -43,6 +43,7 @@
#include <generic/apt/matching/pattern.h>
#include <generic/apt/matching/serialize.h>
#include <generic/util/progress_info.h>
+#include <generic/views/progress.h>
#include <cwidget/config/column_definition.h>
#include <cwidget/generic/util/transcode.h>
@@ -62,12 +63,10 @@
using namespace std;
namespace cw = cwidget;
using aptitude::Loggers;
-using aptitude::cmdline::create_progress_display;
using aptitude::cmdline::create_progress_throttle;
using aptitude::cmdline::create_terminal;
using aptitude::cmdline::create_terminal_locale;
using aptitude::cmdline::make_text_progress;
-using aptitude::cmdline::progress_display;
using aptitude::cmdline::progress_throttle;
using aptitude::cmdline::terminal;
using aptitude::cmdline::terminal_locale;
@@ -76,6 +75,7 @@ using aptitude::util::progress_info;
using aptitude::util::progress_type_bar;
using aptitude::util::progress_type_none;
using aptitude::util::progress_type_pulse;
+using aptitude::views::progress;
using boost::format;
using boost::shared_ptr;
using cwidget::util::ref_ptr;
@@ -98,7 +98,7 @@ namespace
typedef std::vector<std::pair<pkgCache::PkgIterator, ref_ptr<structural_match> > >
results_list;
- const shared_ptr<progress_display> search_progress_display =
+ const shared_ptr<progress> search_progress_display =
create_progress_display(term, term_locale);
const shared_ptr<progress_throttle> search_progress_throttle =
create_progress_throttle();
@@ -108,7 +108,7 @@ namespace
for(std::vector<ref_ptr<pattern> >::const_iterator pIt = patterns.begin();
pIt != patterns.end(); ++pIt)
{
- const shared_ptr<progress_display> search_progress =
+ const shared_ptr<progress> search_progress =
create_search_progress(serialize_pattern(*pIt),
search_progress_display,
search_progress_throttle);
@@ -121,7 +121,7 @@ namespace
*apt_package_records,
debug,
sigc::mem_fun(*search_progress,
- &progress_display::set_progress));
+ &progress::set_progress));
}
search_progress_display->done();
diff --git a/src/cmdline/cmdline_search_progress.cc b/src/cmdline/cmdline_search_progress.cc
index d53b0b66..5f5eb3e6 100644
--- a/src/cmdline/cmdline_search_progress.cc
+++ b/src/cmdline/cmdline_search_progress.cc
@@ -25,6 +25,7 @@
#include "cmdline_progress_throttle.h"
#include <generic/util/progress_info.h>
+#include <generic/views/progress.h>
#include <boost/format.hpp>
@@ -47,14 +48,14 @@ namespace aptitude
{
namespace
{
- class search_progress : public progress_display
+ class search_progress : public views::progress
{
- shared_ptr<progress_display> display;
+ shared_ptr<views::progress> display;
shared_ptr<progress_throttle> throttle;
std::string pattern;
public:
- search_progress(const shared_ptr<progress_display> &_display,
+ search_progress(const shared_ptr<views::progress> &_display,
const shared_ptr<progress_throttle> &_throttle,
const std::string &_pattern)
: display(_display),
@@ -108,9 +109,9 @@ namespace aptitude
}
}
- shared_ptr<progress_display>
+ shared_ptr<views::progress>
create_search_progress(const std::string &pattern,
- const shared_ptr<progress_display> &display,
+ const shared_ptr<views::progress> &display,
const shared_ptr<progress_throttle> &throttle)
{
return make_shared<search_progress>(display,
diff --git a/src/cmdline/cmdline_search_progress.h b/src/cmdline/cmdline_search_progress.h
index 79c77bd6..9cf6ef96 100644
--- a/src/cmdline/cmdline_search_progress.h
+++ b/src/cmdline/cmdline_search_progress.h
@@ -24,9 +24,13 @@
namespace aptitude
{
+ namespace views
+ {
+ class progress;
+ }
+
namespace cmdline
{
- class progress_display;
class progress_throttle;
/** \brief Create a progress-display object specialized for
@@ -40,9 +44,9 @@ namespace aptitude
* \param throttle Used to determine when the new object should
* display messages.
*/
- boost::shared_ptr<progress_display>
+ boost::shared_ptr<views::progress>
create_search_progress(const std::string &pattern,
- const boost::shared_ptr<progress_display> &display,
+ const boost::shared_ptr<views::progress> &display,
const boost::shared_ptr<progress_throttle> &throttle);
}
}
diff --git a/src/cmdline/cmdline_versions.cc b/src/cmdline/cmdline_versions.cc
index 7c2f242b..38ff54b9 100644
--- a/src/cmdline/cmdline_versions.cc
+++ b/src/cmdline/cmdline_versions.cc
@@ -35,6 +35,7 @@
#include <generic/apt/matching/pattern.h>
#include <generic/apt/matching/serialize.h>
#include <generic/util/progress_info.h>
+#include <generic/views/progress.h>
// System includes:
@@ -61,7 +62,6 @@ using aptitude::cmdline::create_terminal;
using aptitude::cmdline::create_terminal_locale;
using aptitude::cmdline::lessthan_1st;
using aptitude::cmdline::package_results_lt;
-using aptitude::cmdline::progress_display;
using aptitude::cmdline::progress_throttle;
using aptitude::cmdline::search_result_column_parameters;
using aptitude::cmdline::terminal;
@@ -70,6 +70,7 @@ using aptitude::cmdline::version_results_eq;
using aptitude::cmdline::version_results_lt;
using aptitude::matching::serialize_pattern;
using aptitude::util::progress_info;
+using aptitude::views::progress;
using boost::shared_ptr;
namespace
@@ -254,7 +255,7 @@ namespace
typedef std::vector<std::pair<pkgCache::VerIterator, cw::util::ref_ptr<m::structural_match> > >
results_list;
- const shared_ptr<progress_display> search_progress_display =
+ const shared_ptr<progress> search_progress_display =
create_progress_display(term, term_locale);
const shared_ptr<progress_throttle> search_progress_throttle =
create_progress_throttle();
@@ -264,7 +265,7 @@ namespace
for(std::vector<cw::util::ref_ptr<m::pattern> >::const_iterator pIt = patterns.begin();
pIt != patterns.end(); ++pIt)
{
- const shared_ptr<progress_display> search_progress =
+ const shared_ptr<progress> search_progress =
create_search_progress(serialize_pattern(*pIt),
search_progress_display,
search_progress_throttle);
@@ -279,7 +280,7 @@ namespace
*apt_package_records,
debug,
sigc::mem_fun(search_progress.get(),
- &progress_display::set_progress));
+ &progress::set_progress));
// Warn the user if an exact name pattern didn't produce a
// result.
diff --git a/src/cmdline/text_progress.cc b/src/cmdline/text_progress.cc
index 404358f4..e7b895b6 100644
--- a/src/cmdline/text_progress.cc
+++ b/src/cmdline/text_progress.cc
@@ -28,6 +28,7 @@
#include <generic/apt/apt.h>
#include <generic/apt/config_signal.h>
#include <generic/util/progress_info.h>
+#include <generic/views/progress.h>
// System includes:
@@ -65,11 +66,11 @@ namespace aptitude
// indicator when the operation finishes.
std::string last_op;
- shared_ptr<progress_display> display;
+ shared_ptr<views::progress> display;
public:
text_progress(bool _use_tty_decorations,
- const shared_ptr<progress_display> &_display)
+ const shared_ptr<views::progress> &_display)
: use_tty_decorations(_use_tty_decorations),
display(_display)
{
@@ -130,7 +131,7 @@ namespace aptitude
shared_ptr<OpProgress>
make_text_progress(bool require_tty_decorations,
- const shared_ptr<progress_display> &display)
+ const shared_ptr<views::progress> &display)
{
bool hide_tty_decorations = false;
bool hidden = false;
diff --git a/src/cmdline/text_progress.h b/src/cmdline/text_progress.h
index 02ab5f2e..fc30e983 100644
--- a/src/cmdline/text_progress.h
+++ b/src/cmdline/text_progress.h
@@ -27,9 +27,13 @@
namespace aptitude
{
+ namespace views
+ {
+ class progress;
+ }
+
namespace cmdline
{
- class progress_display;
class terminal;
class terminal_locale;
@@ -51,7 +55,7 @@ namespace aptitude
*/
boost::shared_ptr<OpProgress>
make_text_progress(bool require_tty_decorations,
- const boost::shared_ptr<progress_display> &display);
+ const boost::shared_ptr<views::progress> &display);
/** \brief Convenience routine to create a default text-progress
* object.
diff --git a/src/generic/views/Makefile.am b/src/generic/views/Makefile.am
index a7b983a5..02c15271 100644
--- a/src/generic/views/Makefile.am
+++ b/src/generic/views/Makefile.am
@@ -3,4 +3,6 @@ INCLUDES=-I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/i
noinst_LIBRARIES = libgeneric-views.a
libgeneric_views_a_SOURCES = \
download_progress.cc \
- download_progress.h
+ download_progress.h \
+ progress.cc \
+ progress.h
diff --git a/src/generic/views/SConscript b/src/generic/views/SConscript
index 2ea00069..efefe65b 100644
--- a/src/generic/views/SConscript
+++ b/src/generic/views/SConscript
@@ -9,4 +9,6 @@ srcs = map(File, [
programs_env.Dist('Makefile.am', 'README', 'SConscript')
+SConscript(dirs = [ 'mocks' ])
+
Return('srcs')
diff --git a/src/generic/views/mocks/Makefile.am b/src/generic/views/mocks/Makefile.am
index 16b33398..417db9ef 100644
--- a/src/generic/views/mocks/Makefile.am
+++ b/src/generic/views/mocks/Makefile.am
@@ -3,4 +3,5 @@ INCLUDES=-I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/i
noinst_LIBRARIES = libgeneric-views-mocks.a
libgeneric_views_mocks_a_SOURCES = \
download_progress.cc \
- download_progress.h
+ download_progress.h \
+ progress.h
diff --git a/src/cmdline/mocks/cmdline_progress_display.h b/src/generic/views/mocks/progress.h
index 3bc769b3..88b2c9e2 100644
--- a/src/cmdline/mocks/cmdline_progress_display.h
+++ b/src/generic/views/mocks/progress.h
@@ -18,23 +18,23 @@
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
-#ifndef CMDLINE_PROGRESS_DISPLAY_H
-#define CMDLINE_PROGRESS_DISPLAY_H
+#ifndef GENERIC_VIEWS_MOCKS_PROGRESS_H
+#define GENERIC_VIEWS_MOCKS_PROGRESS_H
// Local includes:
-#include <cmdline/cmdline_progress_display.h>
+#include <generic/views/progress.h>
// System includes:
#include <gmock/gmock.h>
namespace aptitude
{
- namespace cmdline
+ namespace views
{
namespace mocks
{
- /** \brief Mock implementation of cmdline::progress_display */
- class progress_display : public aptitude::cmdline::progress_display
+ /** \brief Mock implementation of views::progress */
+ class progress : public aptitude::views::progress
{
public:
MOCK_METHOD1(set_progress, void(const aptitude::util::progress_info &));
@@ -45,4 +45,4 @@ namespace aptitude
}
}
-#endif // CMDLINE_PROGRESS_DISPLAY_H
+#endif // GENERIC_VIEWS_MOCKS_PROGRESS_H
diff --git a/src/generic/views/progress.cc b/src/generic/views/progress.cc
new file mode 100644
index 00000000..24c9b050
--- /dev/null
+++ b/src/generic/views/progress.cc
@@ -0,0 +1,31 @@
+/** \file cmdline_progress_display.cc */
+
+// Copyright (C) 2010 Daniel Burrows
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; see the file COPYING. If not, write to
+// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// Local includes:
+#include "progress.h"
+
+namespace aptitude
+{
+ namespace views
+ {
+ progress::~progress()
+ {
+ }
+ }
+}
diff --git a/src/generic/views/progress.h b/src/generic/views/progress.h
new file mode 100644
index 00000000..d5d7f39a
--- /dev/null
+++ b/src/generic/views/progress.h
@@ -0,0 +1,61 @@
+/** \file cmdline_progress_display.h */ // -*-c++-*-
+
+// Copyright (C) 2010 Daniel Burrows
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; see the file COPYING. If not, write to
+// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+#ifndef APTITUDE_GENERIC_VIEWS_PROGRESS_H
+#define APTITUDE_GENERIC_VIEWS_PROGRESS_H
+
+// System includes:
+#include <boost/shared_ptr.hpp>
+
+namespace aptitude
+{
+ namespace util
+ {
+ class progress_info;
+ }
+
+ namespace views
+ {
+ /** \brief A general class for displaying a single line of
+ * progress information.
+ *
+ * The progress information is delivered as a progress_info
+ * object. A blank progress_info causes the display to be
+ * erased. A "pulse" mode progress_info displays a message with
+ * no percent indicator. And a "bar" mode progress_info displays
+ * a message with a percent indicator.
+ */
+ class progress
+ {
+ public:
+ virtual ~progress();
+
+ /** \brief Set the currently displayed progress.
+ *
+ * \param progress The new progress information to display.
+ */
+ virtual void set_progress(const aptitude::util::progress_info &progress) = 0;
+
+ /** \brief Mark the currently displayed progress (if any) as done. */
+ virtual void done() = 0;
+ };
+ }
+}
+
+#endif // APTITUDE_GENERIC_VIEWS_PROGRESS_H
diff --git a/tests/SConscript b/tests/SConscript
index 8c8fb04c..4744196b 100644
--- a/tests/SConscript
+++ b/tests/SConscript
@@ -115,6 +115,7 @@ gtest_test_extra_deps = [
'../src/generic/util/progress_info.o',
'../src/generic/util/util.o',
'../src/generic/views/download_progress.o',
+ '../src/generic/views/progress.o',
'../src/loggers.o',
]
diff --git a/tests/test_cmdline_progress_display.cc b/tests/test_cmdline_progress_display.cc
index 21744f6a..cbd04637 100644
--- a/tests/test_cmdline_progress_display.cc
+++ b/tests/test_cmdline_progress_display.cc
@@ -25,6 +25,7 @@
#include <cmdline/mocks/transient_message.h>
#include <generic/util/progress_info.h>
+#include <generic/views/progress.h>
// System includes:
#include <boost/make_shared.hpp>
@@ -34,7 +35,6 @@
#include <gtest/gtest.h>
using aptitude::cmdline::create_progress_display;
-using aptitude::cmdline::progress_display;
using aptitude::util::progress_info;
using boost::make_shared;
using boost::shared_ptr;
@@ -49,6 +49,7 @@ using testing::Values;
using testing::_;
namespace mocks = aptitude::cmdline::mocks;
+namespace views = aptitude::views;
namespace
{
@@ -85,7 +86,7 @@ namespace
: public TestWithParam<CmdlineProgressDisplayParams>
{
shared_ptr<mocks::transient_message> msg;
- shared_ptr<progress_display> progress;
+ shared_ptr<views::progress> progress;
bool get_old_style_percentage() const
{
diff --git a/tests/test_cmdline_search_progress.cc b/tests/test_cmdline_search_progress.cc
index 0f868e5b..0679033e 100644
--- a/tests/test_cmdline_search_progress.cc
+++ b/tests/test_cmdline_search_progress.cc
@@ -22,10 +22,10 @@
// Local includes:
#include <cmdline/cmdline_search_progress.h>
-#include <cmdline/mocks/cmdline_progress_display.h>
#include <cmdline/mocks/cmdline_progress_throttle.h>
#include <generic/util/progress_info.h>
+#include <generic/views/mocks/progress.h>
// System includes:
#include <boost/make_shared.hpp>
@@ -35,7 +35,6 @@
#include <gtest/gtest.h>
using aptitude::cmdline::create_search_progress;
-using aptitude::cmdline::progress_display;
using aptitude::util::progress_info;
using boost::make_shared;
using boost::shared_ptr;
@@ -47,27 +46,33 @@ using testing::Sequence;
using testing::Test;
using testing::_;
-namespace mocks = aptitude::cmdline::mocks;
+namespace mocks
+{
+ using namespace aptitude::cmdline::mocks;
+ using namespace aptitude::views::mocks;
+}
+
+namespace views = aptitude::views;
namespace
{
struct CmdlineSearchProgressTest : public Test
{
- const shared_ptr<mocks::progress_display> progress_display;
+ const shared_ptr<mocks::progress> progress;
const shared_ptr<mocks::progress_throttle> progress_throttle;
/** \brief The search pattern string used to create the search
* progress object.
*/
const std::string search_pattern;
- const shared_ptr<aptitude::cmdline::progress_display> search_progress;
+ const shared_ptr<views::progress> search_progress;
CmdlineSearchProgressTest()
- : progress_display(make_shared<mocks::progress_display>()),
+ : progress(make_shared<mocks::progress>()),
progress_throttle(make_shared<mocks::progress_throttle>()),
search_pattern("?name(aptitude)"),
search_progress(create_search_progress(search_pattern,
- progress_display,
+ progress,
progress_throttle))
{
}
@@ -112,7 +117,7 @@ TEST_F(CmdlineSearchProgressTest, SetProgressNone)
{
never_throttle();
- EXPECT_CALL(*progress_display, set_progress(none()));
+ EXPECT_CALL(*progress, set_progress(none()));
search_progress->set_progress(none());
}
@@ -124,7 +129,7 @@ TEST_F(CmdlineSearchProgressTest, SetProgressPulse)
const std::string msg = "Blip";
const progress_info info = pulse(search_pattern + ": " + msg);
- EXPECT_CALL(*progress_display, set_progress(info));
+ EXPECT_CALL(*progress, set_progress(info));
search_progress->set_progress(pulse(msg));
}
@@ -137,7 +142,7 @@ TEST_F(CmdlineSearchProgressTest, SetProgressBar)
const std::string msg = "Blorp";
const progress_info info = bar(fraction, search_pattern + ": " + msg);
- EXPECT_CALL(*progress_display, set_progress(info));
+ EXPECT_CALL(*progress, set_progress(info));
search_progress->set_progress(bar(fraction, msg));
}
@@ -146,7 +151,7 @@ TEST_F(CmdlineSearchProgressTest, ThrottledProgressNone)
{
always_throttle();
- EXPECT_CALL(*progress_display, set_progress(_))
+ EXPECT_CALL(*progress, set_progress(_))
.Times(0);
search_progress->set_progress(none());
@@ -155,11 +160,11 @@ TEST_F(CmdlineSearchProgressTest, ThrottledProgressNone)
// Check that a second set_progress() call goes through, since
// throttling is no longer enabled:
Mock::VerifyAndClearExpectations(progress_throttle.get());
- Mock::VerifyAndClearExpectations(progress_display.get());
+ Mock::VerifyAndClearExpectations(progress.get());
never_throttle();
- EXPECT_CALL(*progress_display, set_progress(none()));
+ EXPECT_CALL(*progress, set_progress(none()));
search_progress->set_progress(none());
}
@@ -171,7 +176,7 @@ TEST_F(CmdlineSearchProgressTest, ThrottledProgressPulse)
always_throttle();
- EXPECT_CALL(*progress_display, set_progress(_))
+ EXPECT_CALL(*progress, set_progress(_))
.Times(0);
search_progress->set_progress(info);
@@ -180,11 +185,11 @@ TEST_F(CmdlineSearchProgressTest, ThrottledProgressPulse)
// Check that a second set_progress() call goes through, since
// throttling is no longer enabled:
Mock::VerifyAndClearExpectations(progress_throttle.get());
- Mock::VerifyAndClearExpectations(progress_display.get());
+ Mock::VerifyAndClearExpectations(progress.get());
never_throttle();
- EXPECT_CALL(*progress_display,
+ EXPECT_CALL(*progress,
set_progress(pulse(search_pattern + ": " + msg)));
search_progress->set_progress(info);
@@ -198,7 +203,7 @@ TEST_F(CmdlineSearchProgressTest, ThrottledProgressBar)
always_throttle();
- EXPECT_CALL(*progress_display, set_progress(_))
+ EXPECT_CALL(*progress, set_progress(_))
.Times(0);
search_progress->set_progress(info);
@@ -207,11 +212,11 @@ TEST_F(CmdlineSearchProgressTest, ThrottledProgressBar)
// Check that a second set_progress() call goes through, since
// throttling is no longer enabled:
Mock::VerifyAndClearExpectations(progress_throttle.get());
- Mock::VerifyAndClearExpectations(progress_display.get());
+ Mock::VerifyAndClearExpectations(progress.get());
never_throttle();
- EXPECT_CALL(*progress_display,
+ EXPECT_CALL(*progress,
set_progress(bar(fraction, search_pattern + ": " + msg)));
search_progress->set_progress(info);
@@ -220,7 +225,7 @@ TEST_F(CmdlineSearchProgressTest, ThrottledProgressBar)
TEST_F(CmdlineSearchProgressTest, Done)
{
never_throttle();
- EXPECT_CALL(*progress_display, done());
+ EXPECT_CALL(*progress, done());
search_progress->done();
}
@@ -229,7 +234,7 @@ TEST_F(CmdlineSearchProgressTest, Done)
TEST_F(CmdlineSearchProgressTest, DoneThrottled)
{
always_throttle();
- EXPECT_CALL(*progress_display, done());
+ EXPECT_CALL(*progress, done());
search_progress->done();
}