annotate packages/language/cxx/ustl/current/tests/bvt11.cpp @ 3292:7f8e529b4d82 default tip

Fix FREESCALE_EDMA_NBYTES_MLOFFYES_MLOFF() so it works with negative offsets.
author vae
date Wed, 29 Apr 2015 23:31:48 +0000
parents 4885e0722884
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2904
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
1 // This file is part of the uSTL library, an STL implementation.
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
2 //
3152
4885e0722884 * include/*:
sergeig
parents: 2904
diff changeset
3 // Copyright (c) 2005 by Mike Sharov <msharov@users.sourceforge.net>
2904
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
4 // This file is free software, distributed under the MIT License.
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
5
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
6 #include "stdtest.h"
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
7
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
8 void PrintVector (const int* first, const int* last)
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
9 {
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
10 cout << "{";
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
11 while (first < last)
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
12 cout << ' ' << *first++;
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
13 cout << " }" << endl;
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
14 }
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
15
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
16 void TestSetAndMultiset (void)
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
17 {
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
18 const int vv[] = { 1, 8, 9, 2, 3, 1, 1, 4, 6, 1, 3, 4 };
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
19 set<int> v (VectorRange (vv));
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
20 multiset<int> mv (VectorRange (vv));
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
21 cout << "set:\t\t";
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
22 PrintVector (v.begin(), v.end());
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
23 cout << "erase(3):\t";
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
24 v.erase (3);
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
25 PrintVector (v.begin(), v.end());
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
26 cout << "multiset:\t";
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
27 PrintVector (mv.begin(), mv.end());
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
28 cout << "count(1) = " << mv.count(1) << endl;
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
29 cout << "find(4) = " << lower_bound (mv, 4) - mv.begin() << endl;
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
30 cout << "find(5) = " << binary_search (mv, 5) << endl;
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
31 cout << "erase(3):\t";
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
32 mv.erase (3);
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
33 PrintVector (mv.begin(), mv.end());
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
34 }
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
35
88af52c64ce4 * ecos.db: Add uSTL library package record.
jld
parents:
diff changeset
36 StdBvtMain (TestSetAndMultiset)