Changeset 4032 for trunk/test/segment.cc
- Timestamp:
- Jan 21, 2021, 8:44:38 AM (2 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/0.18-stable merged: 4020,4028-4030
- Property svn:mergeinfo changed
-
trunk/test/segment.cc
r4027 r4032 2 2 3 3 /* 4 Copyright (C) 2010, 2011, 2012, 2014, 2015, 2016, 2017 Peter Johansson4 Copyright (C) 2010, 2011, 2012, 2014, 2015, 2016, 2017, 2021 Peter Johansson 5 5 6 6 This file is part of the yat library, http://dev.thep.lu.se/yat … … 30 30 using namespace theplu::yat; 31 31 using namespace utility; 32 void test_comp(test::Suite& suite); 32 33 void test_compare(test::Suite& suite); 33 34 void test_count(test::Suite&); … … 52 53 test::Suite suite(argc, argv); 53 54 55 test_comp(suite); 54 56 test_compare(suite); 55 57 test_count(suite); … … 68 70 69 71 return suite.return_value(); 72 } 73 74 75 void test_comp(test::Suite& suite) 76 { 77 Segment<double> key; 78 { 79 SegmentSet<double> set; 80 SegmentSet<double>::key_compare kcompare = set.key_comp(); 81 if (kcompare(key, key)) 82 suite.add(false); 83 test::avoid_compiler_warning(kcompare); 84 SegmentSet<double>::value_compare vcompare = set.value_comp(); 85 if (vcompare(key, key)) 86 suite.add(false); 87 test::avoid_compiler_warning(vcompare); 88 } 89 90 { 91 SegmentMap<double, std::string> map; 92 std::pair<const Segment<double>, std::string> value(key, "hello"); 93 SegmentMap<double, std::string>::key_compare kcompare = map.key_comp(); 94 if (kcompare(key, key)) 95 suite.add(false); 96 test::avoid_compiler_warning(kcompare); 97 SegmentMap<double, std::string>::value_compare vcompare = map.value_comp(); 98 if (vcompare(value, value)) 99 suite.add(false); 100 test::avoid_compiler_warning(vcompare); 101 } 70 102 } 71 103
Note: See TracChangeset
for help on using the changeset viewer.