c_cpp googletest单元测试的模板
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp googletest单元测试的模板相关的知识,希望对你有一定的参考价值。
#include <gtest/gtest.h>
namespace // anonymous
{
TEST(TestWithoutFixture, DISABLED_testFunction)
{
FAIL();
//EXPECT_TRUE(condition);
//EXPECT_FALSE(condition);
//EXPECT_EQ(expected, actual);
//EXPECT_NE(val1, val2);
//EXPECT_LT(val1, val2);
//EXPECT_LE(val1, val2);
//EXPECT_GT(val1, val2);
//EXPECT_GE(val1, val2);
//EXPECT_STREQ(expected_str, actual_str);
//EXPECT_STRNE(str1, str2);
//EXPECT_STRCASEEQ(expected_str, actual_str);
//EXPECT_STRCASENE(str1, str2);
//EXPECT_FLOAT_EQ(expected, actual);
//EXPECT_DOUBLE_EQ(expected, actual);
//EXPECT_NEAR(val1, val2, abs_error);
//EXPECT_PRED1(pred1, val1);
//EXPECT_PRED2(pred2, val1, val2);
//EXPECT_THROW(statement, exception_type);
//EXPECT_ANY_THROW(statement);
//EXPECT_NO_THROW(statement);
//EXPECT_DEATH(statement, regex);
//EXPECT_DEATH_IF_SUPPORTED(statement, regex);
//EXPECT_EXIT(statement, predicate, regex);
//EXPECT_NO_FATAL_FAILURE(statement);
}
class TestWithFixture : public ::testing::Test
{
};
TEST_F(TestWithFixture, DISABLED_testFunction)
{
FAIL();
}
} // anonymous namespace
以上是关于c_cpp googletest单元测试的模板的主要内容,如果未能解决你的问题,请参考以下文章
[QtCratot]_0_0_googletest单元测试
一文掌握谷歌 C++ 单元测试框架 GoogleTest
一文掌握谷歌 C++ 单元测试框架 GoogleTest
一文掌握谷歌 C++ 单元测试框架 GoogleTest
一文掌握谷歌 C++ 单元测试框架 GoogleTest
单元测试框架GoogleTest