Dependencies

- Fixed bug in Task::addDependency where a 'dup dep' error string was not
  properly composed, which cause the error message to be shown as 'k'.
- Relocated expression evaluation on modification to only be processed for
  date attributes.  This impacts DOM, but fixes more than it breaks.
- Corrected unit test that was expecting an old-style error message.
- Added protection against array overrun in next_mod_group.  Again.
This commit is contained in:
Paul Beckingham 2011-09-12 23:53:46 -04:00
parent d1e52c05d6
commit 776bfea402
3 changed files with 21 additions and 18 deletions

View file

@ -711,19 +711,20 @@ void Task::addDependency (int id)
if (id == this->id)
throw std::string (STRING_TASK_DEPEND_ITSELF);
// Check for extant dependency.
// Check that id is resolvable.
std::string uuid = context.tdb2.pending.uuid (id);
if (uuid == "")
throw format (STRING_TASK_DEPEND_MISSING, id);
// Store the dependency.
std::string depends = get ("depends");
if (depends.length ())
if (depends != "")
{
// Check for extant dependency.
if (depends.find (uuid) == std::string::npos)
set ("depends", depends + "," + uuid);
else
throw std::string (STRING_TASK_DEPEND_DUP, this->id, id);
throw format (STRING_TASK_DEPEND_DUP, this->id, id);
}
else
set ("depends", uuid);