Codebase list mozc / 6cbd733
Add std:: prefix to unittests on Linux BUG=#392 TEST=unittest REF_BUG=71969651 REF_CL=182003794 REF_TIME=2018-01-16T12:24:27+09:00 REF_TIME_RAW=1516073067 +0900 Hiroyuki Komatsu 6 years ago
5 changed file(s) with 17 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
177177 int g_counter = 0;
178178 string DebugString() {
179179 ++g_counter;
180 ostringstream os;
180 std::ostringstream os;
181181 os << g_counter << " test!";
182182 return os.str();
183183 }
2929
3030 MAJOR=2
3131 MINOR=23
32 BUILD=2790
32 BUILD=2791
3333 REVISION=102
3434 # This version represents the version of Mozc IME engine (converter, predictor,
3535 # etc.). This version info is included both in the Mozc server and in the Mozc
10241024 Rect original_footer_content_area(100, 200, 300, 400);
10251025 const int focused_index = 3;
10261026 const int total_items = 7;
1027 stringstream footer_string;
1027 std::stringstream footer_string;
10281028 footer_string << focused_index + 1 << "/" << total_items << " ";
10291029 const string index_guide_string = footer_string.str();
10301030 const Size index_guide_size(10, 20);
12181218 const string expected_value = GetExpectedValue(i, true, true);
12191219
12201220 // Shortcut string is padded with one spacing character.
1221 stringstream shortcut_stream;
1221 std::stringstream shortcut_stream;
12221222 shortcut_stream << " " << GetExpectedShortcut(i) << " ";
12231223
12241224 const string expected_shortcut = shortcut_stream.str();
12581258 const string expected_value = GetExpectedValue(i, true, true);
12591259
12601260 // Description string is end-padded with one spacing character.
1261 stringstream description_stream;
1261 std::stringstream description_stream;
12621262 description_stream << GetExpectedDescription(i) << " ";
12631263
12641264 const string expected_description = description_stream.str();
12981298 const string expected_value = GetExpectedValue(i, true, true);
12991299
13001300 // Shortcut string is padded with one spacing character.
1301 stringstream shortcut_stream;
1301 std::stringstream shortcut_stream;
13021302 shortcut_stream << " " << GetExpectedShortcut(i) << " ";
13031303 const string expected_shortcut = shortcut_stream.str();
13041304
13051305 // Description string is end-padded with one spacing character.
1306 stringstream description_stream;
1306 std::stringstream description_stream;
13071307 description_stream << GetExpectedDescription(i) << " ";
13081308 const string expected_description = description_stream.str();
13091309
6060
6161 // Currently this function does not supports special keys.
6262 void AppendToKeyEvent(guint keyval, commands::KeyEvent *key) const {
63 const map<guint, commands::KeyEvent::ModifierKey>::const_iterator it =
63 const std::map<guint, commands::KeyEvent::ModifierKey>::const_iterator it =
6464 keyval_to_modifier_.find(keyval);
6565 if (it != keyval_to_modifier_.end()) {
6666 bool found = false;
9090 }
9191
9292 bool IsPressed(guint keyval) const {
93 const set<guint> &pressed_set = handler_->currently_pressed_modifiers_;
93 const std::set<guint> &pressed_set = handler_->currently_pressed_modifiers_;
9494 return pressed_set.find(keyval) != pressed_set.end();
9595 }
9696
9898 return handler_->is_non_modifier_key_pressed_;
9999 }
100100
101 const set<guint> &currently_pressed_modifiers() {
101 const std::set<guint> &currently_pressed_modifiers() {
102102 return handler_->currently_pressed_modifiers_;
103103 }
104104
105 const set<commands::KeyEvent::ModifierKey> &modifiers_to_be_sent() {
105 const std::set<commands::KeyEvent::ModifierKey> &modifiers_to_be_sent() {
106106 return handler_->modifiers_to_be_sent_;
107107 }
108108
109109 testing::AssertionResult CheckModifiersToBeSent(uint32 modifiers) {
110110 uint32 to_be_sent_mask = 0;
111 for (set<commands::KeyEvent::ModifierKey>::iterator it =
111 for (std::set<commands::KeyEvent::ModifierKey>::iterator it =
112112 modifiers_to_be_sent().begin();
113113 it != modifiers_to_be_sent().end(); ++it) {
114114 to_be_sent_mask |= *it;
135135 }
136136
137137 unique_ptr<KeyEventHandler> handler_;
138 map<guint, commands::KeyEvent::ModifierKey> keyval_to_modifier_;
138 std::map<guint, commands::KeyEvent::ModifierKey> keyval_to_modifier_;
139139 };
140140
141141 #define EXPECT_MODIFIERS_TO_BE_SENT(modifiers) \
431431 for (int trial = 0; trial < kTrialNum; ++trial) {
432432 handler_->Clear();
433433
434 set<guint> pressed_keys;
434 std::set<guint> pressed_keys;
435435 string key_sequence;
436436
437437 const int kSequenceLength = 100;
452452 is_key_up, key_index);
453453
454454 commands::KeyEvent key;
455 for (set<guint>::const_iterator it = pressed_keys.begin();
455 for (std::set<guint>::const_iterator it = pressed_keys.begin();
456456 it != pressed_keys.end(); ++it) {
457457 AppendToKeyEvent(*it, &key);
458458 }
3737
3838 TEST(SurroundingTextUtilTest, GetSafeDelta) {
3939 const guint kSafeInt32MaxAsGUint =
40 static_cast<guint>(numeric_limits<int32>::max());
40 static_cast<guint>(std::numeric_limits<int32>::max());
4141 const guint kTooLargeGUint = kSafeInt32MaxAsGUint + 42;
4242
4343 int32 delta = 0;
8080
8181 // The abs(result) exceeds int32.
8282 EXPECT_FALSE(SurroundingTextUtil::GetSafeDelta(
83 static_cast<guint>(-numeric_limits<int32>::min()),
83 static_cast<guint>(-std::numeric_limits<int32>::min()),
8484 0, &delta));
8585 }
8686