zoukankan      html  css  js  c++  java
  • 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.

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

  • 相关阅读:
    MSDN for 2010的那些麻烦事
    CPtrList操作--插入,删除特定元素,删除全部
    如何绕过ORA00701错误和降低bootstrap对象的高水位
    ORA00600:[1112]内部错误&ROW CACHE ENQUEUE LOCK一例
    CRS5008: Invalid attribute value
    ORA00600[kjpsod1]&ORA44203错误一例
    runInstaller ignoreInternalDriverError
    RMAN CURSOR_SHARING=EXACT脚本
    SQL调优:带函数的谓词导致CBO Cardinality计算误差
    11g Real Application Testing:Database Replay使用方法
  • 原文地址:https://www.cnblogs.com/ubunoon/p/GoogleTestPrimerConcept.html
Copyright © 2011-2022 走看看