/[pcre]/code/trunk/pcre_stringpiece_unittest.cc
ViewVC logotype

Diff of /code/trunk/pcre_stringpiece_unittest.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 77 by nigel, Sat Feb 24 21:40:45 2007 UTC revision 580 by ph10, Fri Nov 26 11:16:43 2010 UTC
# Line 1  Line 1 
1  // Copyright 2003 and onwards Google Inc.  // Copyright 2003 and onwards Google Inc.
2  // Author: Sanjay Ghemawat  // Author: Sanjay Ghemawat
3    
4    #ifdef HAVE_CONFIG_H
5    #include "config.h"
6    #endif
7    
8  #include <stdio.h>  #include <stdio.h>
9  #include <map>  #include <map>
10  #include <algorithm>    // for make_pair  #include <algorithm>    // for make_pair
11  #include <pcre_stringpiece.h>  
12    #include "pcrecpp.h"
13    #include "pcre_stringpiece.h"
14    
15  // CHECK dies with a fatal error if condition is not true.  It is *not*  // CHECK dies with a fatal error if condition is not true.  It is *not*
16  // controlled by NDEBUG, so the check will be executed regardless of  // controlled by NDEBUG, so the check will be executed regardless of
# Line 18  Line 24 
24    }                                                     \    }                                                     \
25  } while (0)  } while (0)
26    
 using std::map;  
 using std::make_pair;  
27  using pcrecpp::StringPiece;  using pcrecpp::StringPiece;
28    
29  static void CheckSTLComparator() {  static void CheckSTLComparator() {
# Line 31  static void CheckSTLComparator() { Line 35  static void CheckSTLComparator() {
35    StringPiece p2(s2);    StringPiece p2(s2);
36    StringPiece p3(s3);    StringPiece p3(s3);
37    
38    typedef map<StringPiece, int> TestMap;    typedef std::map<StringPiece, int> TestMap;
39    TestMap map;    TestMap map;
40    
41    map.insert(make_pair(p1, 0));    map.insert(std::make_pair(p1, 0));
42    map.insert(make_pair(p2, 1));    map.insert(std::make_pair(p2, 1));
43    map.insert(make_pair(p3, 2));    map.insert(std::make_pair(p3, 2));
44    
45    CHECK(map.size() == 3);    CHECK(map.size() == 3);
46    
47    TestMap::const_iterator iter = map.begin();    TestMap::const_iterator iter = map.begin();

Legend:
Removed from v.77  
changed lines
  Added in v.580

  ViewVC Help
Powered by ViewVC 1.1.5