-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
条件判定(KEYCODE)が常にfalseになる警告修正 #2023
base: master
Are you sure you want to change the base?
条件判定(KEYCODE)が常にfalseになる警告修正 #2023
Conversation
|
✅ Build sakura 1.0.4462 completed (commit e341d38dd2 by @gorogoro123) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
対応ありがとうございます。
str = profile_data::ToString(code); | ||
ASSERT_STREQ(L"\x01", str.c_str()); | ||
|
||
code = 0x61; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code = 0x61; | |
code = 'a'; |
/*! | ||
* @brief ToString(KEYCODE)のテスト | ||
*/ | ||
TEST(profile_data, ToString_KEYCODE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
219行目の TryParse_WCHAR と構成を合わせるとよりよいかもです。
やってることは
- 妥当な値を渡して parse できることの確認。
- 不正な値を渡して parse できないことの確認。(値が変わらない)
- 妥当な値を渡して parse できることの確認。
です。
書いてくれたものほうがより細かい確認をできていますが、上記2の確認ができてないです。
PR対象
カテゴリ
PR の背景
Clang/LLVM でbuild時に "-Wtautological-constant-out-of-range-compare" のwarningが出力される。
CDataProfile.h(229,39): warning : result of comparison of constant 128 with expression of type 'KEYCODE' (aka 'char') is always false [-Wtautological-constant-out-of-range-compare]
KEYCODE型(char) の変数の範囲は -128~127、128は範囲外。
仕様・動作説明
PR の影響範囲
影響なし。
テスト内容
変更前後で unit test が PASS することを確認します。
関連 issue, PR
#1548
参考資料
https://cpprefjp.github.io/reference/limits/numeric_limits.html