• Google Test Primer(入门) (二)——基本概念


    Basic Concepts


    基本概念


    When using Google Test, you start by writing assertions, which are statements that check whether a condition is true. An assertion's result can be success, nonfatal failure, or fatal failure. If a fatal failure occurs, it aborts the current function; otherwise the program continues normally.

    当使用Google Test时,从编写测试条件是否为真断言的语句开始。一个断言的结果可以成功,非致命的失败和致命的失败。如果致命的失败发生了,测试将终止当前函数,否则程序将继续运行。

    Tests use assertions to verify the tested code's behavior. If a test crashes or has a failed assertion, then it fails; otherwise it succeeds.

    测试使用断言确保测试代码行为,如果测试crash了或者断言失败,测试将失败,否则测试成功。


    A test case contains one or many tests. You should group your tests into test cases that reflect the structure of the tested code. When multiple tests in a test case need to share common objects and subroutines, you can put them into a test fixture class.

    一个test case(测试案例)包含一个或多个测试。应该组合你的测试到反射出测试代码结构的测试案例中,当一个测试案例中有多个测试需要共享对象和子过程时,应该将它们放置在一个test fixture类中。


    A test program can contain multiple test cases.

    一个测试程序可以包含多个测试案例


    We'll now explain how to write a test program, starting at the individual assertion level and building up to tests and test cases.

    我们将描述如何编写测试程序,开始使用独立的断言条件和构建测试以及测试案例。

  • 相关阅读:
    IdentityServer4学习笔记
    常用链接地址
    c++ 多线程(2000个)端口扫描(附源码)
    C++ 定时器Timer在项目中的使用
    [Under the hood]---Matt Pietrek October 1996 MSJ
    [under the hood]Reduce EXE and DLL Size with LIBCTINY.LIB
    TN035: Using Multiple Resource Files and Header Files with Visual C++
    单文件版本的netframework的net core 2.1
    Dependency Walker的替代品Dependencies
    怎么使用gradle给spring 打thinjar(gradle 7)
  • 原文地址:https://www.cnblogs.com/ubunoon/p/GoogleTestPrimerConcept.html
Copyright © 2020-2023  润新知