1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/stl_util.h"
9 #include "testing/gtest/include/gtest/gtest.h"
14 TEST(STLUtilTest
, STLIsSorted
) {
20 EXPECT_TRUE(STLIsSorted(set
));
24 std::vector
<int> vector
;
29 vector
.push_back(12432);
30 EXPECT_TRUE(STLIsSorted(vector
));
32 EXPECT_FALSE(STLIsSorted(vector
));
36 TEST(STLUtilTest
, STLSetDifference
) {
51 std::set
<int> difference
;
54 EXPECT_EQ(difference
, STLSetDifference
<std::set
<int> >(a1
, a2
));
58 std::set
<int> difference
;
62 EXPECT_EQ(difference
, STLSetDifference
<std::set
<int> >(a2
, a1
));
66 std::vector
<int> difference
;
67 difference
.push_back(1);
68 difference
.push_back(2);
69 EXPECT_EQ(difference
, STLSetDifference
<std::vector
<int> >(a1
, a2
));
73 std::vector
<int> difference
;
74 difference
.push_back(5);
75 difference
.push_back(6);
76 difference
.push_back(7);
77 EXPECT_EQ(difference
, STLSetDifference
<std::vector
<int> >(a2
, a1
));