.. _samples: =========== サンプル =========== .. Google C++ Testing Framework Samples *Google C++ Testing Framework サンプル* .. If you're like us, you'd like to look at some Google Test sample code. The samples folder has a number of well-commented samples showing how to use a variety of Google Test features. あなたも Google Test のサンプルコードを見てみたいと思うかもしれません. `サンプルフォルダ `_ には,コメントが書かれた多くのサンプルがあり,これらは Google Test の様々な機能の説明になっています. .. Sample #1 shows the basic steps of using Google Test to test C++ functions. .. Sample #2 shows a more complex unit test for a class with multiple member functions. .. Sample #3 uses a test fixture. .. Sample #4 puts shared testing logic in a base test fixture, and reuses it in derived fixtures. .. Sample #5 teaches how to reuse a test fixture in multiple test cases by deriving sub-fixtures from it. .. Sample #6 demonstrates type-parameterized tests. .. Sample #7 teaches the basics of value-parameterized tests. .. Sample #8 shows using Combine() in value-parameterized tests. .. Sample #9 shows use of the listener API to modify Google Test's console output and the use of its reflection API to inspect test results. .. Sample #10 shows use of the listener API to implement a primitive memory leak checker. * `Sample #1 `_ C++ の関数をテストするための, Google Test の基本的な使い方を説明します. * `Sample #2 `_ 複数のメンバ関数を持つクラスに対する,より複雑なユニットテストを説明します. * `Sample #3 `_ テストフィクスチャを利用します. * `Sample #4 `_ 基底テストフィクスチャクラスに共有のテストロジックを書き,派生クラスでそれらを再利用する方法を説明します. * `Sample #5 `_ テストフィクスチャから派生したサブフィクスチャを利用して,それを複数のテストケースで再利用する方法を説明します. * `Sample #6 `_ 値をパラメータ化したテストの例を示します. * `Sample #7 `_ 値をパラメータ化したテストの基本を説明します. * `Sample #8 `_ 値をパラメータ化したテスト内で Combine() を利用する方法を説明します. * `Sample #9 `_ Google Test のコンソール出力を変更するリスナーAPIと,テスト結果を検査するリフレクションAPIの使い方を説明します. * `Sample #10 `_ リスナーAPIを使って,簡単なメモリリークチェッカを実装する方法を説明します.