Changeset 793:8d2e55fac752 in lemon-1.1 for test/maps_test.cc
- Timestamp:
- 09/13/12 11:52:50 (12 years ago)
- Branch:
- 1.1
- Parents:
- 791:939d747055cd (diff), 792:761fe0846f49 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/maps_test.cc
r761 r793 81 81 NullMap<A,B> map1; 82 82 NullMap<A,B> map2 = map1; 83 ignore_unused_variable_warning(map2); 83 84 map1 = nullMap<A,B>(); 84 85 } … … 91 92 ConstMap<A,B> map2 = B(); 92 93 ConstMap<A,B> map3 = map1; 94 ignore_unused_variable_warning(map2,map3); 95 93 96 map1 = constMap<A>(B()); 94 97 map1 = constMap<A,B>(); … … 96 99 ConstMap<A,C> map4(C(1)); 97 100 ConstMap<A,C> map5 = map4; 101 ignore_unused_variable_warning(map5); 102 98 103 map4 = constMap<A>(C(2)); 99 104 map4.setAll(C(3)); … … 116 121 IdentityMap<A> map1; 117 122 IdentityMap<A> map2 = map1; 123 ignore_unused_variable_warning(map2); 124 118 125 map1 = identityMap<A>(); 119 126 … … 175 182 checkConcept<ReadMap<B,double>, CompMap>(); 176 183 CompMap map1 = CompMap(DoubleMap(),ReadMap<B,A>()); 184 ignore_unused_variable_warning(map1); 177 185 CompMap map2 = composeMap(DoubleMap(), ReadMap<B,A>()); 186 ignore_unused_variable_warning(map2); 178 187 179 188 SparseMap<double, bool> m1(false); m1[3.14] = true; … … 188 197 checkConcept<ReadMap<A,double>, CombMap>(); 189 198 CombMap map1 = CombMap(DoubleMap(), DoubleMap()); 199 ignore_unused_variable_warning(map1); 190 200 CombMap map2 = combineMap(DoubleMap(), DoubleMap(), std::plus<double>()); 201 ignore_unused_variable_warning(map2); 191 202 192 203 check(combineMap(constMap<B,int,2>(), identityMap<B>(), &binc)[B()] == 3, … … 200 211 FunctorToMap<F> map1; 201 212 FunctorToMap<F> map2 = FunctorToMap<F>(F()); 213 ignore_unused_variable_warning(map2); 214 202 215 B b = functorToMap(F())[A()]; 216 ignore_unused_variable_warning(b); 203 217 204 218 checkConcept<ReadMap<A,B>, MapToFunctor<ReadMap<A,B> > >(); 205 219 MapToFunctor<ReadMap<A,B> > map = 206 220 MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>()); 221 ignore_unused_variable_warning(map); 207 222 208 223 check(functorToMap(&func)[A()] == 3, … … 222 237 ConvertMap<ReadMap<double, int>, double> >(); 223 238 ConvertMap<RangeMap<bool>, int> map1(rangeMap(1, true)); 239 ignore_unused_variable_warning(map1); 224 240 ConvertMap<RangeMap<bool>, int> map2 = convertMap<int>(rangeMap(2, false)); 241 ignore_unused_variable_warning(map2); 242 225 243 } 226 244 -
test/maps_test.cc
r792 r793 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 71 71 checkConcept<ReadWriteMap<A,B>, ReadWriteMap<A,B> >(); 72 72 checkConcept<ReadWriteMap<A,C>, ReadWriteMap<A,C> >(); 73 checkConcept<ReferenceMap<A,B,B&,const B&>, ReferenceMap<A,B,B&,const B&> >(); 74 checkConcept<ReferenceMap<A,C,C&,const C&>, ReferenceMap<A,C,C&,const C&> >(); 73 checkConcept<ReferenceMap<A,B,B&,const B&>, 74 ReferenceMap<A,B,B&,const B&> >(); 75 checkConcept<ReferenceMap<A,C,C&,const C&>, 76 ReferenceMap<A,C,C&,const C&> >(); 75 77 76 78 // NullMap … … 369 371 check(v1[i++] == *it, "Something is wrong with LoggerBoolMap"); 370 372 } 371 373 372 374 // CrossRefMap 373 375 { … … 377 379 checkConcept<ReadWriteMap<Node, int>, 378 380 CrossRefMap<Graph, Node, int> >(); 379 381 380 382 Graph gr; 381 383 typedef CrossRefMap<Graph, Node, char> CRMap; 382 384 typedef CRMap::ValueIterator ValueIt; 383 385 CRMap map(gr); 384 386 385 387 Node n0 = gr.addNode(); 386 388 Node n1 = gr.addNode(); 387 389 Node n2 = gr.addNode(); 388 390 389 391 map.set(n0, 'A'); 390 392 map.set(n1, 'B');
Note: See TracChangeset
for help on using the changeset viewer.