1f92157deSopenharmony_ci# Googletest Samples 2f92157deSopenharmony_ci 3f92157deSopenharmony_ciIf you're like us, you'd like to look at 4f92157deSopenharmony_ci[googletest samples.](https://github.com/google/googletest/blob/main/googletest/samples) 5f92157deSopenharmony_ciThe sample directory has a number of well-commented samples showing how to use a 6f92157deSopenharmony_civariety of googletest features. 7f92157deSopenharmony_ci 8f92157deSopenharmony_ci* Sample #1 shows the basic steps of using googletest to test C++ functions. 9f92157deSopenharmony_ci* Sample #2 shows a more complex unit test for a class with multiple member 10f92157deSopenharmony_ci functions. 11f92157deSopenharmony_ci* Sample #3 uses a test fixture. 12f92157deSopenharmony_ci* Sample #4 teaches you how to use googletest and `googletest.h` together to 13f92157deSopenharmony_ci get the best of both libraries. 14f92157deSopenharmony_ci* Sample #5 puts shared testing logic in a base test fixture, and reuses it in 15f92157deSopenharmony_ci derived fixtures. 16f92157deSopenharmony_ci* Sample #6 demonstrates type-parameterized tests. 17f92157deSopenharmony_ci* Sample #7 teaches the basics of value-parameterized tests. 18f92157deSopenharmony_ci* Sample #8 shows using `Combine()` in value-parameterized tests. 19f92157deSopenharmony_ci* Sample #9 shows use of the listener API to modify Google Test's console 20f92157deSopenharmony_ci output and the use of its reflection API to inspect test results. 21f92157deSopenharmony_ci* Sample #10 shows use of the listener API to implement a primitive memory 22f92157deSopenharmony_ci leak checker. 23