Conversation
41008f4 to
bd0fa76
Compare
fujiwarat
left a comment
There was a problem hiding this comment.
Thank you for the patch. I added some comments.
| if (res) { | ||
| printf("failed to init\n"); | ||
| fprintf(stderr, "failed to init\n"); | ||
| return 1; |
There was a problem hiding this comment.
I think it would be also good to replace 1 with EXIT_FAILURE.
| if (res) { | ||
| printf("failed to init\n"); | ||
| fprintf(stderr, "failed to init\n"); | ||
| return 1; |
| if (!ac) { | ||
| printf("failed to create context\n"); | ||
| fprintf(stderr, "failed to create context\n"); | ||
| return 1; |
| return 1; | ||
| } | ||
| anthy_release_context(ac); | ||
| return 0; |
There was a problem hiding this comment.
I think it would be also good to replace 0 with EXIT_SUCCESS.
| if (!ac) { | ||
| printf("failed to create context\n"); | ||
| fprintf(stderr, "failed to create context\n"); | ||
| return 1; |
| if (!ac) { | ||
| printf("failed to create context\n"); | ||
| fprintf(stderr, "failed to create context\n"); | ||
| return 1; |
| anthy_resize_segment(ac, nth, rsz); | ||
| } | ||
| anthy_release_context(ac); | ||
| return 0; |
| int ret; | ||
| (void)argc; | ||
| (void)argv; | ||
| ret = 0; |
There was a problem hiding this comment.
I think it would be also good to replace 0 with EXIT_SUCCESS.
| show_stat(db); | ||
| save_db(expdata, db); | ||
|
|
||
| return 0; |
There was a problem hiding this comment.
I think it would be also good to replace 0 with EXIT_SUCCESS.
| fprintf(stderr, "no input string specified\n"); | ||
| return EXIT_FAILURE; | ||
| } | ||
| use_utf8 = 1; |
There was a problem hiding this comment.
I think this change is pending.
Since anthy-unicode is designed to use the default encoding UTF-8, I think it would be better to set default_encoding is ANTHY_UTF8_ENCODING in anthy-unicode/src-main/main.c rather than this change .
I don't remember why it's still EUC_JP and need more tests with ibus-anthy.
Currently, the tests always exit with 0, even when they encounter an error, this results in meson always treating the test as a success.
Notably, the tests don't run correctly with
meson test -C build --verbose, since the CWDs aren't set correctly, this also fixes that.Keep in mind that meson still reports success despite #14 since the test itself doesn't error, although I can look into updating or adding a test for that later.
The prediction test is currently commented out since it relies on predictions in
~/.config/anthy(it is still built though).