c++ - GoogleTest 通过引用初始化

标签 c++ googletest

是什么原因,为什么GoogleTest对参数计数使用引用?

  testing::InitGoogleTest(&argc, argv);

(我的意思是:据我了解,这是一个输入参数,没有任何区别 是否提供了值或地址)

最佳答案

参见 comments .

// Initializes Google Test.  This must be called before calling
// RUN_ALL_TESTS().  In particular, it parses a command line for the
// flags that Google Test recognizes.  Whenever a Google Test flag is
// seen, it is removed from argv, and *argc is decremented.

关于c++ - GoogleTest 通过引用初始化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34752224/

相关文章:

C++ makefile 找不到 hdf5 的共享库

c++ - Windows 已触发断点

c++ - 公开 protected 内部类

c++ - 为什么 Google Test 不打印堆栈跟踪或文件名?

c++ - CMake + GoogleTest 在小型库集合中给出重新定义错误

c++ - gtest 类型参数化的多态性

c++ - 如何使用模板在C++中创建两个非常相似的成员函数

回调中生产者和消费者之间的 C++ 循环模板依赖

c++ - 在实例 "std::runtime_error"Hiphop-Php 上终止

unit-testing - 谷歌模拟的期望