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

CMemory::AppendRawDataのテストを追加 #1643

Merged
merged 1 commit into from Apr 23, 2021

Conversation

beru
Copy link
Contributor

@beru beru commented Apr 23, 2021

PR の目的

CMemory::AppendRawData のテストを追加する事で不具合が検出されやすいようにします。

カテゴリ

  • リファクタリング

PR の背景

#1638 で不具合の修正が行われたので、今後同様の不具合が入る事を防止する為にテストを追加しました。

PR のメリット

今後 CMemory::AppendRawData の実装が再度変更された際に同様の不具合が入る事を防ぎやすくなるのではないかと思います。

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

テストの実行時間が少し増えます。

仕様・動作説明

テスト追加なので本体の動作には影響はありません。

PR の影響範囲

テスト追加なので本体の動作には影響はありません。

テスト内容

  • Test Explorer で追加したテスト CMemory, AppendRawData を実行して緑の Passed になる事を確認しました。
  • CMemory::AppendRawData()でAllocBuffer条件ミスを修正 #1638 の修正を revert してから sakura プロジェクトをビルド後に、Test Explorer で追加したテスト CMemory, AppendRawData を実行すると赤の Failed になる事を確認しました。

関連 issue, PR

#1638

@beru beru added the UnitTest label Apr 23, 2021
@sonarcloud
Copy link

sonarcloud bot commented Apr 23, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@AppVeyorBot
Copy link

Build sakura 1.0.3703 completed (commit aa462973bb by @beru)

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.

CMemoryは将来的に、完全に廃止したいと考えています。

廃止する理由「テストコードのないレガシーコードなので」を考えていましたが、そういえばこないだの変更でテストコード付けたのを思い出し、「特に問題ない」の結論に至りました。

テスト内容自体は問題ないと思います。

@beru
Copy link
Contributor Author

beru commented Apr 23, 2021

レビューありがとうございます。Mergeします。

@beru beru merged commit 4134b90 into sakura-editor:master Apr 23, 2021
@beru beru deleted the test_CMemory_AppendRawData branch April 23, 2021 18:58
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.

None yet

3 participants