From 74651c811decf816f664ccaf2ee3036861cc6e8c Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 22 May 2018 16:07:08 +0200 Subject: [PATCH] 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. --- spot/misc/optionmap.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spot/misc/optionmap.cc b/spot/misc/optionmap.cc index 68cee3662..3349f0f0d 100644 --- a/spot/misc/optionmap.cc +++ b/spot/misc/optionmap.cc @@ -1,5 +1,5 @@ // -*- 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