mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-01-08 11:11:51 +00:00
refactoring: rename mtx::includes to mtx::included_in
This commit is contained in:
parent
c826183ed5
commit
b9f783d127
@ -18,7 +18,7 @@ namespace mtx {
|
||||
|
||||
template<typename T>
|
||||
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<typename T,
|
||||
typename... Trest>
|
||||
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<typename T>
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user