0

在谷歌测试中,人们可以TestWithParam在夹具中使用自定义参数。也就是写一个继承testing::TestWithParam<Customed_Params>类的类,里面Customed_Params是我自己定义的类,里面保存着自定义的参数,比如int和string的混合。

但是在谷歌基准库(性能测试库)中,没有TestWithParam. 该类有Args()成员函数Benchmark,但它只接受int64_t类型参数,我的std::string类型参数不能传递。

IE

BENCHMARK_REGISTER_F(AreaResizeFast_Fixture, cv)
    ->Unit(benchmark::kMillisecond)
    ->UseRealTime()
    ->Args({"1.jpg", 2, 2})  // the 1.jpg can't be passed
    ->Args({"2.jpg", 3, 3}); // the 2.jpg can't be passed
4

0 回答 0