Google Test 中的 Macro 到底是什么?
从Google Test 官方文档中得知,TEST()并不是函数,而是用来生成函数的宏。
Use the TEST() macro to define and name a test function. These are ordinary C++ functions that don’t return a value.
从这句话来看,这些宏是属于 C++宏系统的。
Unfortunately, the C++ macro system does not allow us to create a single macro that can handle both types of tests. Using the wrong macro causes a compiler error.
但是搜索「 C++ 宏」,找到的内容都是关于用#define定义宏的,#define是预处理处理器的一种,又被称为「宏」。
但是这个也没有用#define,而且语法也不太对。
这是怎么回事呢?有谁知道?