From f8d08e98e73ac7f7d67f8813761ca3c611d3337b Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Sat, 24 Oct 2015 20:21:10 -0700 Subject: [PATCH] Deprecate --display_preedit option. client_scenario_test and client_stress_test are no longer intensively used nowadays. Probably it makes sense to remove less important options in favor of maintainability. With this removal, we can remove EncodingUtil::UTF8ToSJIS completely. BUG=#252 TEST=unittest REF_BUG=19010851,18999934 REF_CL=84930641 --- src/client/client_scenario_test_main.cc | 29 ------------------- src/client/client_stress_test_main.cc | 38 ------------------------- src/mozc_version_template.txt | 2 +- 3 files changed, 1 insertion(+), 68 deletions(-) diff --git a/src/client/client_scenario_test_main.cc b/src/client/client_scenario_test_main.cc index 6e62a897b..e773c8c27 100644 --- a/src/client/client_scenario_test_main.cc +++ b/src/client/client_scenario_test_main.cc @@ -32,11 +32,9 @@ // events specified by FLAGS_input file or interactive standard input. Input // file format is same as one of session/session_client_main. -#include #include #include -#include "base/encoding_util.h" #include "base/file_stream.h" #include "base/file_util.h" #include "base/flags.h" @@ -50,7 +48,6 @@ #include "protocol/renderer_command.pb.h" #include "renderer/renderer_client.h" -DEFINE_bool(display_preedit, false, "display predit to tty"); DEFINE_string(input, "", "Input file"); DEFINE_int32(key_duration, 10, "Key duration (msec)"); DEFINE_string(profile_dir, "", "Profile dir"); @@ -62,28 +59,6 @@ DEFINE_bool(test_testsendkey, true, "Test TestSendKey"); namespace mozc { namespace { -string UTF8ToTtyString(const string &text) { -#ifdef OS_WIN - string tmp; - EncodingUtil::UTF8ToSJIS(text, &tmp); - return tmp; -#else - return text; -#endif -} - -void DisplayPreedit(const commands::Output &output) { - if (output.has_preedit()) { - string value; - for (size_t i = 0; i < output.preedit().segment_size(); ++i) { - value += output.preedit().segment(i).value(); - } - cout << UTF8ToTtyString(value) << '\r'; - } else if (output.has_result()) { - cout << UTF8ToTtyString(output.result().value()) << endl; - } -} - // Parses key events. If |input| gets EOF, returns false. bool ReadKeys(istream *input, vector *keys, @@ -179,10 +154,6 @@ int Loop(istream *input) { VLOG(2) << "Sending to Renderer: " << renderer_command.DebugString(); renderer_client->ExecCommand(renderer_command); } - - if (FLAGS_display_preedit) { - mozc::DisplayPreedit(output); - } } if (!answer.empty() && (output.result().value() != answer)) { LOG(ERROR) << "wrong value: " << output.result().value() diff --git a/src/client/client_stress_test_main.cc b/src/client/client_stress_test_main.cc index 14b6646db..3e10a75d0 100644 --- a/src/client/client_stress_test_main.cc +++ b/src/client/client_stress_test_main.cc @@ -36,9 +36,6 @@ #include #endif // OS_WIN -#include // NOLINT - -#include "base/encoding_util.h" #include "base/file_stream.h" #include "base/flags.h" #include "base/logging.h" @@ -57,42 +54,11 @@ DEFINE_int32(max_keyevents, 100000, "test at most |max_keyevents| key sequences"); DEFINE_string(server_path, "", "specify server path"); DEFINE_int32(key_duration, 10, "key duration (msec)"); -DEFINE_bool(display_preedit, true, "display predit to tty"); DEFINE_bool(test_renderer, false, "test renderer"); DEFINE_bool(test_testsendkey, true, "test TestSendKey"); DECLARE_bool(logtostderr); -namespace mozc { -namespace { - -void DisplayPreedit(const commands::Output &output) { - // TODO(taku): display segment attributes - if (output.has_preedit()) { - string value; - for (size_t i = 0; i < output.preedit().segment_size(); ++i) { - value += output.preedit().segment(i).value(); - } -#ifdef OS_WIN - string tmp; - EncodingUtil::UTF8ToSJIS(value, &tmp); - cout << tmp << '\r'; -#else - cout << value << '\r'; -#endif // OS_WIN - } else if (output.has_result()) { -#ifdef OS_WIN - string tmp; - EncodingUtil::UTF8ToSJIS(output.result().value(), &tmp); - cout << tmp << endl; -#else - cout << output.result().value() << endl; -#endif // OS_WIN - } -} -} // namespace -} // namespace mozc - int main(int argc, char **argv) { InitGoogle(argv[0], &argc, &argv, false); @@ -162,10 +128,6 @@ int main(int argc, char **argv) { client.SendKey(keys[i], &output); VLOG(2) << "Output of SendKey: " << output.DebugString(); - if (FLAGS_display_preedit) { - mozc::DisplayPreedit(output); - } - if (renderer_client.get() != NULL) { renderer_command.set_type(mozc::commands::RendererCommand::UPDATE); renderer_command.set_visible(output.has_candidates()); diff --git a/src/mozc_version_template.txt b/src/mozc_version_template.txt index b4e98d4c0..964a191e7 100644 --- a/src/mozc_version_template.txt +++ b/src/mozc_version_template.txt @@ -1,6 +1,6 @@ MAJOR=2 MINOR=17 -BUILD=2141 +BUILD=2142 REVISION=102 # NACL_DICTIONARY_VERSION is the target version of the system dictionary to be # downloaded by NaCl Mozc.