Commit 74651c81 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

optionmap: fix set()

This longstanding issue caused some emptiness checks options to be
ignored in the test suite, reducing coverage.

* spot/misc/optionmap.cc (set): Insert the other keys without
erasing the existing ones.
parent a3b9469d
Pipeline #1811 passed with stages
in 141 minutes and 48 seconds
// -*- coding: utf-8 -*-
// Copyright (C) 2008, 2013, 2014, 2015, 2016 Laboratoire de Recherche
// Copyright (C) 2008, 2013-2016, 2018 Laboratoire de Recherche
// et Développement de l'Epita (LRDE).
// Copyright (C) 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
......@@ -174,9 +174,9 @@ namespace spot
void
option_map::set(const option_map& o)
{
options_ = o.options_;
options_str_ = o.options_str_;
unused_ = o.unused_;
options_.insert(o.options_.begin(), o.options_.end());
options_str_.insert(o.options_str_.begin(), o.options_str_.end());
unused_.insert(o.unused_.begin(), o.unused_.end());
}
int
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment