From b9f783d1274ccbba8dba059548f7bde4eca192a4 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 1 Jun 2015 22:01:52 +0200 Subject: [PATCH] refactoring: rename mtx::includes to mtx::included_in --- src/common/list_utils.h | 10 +++++----- src/mkvtoolnix-gui/watch_jobs/tab.cpp | 2 +- tests/unit/common/list_utils.cpp | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/common/list_utils.h b/src/common/list_utils.h index e4f9ac5be..0a8cedaf1 100644 --- a/src/common/list_utils.h +++ b/src/common/list_utils.h @@ -18,7 +18,7 @@ namespace mtx { template bool -includes(T const &needle, +included_in(T const &needle, T const &val) { return needle == val; } @@ -26,10 +26,10 @@ includes(T const &needle, template bool -includes(T const &needle, - T const &val, - Trest... rest) { - return (needle == val) || includes(needle, rest...); +included_in(T const &needle, + T const &val, + Trest... rest) { + return (needle == val) || included_in(needle, rest...); } template diff --git a/src/mkvtoolnix-gui/watch_jobs/tab.cpp b/src/mkvtoolnix-gui/watch_jobs/tab.cpp index d5c2bd741..564ce6aab 100644 --- a/src/mkvtoolnix-gui/watch_jobs/tab.cpp +++ b/src/mkvtoolnix-gui/watch_jobs/tab.cpp @@ -113,7 +113,7 @@ Tab::setInitialDisplay(Jobs::Job const &job) { m_fullOutput = job.m_fullOutput; ui->abortButton->setEnabled(Jobs::Job::Running == job.m_status); - ui->saveOutputButton->setEnabled(!mtx::includes(job.m_status, Jobs::Job::PendingManual, Jobs::Job::PendingAuto, Jobs::Job::Disabled)); + ui->saveOutputButton->setEnabled(!mtx::included_in(job.m_status, Jobs::Job::PendingManual, Jobs::Job::PendingAuto, Jobs::Job::Disabled)); ui->acknowledgeWarningsAndErrorsButton->setEnabled(job.numUnacknowledgedWarnings() || job.numUnacknowledgedErrors()); } diff --git a/tests/unit/common/list_utils.cpp b/tests/unit/common/list_utils.cpp index e00017f89..37732cab7 100644 --- a/tests/unit/common/list_utils.cpp +++ b/tests/unit/common/list_utils.cpp @@ -6,16 +6,16 @@ namespace { -TEST(ListUtils, includes) { - EXPECT_TRUE(mtx::includes(42, 42)); - EXPECT_TRUE(mtx::includes(42, 54, 42, 48)); - EXPECT_TRUE(mtx::includes(42, 42, 54, 48)); - EXPECT_TRUE(mtx::includes(42, 54, 48, 42)); +TEST(ListUtils, included_in) { + EXPECT_TRUE(mtx::included_in(42, 42)); + EXPECT_TRUE(mtx::included_in(42, 54, 42, 48)); + EXPECT_TRUE(mtx::included_in(42, 42, 54, 48)); + EXPECT_TRUE(mtx::included_in(42, 54, 48, 42)); - EXPECT_FALSE(mtx::includes(23, 42)); - EXPECT_FALSE(mtx::includes(23, 54, 42, 48)); - EXPECT_FALSE(mtx::includes(23, 42, 54, 48)); - EXPECT_FALSE(mtx::includes(23, 54, 48, 42)); + EXPECT_FALSE(mtx::included_in(23, 42)); + EXPECT_FALSE(mtx::included_in(23, 54, 42, 48)); + EXPECT_FALSE(mtx::included_in(23, 42, 54, 48)); + EXPECT_FALSE(mtx::included_in(23, 54, 48, 42)); } TEST(ListUtils, any_of) {