Ignore:
Timestamp:
Jul 30, 2019, 8:17:38 AM (3 years ago)
Author:
Peter
Message:

fixes #927. PriorityQueue? used an std::set internally, which meant it could only store unique elements. Fix this unexpected behaviour by using an std::multiset instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.16-stable/test/priority_queue.cc

    r3403 r3829  
    22
    33/*
    4   Copyright (C) 2015 Peter Johansson
     4  Copyright (C) 2015, 2019 Peter Johansson
    55
    66  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    9595  PriorityQueue<std::string, MyComp> queue2(comp);
    9696  queue2.push("hello");
     97  if (queue2.size() != 1) {
     98    suite.add(false);
     99    suite.err() << "incorrect size: " << queue2.size() << "; expected 1\n";
     100  }
     101  queue2.push("hello");
     102  if (queue2.size() != 2) {
     103    suite.add(false);
     104    suite.err() << "incorrect size: " << queue2.size() << "; expected 2\n";
     105  }
    97106
    98107  return suite.return_value();
Note: See TracChangeset for help on using the changeset viewer.