aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-06 15:53:40 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 11:32:56 +0000
commit42e739456d8e348c9a14fb8ea1f1d2c889dab8af (patch)
tree8f3a94745ea5aad56929a29d18a944e3258f1347
parent4d9e95cfc626a2f98262a267050250f30dc6b3bd (diff)
downloadpaludis-42e739456d8e348c9a14fb8ea1f1d2c889dab8af.tar.gz
paludis-42e739456d8e348c9a14fb8ea1f1d2c889dab8af.tar.xz
Use passed ID
-rw-r--r--paludis/changed_choices.cc6
-rw-r--r--paludis/elike_package_dep_spec.cc4
-rw-r--r--paludis/elike_use_requirement-fwd.hh4
-rw-r--r--paludis/elike_use_requirement.cc180
-rw-r--r--paludis/elike_use_requirement_TEST.cc262
-rw-r--r--paludis/user_dep_spec.cc3
6 files changed, 224 insertions, 235 deletions
diff --git a/paludis/changed_choices.cc b/paludis/changed_choices.cc
index cd8fb8e..46093c2 100644
--- a/paludis/changed_choices.cc
+++ b/paludis/changed_choices.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -66,10 +66,10 @@ ChangedChoices::add_additional_requirements_to(PartiallyMadePackageDepSpec & spe
{
if (o->second)
spec.additional_requirement(parse_elike_use_requirement("" + stringify(o->first) + "(-)",
- make_null_shared_ptr(), { euro_allow_default_values }));
+ { euro_allow_default_values }));
else
spec.additional_requirement(parse_elike_use_requirement("-" + stringify(o->first) + "(-)",
- make_null_shared_ptr(), { euro_allow_default_values }));
+ { euro_allow_default_values }));
}
}
diff --git a/paludis/elike_package_dep_spec.cc b/paludis/elike_package_dep_spec.cc
index 8d2c841..572f2d8 100644
--- a/paludis/elike_package_dep_spec.cc
+++ b/paludis/elike_package_dep_spec.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -238,7 +238,7 @@ paludis::elike_remove_trailing_square_bracket_if_exists(std::string & s, Partial
if (options[epdso_strict_parsing])
euro += euro_strict_parsing;
- std::shared_ptr<const AdditionalPackageDepSpecRequirement> req(parse_elike_use_requirement(flag, id, euro));
+ std::shared_ptr<const AdditionalPackageDepSpecRequirement> req(parse_elike_use_requirement(flag, euro));
result.additional_requirement(req);
break;
diff --git a/paludis/elike_use_requirement-fwd.hh b/paludis/elike_use_requirement-fwd.hh
index 8df88aa..abc7f7a 100644
--- a/paludis/elike_use_requirement-fwd.hh
+++ b/paludis/elike_use_requirement-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -38,7 +38,7 @@ namespace paludis
typedef Options<ELikeUseRequirementOption> ELikeUseRequirementOptions;
std::shared_ptr<const AdditionalPackageDepSpecRequirement> parse_elike_use_requirement(
- const std::string &, const std::shared_ptr<const PackageID> &, const ELikeUseRequirementOptions &)
+ const std::string &, const ELikeUseRequirementOptions &)
PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE;
}
diff --git a/paludis/elike_use_requirement.cc b/paludis/elike_use_requirement.cc
index e893a84..e2929fa 100644
--- a/paludis/elike_use_requirement.cc
+++ b/paludis/elike_use_requirement.cc
@@ -77,7 +77,6 @@ namespace
{
private:
const std::string _flags;
- const std::shared_ptr<const PackageID> _id;
const Tribool _default_value;
const bool _ignore_if_no_such_group;
@@ -85,10 +84,9 @@ namespace
const ELikeUseRequirementOptions _options;
public:
- UseRequirement(const std::string & n, const std::shared_ptr<const PackageID> & i,
+ UseRequirement(const std::string & n,
const ELikeUseRequirementOptions & o, Tribool d, const bool g) :
_flags(n),
- _id(i),
_default_value(d),
_ignore_if_no_such_group(g),
_options(o)
@@ -104,6 +102,7 @@ namespace
const ChoiceNameWithPrefix &,
const ChangedChoices * const,
const std::shared_ptr<const PackageID> &,
+ const std::shared_ptr<const PackageID> &,
const ChangedChoices * const) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
bool one_requirement_met(
@@ -111,6 +110,7 @@ namespace
const ChoiceNameWithPrefix & c,
const ChangedChoices * const maybe_changes_to_owner,
const std::shared_ptr<const PackageID> & id,
+ const std::shared_ptr<const PackageID> & from_id,
const ChangedChoices * const maybe_changes_to_target) const PALUDIS_ATTRIBUTE((warn_unused_result))
{
if (_ignore_if_no_such_group)
@@ -126,30 +126,27 @@ namespace
return true;
}
- return one_requirement_met_base(env, c, maybe_changes_to_owner, id, maybe_changes_to_target);
+ return one_requirement_met_base(env, c, maybe_changes_to_owner, id, from_id, maybe_changes_to_target);
}
- virtual const std::string as_human_string() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual const std::string as_human_string(
+ const std::shared_ptr<const PackageID> & from_id) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
const std::string flags() const PALUDIS_ATTRIBUTE((warn_unused_result))
{
return _flags;
}
- const std::shared_ptr<const PackageID> package_id() const PALUDIS_ATTRIBUTE((warn_unused_result))
- {
- return _id;
- }
-
const std::pair<bool, std::string> requirement_met(
const Environment * const env,
const ChangedChoices * const maybe_changes_to_owner,
const std::shared_ptr<const PackageID> & id,
+ const std::shared_ptr<const PackageID> & from_id,
const ChangedChoices * const maybe_changes_to_target) const
{
if (_flags.length() >= 2 && ":*" == _flags.substr(_flags.length() - 2))
{
- if ((! _options[euro_allow_self_deps]) || (! _id) || (! _id->choices_key()))
+ if ((! _options[euro_allow_self_deps]) || (! from_id) || (! from_id->choices_key()))
throw ELikeUseRequirementError(_flags, "[prefix:*] not allowed here");
if (_options[euro_portage_syntax] && ! _options[euro_both_syntaxes])
{
@@ -161,16 +158,16 @@ namespace
}
ChoicePrefixName prefix(_flags.substr(0, _flags.length() - 2));
- Choices::ConstIterator cc(_id->choices_key()->value()->find(prefix));
- if (cc == _id->choices_key()->value()->end())
+ Choices::ConstIterator cc(from_id->choices_key()->value()->find(prefix));
+ if (cc == from_id->choices_key()->value()->end())
Log::get_instance()->message("elike_use_requirement.prefix_star_unmatching", ll_warning, lc_context) <<
- "ID '" << *_id << "' uses requirement '" << _flags << "' but has no choice prefix '" << prefix << "'";
+ "ID '" << *from_id << "' uses requirement '" << _flags << "' but has no choice prefix '" << prefix << "'";
else
{
std::pair<bool, std::string> result(true, "");
for (Choice::ConstIterator v((*cc)->begin()), v_end((*cc)->end()) ;
v != v_end ; ++v)
- if (! one_requirement_met(env, (*v)->name_with_prefix(), maybe_changes_to_owner, id, maybe_changes_to_target))
+ if (! one_requirement_met(env, (*v)->name_with_prefix(), maybe_changes_to_owner, id, from_id, maybe_changes_to_target))
{
if (! result.first)
result.second.append(", ");
@@ -180,16 +177,16 @@ namespace
if (! result.first)
{
- result.second = as_human_string() + " (unmet: " + result.second + ")";
+ result.second = as_human_string(from_id) + " (unmet: " + result.second + ")";
return result;
}
}
}
else
- if (! one_requirement_met(env, ChoiceNameWithPrefix(_flags), maybe_changes_to_owner, id, maybe_changes_to_target))
- return std::make_pair(false, as_human_string());
+ if (! one_requirement_met(env, ChoiceNameWithPrefix(_flags), maybe_changes_to_owner, id, from_id, maybe_changes_to_target))
+ return std::make_pair(false, as_human_string(from_id));
- return std::make_pair(true, as_human_string());
+ return std::make_pair(true, as_human_string(from_id));
}
const Tribool default_value() const PALUDIS_ATTRIBUTE((warn_unused_result))
@@ -215,14 +212,15 @@ namespace
const Environment * const env,
const ChangedChoices * const maybe_changes_to_owner,
const std::shared_ptr<const PackageID> & id,
+ const std::shared_ptr<const PackageID> & from_id,
ChangedChoices & changed_choices) const
{
- if (requirement_met(env, maybe_changes_to_owner, id, &changed_choices).first)
+ if (requirement_met(env, maybe_changes_to_owner, id, from_id, &changed_choices).first)
return indeterminate;
if (_flags.length() >= 2 && ":*" == _flags.substr(_flags.length() - 2))
{
- if ((! _options[euro_allow_self_deps]) || (! _id) || (! _id->choices_key()))
+ if ((! _options[euro_allow_self_deps]) || (! from_id) || (! from_id->choices_key()))
throw ELikeUseRequirementError(_flags, "[prefix:*] not allowed here");
if (_options[euro_portage_syntax] && ! _options[euro_both_syntaxes])
{
@@ -234,10 +232,10 @@ namespace
}
ChoicePrefixName prefix(_flags.substr(0, _flags.length() - 2));
- Choices::ConstIterator cc(_id->choices_key()->value()->find(prefix));
- if (cc == _id->choices_key()->value()->end())
+ Choices::ConstIterator cc(from_id->choices_key()->value()->find(prefix));
+ if (cc == from_id->choices_key()->value()->end())
Log::get_instance()->message("elike_use_requirement.prefix_star_unmatching", ll_warning, lc_context) <<
- "ID '" << *_id << "' uses requirement '" << _flags << "' but has no choice prefix '" << prefix << "'";
+ "ID '" << *from_id << "' uses requirement '" << _flags << "' but has no choice prefix '" << prefix << "'";
else
{
for (Choice::ConstIterator v((*cc)->begin()), v_end((*cc)->end()) ;
@@ -280,20 +278,20 @@ namespace
{
public:
EnabledUseRequirement(const std::string & n,
- const std::shared_ptr<const PackageID> & i,
const ELikeUseRequirementOptions & o,
Tribool d, const bool b) :
- UseRequirement(n, i, o, d, b)
+ UseRequirement(n, o, d, b)
{
}
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag, const ChangedChoices * const,
- const std::shared_ptr<const PackageID> & pkg, const ChangedChoices * const changed_choices) const
+ const std::shared_ptr<const PackageID> & pkg, const std::shared_ptr<const PackageID> &, const ChangedChoices * const changed_choices) const
{
return icky_use_query(_options, flag, pkg, changed_choices, default_value());
}
- virtual const std::string as_human_string() const
+ virtual const std::string as_human_string(
+ const std::shared_ptr<const PackageID> &) const
{
return "Flag '" + stringify(flags()) + "' enabled" + default_value_human_string_fragment();
}
@@ -304,20 +302,20 @@ namespace
{
public:
DisabledUseRequirement(const std::string & n,
- const std::shared_ptr<const PackageID> & i,
const ELikeUseRequirementOptions & o,
Tribool d, const bool b) :
- UseRequirement(n, i, o, d, b)
+ UseRequirement(n, o, d, b)
{
}
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag, const ChangedChoices * const,
- const std::shared_ptr<const PackageID> & pkg, const ChangedChoices * const changed_choices) const
+ const std::shared_ptr<const PackageID> & pkg, const std::shared_ptr<const PackageID> &, const ChangedChoices * const changed_choices) const
{
return ! icky_use_query(_options, flag, pkg, changed_choices, default_value());
}
- virtual const std::string as_human_string() const
+ virtual const std::string as_human_string(
+ const std::shared_ptr<const PackageID> &) const
{
return "Flag '" + stringify(flags()) + "' disabled" + default_value_human_string_fragment();
}
@@ -328,10 +326,9 @@ namespace
{
public:
ConditionalUseRequirement(const std::string & n,
- const std::shared_ptr<const PackageID> & i,
const ELikeUseRequirementOptions & o,
Tribool d, const bool b) :
- UseRequirement(n, i, o, d, b)
+ UseRequirement(n, o, d, b)
{
}
};
@@ -342,25 +339,25 @@ namespace
public:
IfMineThenUseRequirement(
const std::string & n,
- const std::shared_ptr<const PackageID> & i,
const ELikeUseRequirementOptions & o,
Tribool d, const bool b) :
- ConditionalUseRequirement(n, i, o, d, b)
+ ConditionalUseRequirement(n, o, d, b)
{
}
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag,
const ChangedChoices * const maybe_changes_to_owner, const std::shared_ptr<const PackageID> & pkg,
- const ChangedChoices * const changed_choices) const
+ const std::shared_ptr<const PackageID> & from_id, const ChangedChoices * const changed_choices) const
{
- return ! icky_use_query(_options, flag, package_id(), maybe_changes_to_owner) ||
+ return ! icky_use_query(_options, flag, from_id, maybe_changes_to_owner) ||
icky_use_query(_options, flag, pkg, changed_choices, default_value());
}
- virtual const std::string as_human_string() const
+ virtual const std::string as_human_string(
+ const std::shared_ptr<const PackageID> & from_id) const
{
return "Flag '" + stringify(flags()) + "' enabled if it is enabled for '"
- + stringify(*package_id()) + "'" + default_value_human_string_fragment();
+ + stringify(*from_id) + "'" + default_value_human_string_fragment();
}
};
@@ -369,25 +366,26 @@ namespace
{
public:
IfNotMineThenUseRequirement(const std::string & n,
- const std::shared_ptr<const PackageID> & i,
const ELikeUseRequirementOptions & o,
Tribool d, const bool b) :
- ConditionalUseRequirement(n, i, o, d, b)
+ ConditionalUseRequirement(n, o, d, b)
{
}
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag,
const ChangedChoices * const maybe_changes_to_owner,
- const std::shared_ptr<const PackageID> & pkg, const ChangedChoices * const changed_choices) const
+ const std::shared_ptr<const PackageID> & pkg, const std::shared_ptr<const PackageID> & from_id,
+ const ChangedChoices * const changed_choices) const
{
- return icky_use_query(_options, flag, package_id(), maybe_changes_to_owner) ||
+ return icky_use_query(_options, flag, from_id, maybe_changes_to_owner) ||
icky_use_query(_options, flag, pkg, changed_choices, default_value());
}
- virtual const std::string as_human_string() const
+ virtual const std::string as_human_string(
+ const std::shared_ptr<const PackageID> & from_id) const
{
return "Flag '" + stringify(flags()) + "' enabled if it is disabled for '" +
- stringify(*package_id()) + "'" + default_value_human_string_fragment();
+ stringify(*from_id) + "'" + default_value_human_string_fragment();
}
};
@@ -396,25 +394,25 @@ namespace
{
public:
IfMineThenNotUseRequirement(const std::string & n,
- const std::shared_ptr<const PackageID> & i,
const ELikeUseRequirementOptions & o,
Tribool d, const bool b) :
- ConditionalUseRequirement(n, i, o, d, b)
+ ConditionalUseRequirement(n, o, d, b)
{
}
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag,
const ChangedChoices * const maybe_changes_to_owner, const std::shared_ptr<const PackageID> & pkg,
- const ChangedChoices * const changed_choices) const
+ const std::shared_ptr<const PackageID> & from_id, const ChangedChoices * const changed_choices) const
{
- return ! icky_use_query(_options, flag, package_id(), maybe_changes_to_owner) ||
+ return ! icky_use_query(_options, flag, from_id, maybe_changes_to_owner) ||
! icky_use_query(_options, flag, pkg, changed_choices, default_value());
}
- virtual const std::string as_human_string() const
+ virtual const std::string as_human_string(
+ const std::shared_ptr<const PackageID> & from_id) const
{
return "Flag '" + stringify(flags()) + "' disabled if it is enabled for '" +
- stringify(*package_id()) + "'" + default_value_human_string_fragment();
+ stringify(*from_id) + "'" + default_value_human_string_fragment();
}
};
@@ -423,25 +421,25 @@ namespace
{
public:
IfNotMineThenNotUseRequirement(const std::string & n,
- const std::shared_ptr<const PackageID> & i,
const ELikeUseRequirementOptions & o,
Tribool d, const bool b) :
- ConditionalUseRequirement(n, i, o, d, b)
+ ConditionalUseRequirement(n, o, d, b)
{
}
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag,
const ChangedChoices * const maybe_changes_to_owner, const std::shared_ptr<const PackageID> & pkg,
- const ChangedChoices * const changed_choices) const
+ const std::shared_ptr<const PackageID> & from_id, const ChangedChoices * const changed_choices) const
{
- return icky_use_query(_options, flag, package_id(), maybe_changes_to_owner) ||
+ return icky_use_query(_options, flag, from_id, maybe_changes_to_owner) ||
! icky_use_query(_options, flag, pkg, changed_choices, default_value());
}
- virtual const std::string as_human_string() const
+ virtual const std::string as_human_string(
+ const std::shared_ptr<const PackageID> & from_id) const
{
return "Flag '" + stringify(flags()) + "' disabled if it is disabled for '" +
- stringify(*package_id()) + "'" + default_value_human_string_fragment();
+ stringify(*from_id) + "'" + default_value_human_string_fragment();
}
};
@@ -450,25 +448,25 @@ namespace
{
public:
EqualUseRequirement(const std::string & n,
- const std::shared_ptr<const PackageID> & i,
const ELikeUseRequirementOptions & o,
Tribool d, const bool b) :
- ConditionalUseRequirement(n, i, o, d, b)
+ ConditionalUseRequirement(n, o, d, b)
{
}
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag,
const ChangedChoices * const maybe_changes_to_owner, const std::shared_ptr<const PackageID> & pkg,
- const ChangedChoices * const changed_choices) const
+ const std::shared_ptr<const PackageID> & from_id, const ChangedChoices * const changed_choices) const
{
return icky_use_query(_options, flag, pkg, changed_choices, default_value()) ==
- icky_use_query(_options, flag, package_id(), maybe_changes_to_owner);
+ icky_use_query(_options, flag, from_id, maybe_changes_to_owner);
}
- virtual const std::string as_human_string() const
+ virtual const std::string as_human_string(
+ const std::shared_ptr<const PackageID> & from_id) const
{
return "Flag '" + stringify(flags()) + "' enabled or disabled like it is for '"
- + stringify(*package_id()) + "'" + default_value_human_string_fragment();
+ + stringify(*from_id) + "'" + default_value_human_string_fragment();
}
};
@@ -477,25 +475,25 @@ namespace
{
public:
NotEqualUseRequirement(const std::string & n,
- const std::shared_ptr<const PackageID> & i,
const ELikeUseRequirementOptions & o,
Tribool d, const bool b) :
- ConditionalUseRequirement(n, i, o, d, b)
+ ConditionalUseRequirement(n, o, d, b)
{
}
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag,
const ChangedChoices * const maybe_changes_to_owner, const std::shared_ptr<const PackageID> & pkg,
- const ChangedChoices * const changed_choices) const
+ const std::shared_ptr<const PackageID> & from_id, const ChangedChoices * const changed_choices) const
{
return icky_use_query(_options, flag, pkg, changed_choices, default_value()) !=
- icky_use_query(_options, flag, package_id(), maybe_changes_to_owner);
+ icky_use_query(_options, flag, from_id, maybe_changes_to_owner);
}
- virtual const std::string as_human_string() const
+ virtual const std::string as_human_string(
+ const std::shared_ptr<const PackageID> & from_id) const
{
return "Flag '" + stringify(flags()) + "' enabled or disabled opposite to how it is for '"
- + stringify(*package_id()) + "'" + default_value_human_string_fragment();
+ + stringify(*from_id) + "'" + default_value_human_string_fragment();
}
};
@@ -518,7 +516,7 @@ namespace
const Environment * const env,
const ChangedChoices * const maybe_changes_to_owner,
const std::shared_ptr<const PackageID> & id,
- const std::shared_ptr<const PackageID> &,
+ const std::shared_ptr<const PackageID> & from_id,
const ChangedChoices * const maybe_changes_to_target) const
{
using namespace std::placeholders;
@@ -527,7 +525,7 @@ namespace
for (Reqs::const_iterator r(_reqs.begin()), r_end(_reqs.end()) ;
r != r_end ; ++r)
{
- std::pair<bool, std::string> r_result((*r)->requirement_met(env, maybe_changes_to_owner, id, maybe_changes_to_target));
+ std::pair<bool, std::string> r_result((*r)->requirement_met(env, maybe_changes_to_owner, id, from_id, maybe_changes_to_target));
if (! r_result.first)
{
if (! result.first)
@@ -541,9 +539,10 @@ namespace
}
virtual const std::string as_human_string(
- const std::shared_ptr<const PackageID> &) const
+ const std::shared_ptr<const PackageID> & from_id) const
{
- return join(_reqs.begin(), _reqs.end(), "; ", std::mem_fn(&UseRequirement::as_human_string));
+ return join(_reqs.begin(), _reqs.end(), "; ", std::bind(std::mem_fn(&UseRequirement::as_human_string),
+ std::placeholders::_1, from_id));
}
virtual const std::string as_raw_string() const
@@ -560,14 +559,14 @@ namespace
const Environment * const env,
const ChangedChoices * const maybe_changes_to_owner,
const std::shared_ptr<const PackageID> & id,
- const std::shared_ptr<const PackageID> &,
+ const std::shared_ptr<const PackageID> & from_id,
ChangedChoices & changed_choices) const
{
Tribool result(indeterminate);
for (auto r(_reqs.begin()), r_end(_reqs.end()) ;
r != r_end ; ++r)
{
- auto b((*r)->accumulate_changes_to_make_met(env, maybe_changes_to_owner, id, changed_choices));
+ auto b((*r)->accumulate_changes_to_make_met(env, maybe_changes_to_owner, id, from_id, changed_choices));
if (b.is_false())
return false;
else if (b.is_true())
@@ -580,34 +579,31 @@ namespace
template <typename T_>
std::shared_ptr<const UseRequirement>
- make_requirement(const std::string & n, const std::shared_ptr<const PackageID > & i,
- const ELikeUseRequirementOptions & o, Tribool d, const bool b)
+ make_requirement(const std::string & n, const ELikeUseRequirementOptions & o, Tribool d, const bool b)
{
- return std::make_shared<T_>(n, i, o, d, b);
+ return std::make_shared<T_>(n, o, d, b);
}
typedef std::shared_ptr<const UseRequirement> (* Factory)(
- const std::string &, const std::shared_ptr<const PackageID> &,
- const ELikeUseRequirementOptions &, Tribool, bool);
+ const std::string &, const ELikeUseRequirementOptions &, Tribool, bool);
void
parse_flag(
const std::shared_ptr<UseRequirements> & result,
const Factory & factory,
const std::string & c,
- const std::shared_ptr<const PackageID> & id,
Tribool d,
const bool i,
const ELikeUseRequirementOptions & options)
{
- result->add_requirement(factory(c, id, options, d, i));
+ result->add_requirement(factory(c, options, d, i));
}
void
parse_one_use_requirement(
const std::shared_ptr<UseRequirements> & result,
const std::string & s, std::string & flag,
- const std::shared_ptr<const PackageID> & id, const ELikeUseRequirementOptions & options)
+ const ELikeUseRequirementOptions & options)
{
Factory factory;
@@ -616,7 +612,7 @@ namespace
if ('=' == flag.at(flag.length() - 1))
{
- if ((! options[euro_allow_self_deps]) || (! id))
+ if ((! options[euro_allow_self_deps]))
throw ELikeUseRequirementError(s, "Cannot use [use=] here");
flag.erase(flag.length() - 1);
@@ -660,7 +656,7 @@ namespace
}
else if ('?' == flag.at(flag.length() - 1))
{
- if ((! options[euro_allow_self_deps]) || (! id))
+ if ((! options[euro_allow_self_deps]))
throw ELikeUseRequirementError(s, "Cannot use [use?] here");
flag.erase(flag.length() - 1);
@@ -770,7 +766,7 @@ namespace
}
flag.erase(flag.length() - 3, 3);
- parse_flag(result, factory, flag, id, Tribool(true), false, options);
+ parse_flag(result, factory, flag, Tribool(true), false, options);
}
else if ('-' == flag.at(flag.length() - 2))
{
@@ -784,7 +780,7 @@ namespace
}
flag.erase(flag.length() - 3, 3);
- parse_flag(result, factory, flag, id, Tribool(false), false, options);
+ parse_flag(result, factory, flag, Tribool(false), false, options);
}
else if ('?' == flag.at(flag.length() - 2))
{
@@ -798,13 +794,13 @@ namespace
}
flag.erase(flag.length() - 3, 3);
- parse_flag(result, factory, flag, id, Tribool(false), true, options);
+ parse_flag(result, factory, flag, Tribool(false), true, options);
}
else
throw ELikeUseRequirementError(s, "Invalid [] contents");
}
else
- parse_flag(result, factory, flag, id, Tribool(indeterminate), false, options);
+ parse_flag(result, factory, flag, Tribool(indeterminate), false, options);
}
}
@@ -815,7 +811,7 @@ ELikeUseRequirementError::ELikeUseRequirementError(const std::string & s, const
std::shared_ptr<const AdditionalPackageDepSpecRequirement>
paludis::parse_elike_use_requirement(const std::string & s,
- const std::shared_ptr<const PackageID> & id, const ELikeUseRequirementOptions & options)
+ const ELikeUseRequirementOptions & options)
{
Context context("When parsing use requirement '" + s + "':");
@@ -825,7 +821,7 @@ paludis::parse_elike_use_requirement(const std::string & s,
{
std::string::size_type comma(s.find(',', pos));
std::string flag(s.substr(pos, std::string::npos == comma ? comma : comma - pos));
- parse_one_use_requirement(result, s, flag, id, options);
+ parse_one_use_requirement(result, s, flag, options);
if (std::string::npos == comma)
break;
diff --git a/paludis/elike_use_requirement_TEST.cc b/paludis/elike_use_requirement_TEST.cc
index 1eb117c..c3d32bb 100644
--- a/paludis/elike_use_requirement_TEST.cc
+++ b/paludis/elike_use_requirement_TEST.cc
@@ -72,25 +72,25 @@ namespace test_cases
set_conditionals(id, "enabled disabled");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("enabled", std::shared_ptr<const PackageID>(), { euro_strict_parsing }));
+ parse_elike_use_requirement("enabled", { euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[enabled]");
TEST_CHECK_EQUAL(req1->as_human_string(make_null_shared_ptr()), "Flag 'enabled' enabled");
TEST_CHECK(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("disabled", std::shared_ptr<const PackageID>(), { euro_strict_parsing }));
+ parse_elike_use_requirement("disabled", { euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[disabled]");
TEST_CHECK_EQUAL(req2->as_human_string(make_null_shared_ptr()), "Flag 'disabled' enabled");
TEST_CHECK(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
- parse_elike_use_requirement("-enabled", std::shared_ptr<const PackageID>(), { euro_strict_parsing }));
+ parse_elike_use_requirement("-enabled", { euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-enabled]");
TEST_CHECK_EQUAL(req3->as_human_string(make_null_shared_ptr()), "Flag 'enabled' disabled");
TEST_CHECK(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
- parse_elike_use_requirement("-disabled", std::shared_ptr<const PackageID>(), { euro_strict_parsing }));
+ parse_elike_use_requirement("-disabled", { euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[-disabled]");
TEST_CHECK_EQUAL(req4->as_human_string(make_null_shared_ptr()), "Flag 'disabled' disabled");
TEST_CHECK(req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
@@ -113,25 +113,25 @@ namespace test_cases
set_conditionals(id, "enabled disabled");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("enabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("enabled", { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[enabled]");
TEST_CHECK_EQUAL(req1->as_human_string(make_null_shared_ptr()), "Flag 'enabled' enabled");
TEST_CHECK(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("disabled", { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[disabled]");
TEST_CHECK_EQUAL(req2->as_human_string(make_null_shared_ptr()), "Flag 'disabled' enabled");
TEST_CHECK(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
- parse_elike_use_requirement("-enabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("-enabled", { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-enabled]");
TEST_CHECK_EQUAL(req3->as_human_string(make_null_shared_ptr()), "Flag 'enabled' disabled");
TEST_CHECK(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
- parse_elike_use_requirement("-disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("-disabled", { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[-disabled]");
TEST_CHECK_EQUAL(req4->as_human_string(make_null_shared_ptr()), "Flag 'disabled' disabled");
TEST_CHECK(req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
@@ -154,31 +154,31 @@ namespace test_cases
set_conditionals(id, "enabled disabled");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("enabled,-disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("enabled,-disabled", { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[enabled,-disabled]");
TEST_CHECK_EQUAL(req1->as_human_string(make_null_shared_ptr()), "Flag 'enabled' enabled; Flag 'disabled' disabled");
TEST_CHECK(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("enabled,disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("enabled,disabled", { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[enabled,disabled]");
TEST_CHECK_EQUAL(req2->as_human_string(make_null_shared_ptr()), "Flag 'enabled' enabled; Flag 'disabled' enabled");
TEST_CHECK(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
- parse_elike_use_requirement("-enabled,-disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("-enabled,-disabled", { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-enabled,-disabled]");
TEST_CHECK_EQUAL(req3->as_human_string(make_null_shared_ptr()), "Flag 'enabled' disabled; Flag 'disabled' disabled");
TEST_CHECK(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
- parse_elike_use_requirement("enabled,-disabled,-enabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("enabled,-disabled,-enabled", { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[enabled,-disabled,-enabled]");
TEST_CHECK_EQUAL(req4->as_human_string(make_null_shared_ptr()), "Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' disabled");
TEST_CHECK(! req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req5(
- parse_elike_use_requirement("enabled,-disabled,enabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("enabled,-disabled,enabled", { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req5->as_raw_string(), "[enabled,-disabled,enabled]");
TEST_CHECK_EQUAL(req5->as_human_string(make_null_shared_ptr()), "Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' enabled");
TEST_CHECK(req5->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
@@ -203,84 +203,84 @@ namespace test_cases
set_conditionals(id2, "pkgname");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req1->as_human_string(id), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req2->as_human_string(id2), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
- parse_elike_use_requirement("-pkgname?", id, { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req3->as_human_string(id), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req3->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req3->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
- parse_elike_use_requirement("-pkgname?", id2, { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req4->as_human_string(id2), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req4->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req4->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req5(
- parse_elike_use_requirement("pkgname!?", id, { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req5->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req5->as_human_string(id), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req5->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req5->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req6(
- parse_elike_use_requirement("pkgname!?", id2, { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req6->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req6->as_human_string(id2), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req6->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req6->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
- parse_elike_use_requirement("-pkgname!?", id, { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req7->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
- parse_elike_use_requirement("-pkgname!?", id2, { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req8->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
- parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req9->as_human_string(id), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
- parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req10->as_human_string(id2), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
- parse_elike_use_requirement("pkgname!=", id, { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req11->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
- parse_elike_use_requirement("pkgname!=", id2, { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req12->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
@@ -306,56 +306,56 @@ namespace test_cases
set_conditionals(id2, "pkgname");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req1->as_human_string(id), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req2->as_human_string(id2), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
- parse_elike_use_requirement("!pkgname?", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req7->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
- parse_elike_use_requirement("!pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req8->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
- parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req9->as_human_string(id), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
- parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req10->as_human_string(id2), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
- parse_elike_use_requirement("!pkgname=", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req11->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
- parse_elike_use_requirement("!pkgname=", id2, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req12->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
@@ -381,112 +381,112 @@ namespace test_cases
set_conditionals(id2, "pkgname");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req1->as_human_string(id), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req2->as_human_string(id2), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
- parse_elike_use_requirement("!pkgname?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req7->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
- parse_elike_use_requirement("!pkgname?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req8->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
- parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req9->as_human_string(id), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
- parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req10->as_human_string(id2), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
- parse_elike_use_requirement("!pkgname=", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req11->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
- parse_elike_use_requirement("!pkgname=", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req12->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req12->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
- parse_elike_use_requirement("-pkgname?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req13->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req13->as_human_string(id), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req13->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req13->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
- parse_elike_use_requirement("-pkgname?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req14->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req14->as_human_string(id2), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req14->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req14->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
- parse_elike_use_requirement("pkgname!?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req15->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req15->as_human_string(id), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req15->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req15->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
- parse_elike_use_requirement("pkgname!?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req16->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req16->as_human_string(id2), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req16->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req16->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
- parse_elike_use_requirement("-pkgname!?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req17->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req17->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req17->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req17->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
- parse_elike_use_requirement("-pkgname!?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req18->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req18->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req18->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req18->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
- parse_elike_use_requirement("pkgname!=", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req19->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req19->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req19->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req19->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
- parse_elike_use_requirement("pkgname!=", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req20->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req20->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req20->requirement_met(&env, 0, id, id2, 0).first);
@@ -509,18 +509,18 @@ namespace test_cases
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
- TEST_CHECK_THROWS(parse_elike_use_requirement("", id, { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("-", id, { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("?", id, { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("-?", id, { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("!?", id, { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("-!?", id, { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("=", id, { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("!=", id, { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
-
- TEST_CHECK_THROWS(parse_elike_use_requirement("!test?", id, { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("!test=", id, { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("test1,test2", id, { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("-", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("-?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("!?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("-!?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("=", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("!=", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+
+ TEST_CHECK_THROWS(parse_elike_use_requirement("!test?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("!test=", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("test1,test2", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
}
} test_malformed_use_requirements;
@@ -539,22 +539,22 @@ namespace test_cases
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
- TEST_CHECK_THROWS(parse_elike_use_requirement("", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("-", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("?", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("!?", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("=", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("!=", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
-
- TEST_CHECK_THROWS(parse_elike_use_requirement(",", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("test,", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement(",test", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("test,,test", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
-
- TEST_CHECK_THROWS(parse_elike_use_requirement("test!?", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("-test?", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("-test!?", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("test!=", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("-", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("!?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("!=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+
+ TEST_CHECK_THROWS(parse_elike_use_requirement(",", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("test,", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement(",test", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("test,,test", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+
+ TEST_CHECK_THROWS(parse_elike_use_requirement("test!?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("-test?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("-test!?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("test!=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
}
} test_malformed_use_requirements_portage_syntax;
@@ -573,17 +573,17 @@ namespace test_cases
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
- TEST_CHECK_THROWS(parse_elike_use_requirement("", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("-", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("!?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("=", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("!=", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
-
- TEST_CHECK_THROWS(parse_elike_use_requirement(",", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("test,", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement(",test", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- TEST_CHECK_THROWS(parse_elike_use_requirement("test,,test", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("-", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("!=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+
+ TEST_CHECK_THROWS(parse_elike_use_requirement(",", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("test,", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement(",test", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ TEST_CHECK_THROWS(parse_elike_use_requirement("test,,test", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
}
} test_malformed_use_requirements_both_syntaxes;
@@ -605,112 +605,112 @@ namespace test_cases
set_conditionals(id2, "pkgname");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps }));
+ parse_elike_use_requirement("pkgname?", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req1->as_human_string(id), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps }));
+ parse_elike_use_requirement("pkgname?", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req2->as_human_string(id2), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
- parse_elike_use_requirement("!pkgname?", id, { euro_allow_self_deps }));
+ parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req7->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
- parse_elike_use_requirement("!pkgname?", id2, { euro_allow_self_deps }));
+ parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req8->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
- parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps }));
+ parse_elike_use_requirement("pkgname=", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req9->as_human_string(id), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
- parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps }));
+ parse_elike_use_requirement("pkgname=", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req10->as_human_string(id2), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
- parse_elike_use_requirement("!pkgname=", id, { euro_allow_self_deps }));
+ parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req11->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
- parse_elike_use_requirement("!pkgname=", id2, { euro_allow_self_deps }));
+ parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req12->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req12->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
- parse_elike_use_requirement("-pkgname?", id, { euro_allow_self_deps }));
+ parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req13->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req13->as_human_string(id), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req13->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req13->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
- parse_elike_use_requirement("-pkgname?", id2, { euro_allow_self_deps }));
+ parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req14->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req14->as_human_string(id2), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req14->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req14->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
- parse_elike_use_requirement("pkgname!?", id, { euro_allow_self_deps }));
+ parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req15->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req15->as_human_string(id), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req15->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req15->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
- parse_elike_use_requirement("pkgname!?", id2, { euro_allow_self_deps }));
+ parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req16->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req16->as_human_string(id2), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req16->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req16->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
- parse_elike_use_requirement("-pkgname!?", id, { euro_allow_self_deps }));
+ parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req17->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req17->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req17->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req17->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
- parse_elike_use_requirement("-pkgname!?", id2, { euro_allow_self_deps }));
+ parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req18->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req18->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req18->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req18->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
- parse_elike_use_requirement("pkgname!=", id, { euro_allow_self_deps }));
+ parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req19->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req19->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req19->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req19->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
- parse_elike_use_requirement("pkgname!=", id2, { euro_allow_self_deps }));
+ parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req20->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req20->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req20->requirement_met(&env, 0, id, id2, 0).first);
@@ -736,112 +736,112 @@ namespace test_cases
set_conditionals(id2, "pkgname");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req1->as_human_string(id), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req2->as_human_string(id2), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
- parse_elike_use_requirement("!pkgname?", id, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req7->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
- parse_elike_use_requirement("!pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req8->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
- parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req9->as_human_string(id), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
- parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req10->as_human_string(id2), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
- parse_elike_use_requirement("!pkgname=", id, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req11->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
- parse_elike_use_requirement("!pkgname=", id2, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req12->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req12->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
- parse_elike_use_requirement("-pkgname?", id, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req13->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req13->as_human_string(id), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req13->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req13->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
- parse_elike_use_requirement("-pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req14->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req14->as_human_string(id2), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req14->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req14->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
- parse_elike_use_requirement("pkgname!?", id, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req15->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req15->as_human_string(id), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req15->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req15->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
- parse_elike_use_requirement("pkgname!?", id2, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req16->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req16->as_human_string(id2), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(req16->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(! req16->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
- parse_elike_use_requirement("-pkgname!?", id, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req17->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req17->as_human_string(id), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
TEST_CHECK(req17->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req17->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
- parse_elike_use_requirement("-pkgname!?", id2, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req18->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req18->as_human_string(id2), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
TEST_CHECK(! req18->requirement_met(&env, 0, id, id2, 0).first);
TEST_CHECK(req18->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
- parse_elike_use_requirement("pkgname!=", id, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req19->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req19->as_human_string(id), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
TEST_CHECK(! req19->requirement_met(&env, 0, id, id, 0).first);
TEST_CHECK(req19->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
- parse_elike_use_requirement("pkgname!=", id2, { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req20->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req20->as_human_string(id2), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
TEST_CHECK(req20->requirement_met(&env, 0, id, id2, 0).first);
@@ -865,25 +865,25 @@ namespace test_cases
set_conditionals(id, "enabled disabled");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("missing(+)", std::shared_ptr<const PackageID>(), { euro_allow_default_values, euro_strict_parsing }));
+ parse_elike_use_requirement("missing(+)", { euro_allow_default_values, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[missing(+)]");
TEST_CHECK_EQUAL(req1->as_human_string(make_null_shared_ptr()), "Flag 'missing' enabled, assuming enabled if missing");
TEST_CHECK(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("missing(-)", std::shared_ptr<const PackageID>(), { euro_allow_default_values, euro_strict_parsing }));
+ parse_elike_use_requirement("missing(-)", { euro_allow_default_values, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[missing(-)]");
TEST_CHECK_EQUAL(req2->as_human_string(make_null_shared_ptr()), "Flag 'missing' enabled, assuming disabled if missing");
TEST_CHECK(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
- parse_elike_use_requirement("-missing(+)", std::shared_ptr<const PackageID>(), { euro_allow_default_values, euro_strict_parsing }));
+ parse_elike_use_requirement("-missing(+)", { euro_allow_default_values, euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-missing(+)]");
TEST_CHECK_EQUAL(req3->as_human_string(make_null_shared_ptr()), "Flag 'missing' disabled, assuming enabled if missing");
TEST_CHECK(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
- parse_elike_use_requirement("-missing(-)", std::shared_ptr<const PackageID>(), { euro_allow_default_values, euro_strict_parsing }));
+ parse_elike_use_requirement("-missing(-)", { euro_allow_default_values, euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[-missing(-)]");
TEST_CHECK_EQUAL(req4->as_human_string(make_null_shared_ptr()), "Flag 'missing' disabled, assuming disabled if missing");
TEST_CHECK(req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
@@ -906,14 +906,12 @@ namespace test_cases
set_conditionals(id, "foo:enabled foo:disabled");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("foo:*", id,
- { euro_allow_default_values, euro_allow_self_deps }));
+ parse_elike_use_requirement("foo:*", { euro_allow_default_values, euro_allow_self_deps }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[foo:*]");
TEST_CHECK(! req1->requirement_met(&env, 0, id, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("foo:*=", id,
- { euro_allow_default_values, euro_allow_self_deps }));
+ parse_elike_use_requirement("foo:*=", { euro_allow_default_values, euro_allow_self_deps }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[foo:*=]");
TEST_CHECK(req2->requirement_met(&env, 0, id, id, 0).first);
}
@@ -939,17 +937,13 @@ namespace test_cases
set_conditionals(id2, "foo:enabled foo:disabled bar:enabled bar:disabled");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("foo:*(?)=", id2,
- { euro_allow_default_values, euro_allow_self_deps,
- euro_allow_default_question_values }));
+ parse_elike_use_requirement("foo:*(?)=", { euro_allow_default_values, euro_allow_self_deps, euro_allow_default_question_values }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[foo:*(?)=]");
TEST_CHECK(req1->requirement_met(&env, 0, id2, id2, 0).first);
TEST_CHECK(req1->requirement_met(&env, 0, id1, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("bar:*(?)=", id2,
- { euro_allow_default_values, euro_allow_self_deps,
- euro_allow_default_question_values }));
+ parse_elike_use_requirement("bar:*(?)=", { euro_allow_default_values, euro_allow_self_deps, euro_allow_default_question_values }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[bar:*(?)=]");
TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
TEST_CHECK(req2->requirement_met(&env, 0, id1, id2, 0).first);
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index 973a5b7..8dbb402 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -197,8 +197,7 @@ namespace
default:
{
- std::shared_ptr<const AdditionalPackageDepSpecRequirement> req(parse_elike_use_requirement(flag,
- std::shared_ptr<const PackageID>(), { }));
+ std::shared_ptr<const AdditionalPackageDepSpecRequirement> req(parse_elike_use_requirement(flag, { }));
result.additional_requirement(req);
}
break;