Skip to content
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

DISABLED テストのサンプルを追加する #943

Merged
merged 11 commits into from
Jun 22, 2019

Conversation

m-tmatma
Copy link
Member

@m-tmatma m-tmatma commented Jun 4, 2019

PR の目的

#877 で入れたテストがパスできるようになったので、DISABLED テストを削除するが
サンプルとしては残せるようにする。

カテゴリ

  • その他 (単体テストのサンプル追加)

PR の背景

#877 で入れたテストが失敗したテストを #905 で 無効化したが
パスできるようになったので、有効化したいが DISABLED テストのサンプルを残したい。

PR のメリット

#877 で入れたテストをパスさせるようにした後でも DISABLED テストのサンプルを残す

PR のデメリット (トレードオフとかあれば)

なし

PR の影響範囲

関連チケット

参考資料

https://github.com/google/googletest/blob/9d4cde44a4a3952cf21861f9370b3bed9265dfd7/googletest/docs/advanced.md#temporarily-disabling-tests

@m-tmatma m-tmatma added this to the v2.4.0 milestone Jun 4, 2019
@m-tmatma
Copy link
Member Author

m-tmatma commented Jun 4, 2019

コード修正しても codefactor の結果に反映されない

@m-tmatma
Copy link
Member Author

m-tmatma commented Jun 4, 2019

codefactor が参照してるコミットが古いままになってる

Copy link
Contributor

@berryzplus berryzplus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

対応ありがとうございます。

*/
class DISABLED_TestsImcomplte1 : public ::testing::Test
{

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

メモ: テストクラスのサンプル。未実装の機能をテストするクラスを、コードより先に書いてみるときに使う…。中身があった方がイメージはしやすいんだけど、これで十分かな?と思っています。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これは Test Fixture と呼ばれるものです。
#944 でサンプル追加しました。

以下参考サイト
http://opencv.jp/googletestdocs/primer.html#primer-test-fixtures

TEST_F(DISABLED_TestsImcomplte1, Test1)
{
/* 意図的に失敗させる */
EXPECT_EQ(1 + 2, 4);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

せっかく書いてもらったのに注文付けて恐縮ですが、(expected, actual)がいいです。

正確には、現時点で成立しないアサーションを記述したテストにdisableをくっ付けるはずです。(失敗させてるわけではない)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正しました。

@m-tmatma
Copy link
Member Author

m-tmatma commented Jun 7, 2019

codefactor が参照してるコミットが古いままになってる

通った。

@m-tmatma
Copy link
Member Author

レビュープリーズ


https://github.com/google/googletest/blob/9d4cde44a4a3952cf21861f9370b3bed9265dfd7/googletest/docs/advanced.md#temporarily-disabling-tests
*/
class DISABLED_TestsImcomplte1 : public ::testing::Test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

スペルに違和感があったのでググってしまいました。
https://ejje.weblio.jp/content/incomplete

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正しました。

Copy link
Contributor

@berryzplus berryzplus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

対応ありがとうございます。

@m-tmatma m-tmatma merged commit 6aa1163 into sakura-editor:master Jun 22, 2019
@m-tmatma m-tmatma deleted the feature/disabled-test-sample branch June 22, 2019 23:33
HoppingTappy pushed a commit to HoppingTappy/sakura that referenced this pull request Jun 16, 2020
…est-sample

DISABLED テストのサンプルを追加する
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DISABLEDテストのサンプルを導入したい
2 participants