Changeset 4029 for branches/0.18-stable


Ignore:
Timestamp:
Jan 19, 2021, 4:15:46 AM (2 years ago)
Author:
Peter
Message:

extend the tests show what the comparison functors take as argument; refs #970

Location:
branches/0.18-stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/0.18-stable/NEWS

    r4028 r4029  
    559559Copyright (C) 2010, 2011 Peter Johansson
    560560Copyright (C) 2012 Jari Häkkinen, Peter Johansson
    561 Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Peter Johansson
     561Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Peter Johansson
    562562
    563563This file is part of yat library, http://dev.thep.lu.se/yat
  • branches/0.18-stable/test/segment.cc

    r4028 r4029  
    22
    33/*
    4   Copyright (C) 2010, 2011, 2012, 2014, 2015, 2016, 2017 Peter Johansson
     4  Copyright (C) 2010, 2011, 2012, 2014, 2015, 2016, 2017, 2021 Peter Johansson
    55
    66  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    7373void test_comp(test::Suite& suite)
    7474{
     75  Segment<double> key;
    7576  {
    7677    SegmentSet<double> set;
    7778    SegmentSet<double>::key_compare kcompare = set.key_comp();
     79    if (kcompare(key, key))
     80      suite.add(false);
    7881    test::avoid_compiler_warning(kcompare);
    7982    SegmentSet<double>::value_compare vcompare = set.value_comp();
     83    if (vcompare(key, key))
     84      suite.add(false);
    8085    test::avoid_compiler_warning(vcompare);
    8186  }
     
    8388  {
    8489    SegmentMap<double, std::string> map;
     90    std::pair<const Segment<double>, std::string> value(key, "hello");
    8591    SegmentMap<double, std::string>::key_compare kcompare = map.key_comp();
     92    if (kcompare(key, key))
     93      suite.add(false);
    8694    test::avoid_compiler_warning(kcompare);
    8795    SegmentMap<double, std::string>::value_compare vcompare = map.value_comp();
     96    if (vcompare(value, value))
     97      suite.add(false);
    8898    test::avoid_compiler_warning(vcompare);
    8999  }
  • branches/0.18-stable/yat/utility/SegmentTree.h

    r4028 r4029  
    55
    66/*
    7   Copyright (C) 2010, 2011, 2012, 2013 Peter Johansson
     7  Copyright (C) 2010, 2011, 2012, 2013, 2021 Peter Johansson
    88
    99  This file is part of the yat library, http://dev.thep.lu.se/yat
Note: See TracChangeset for help on using the changeset viewer.