gpt4 book ai didi

c++ - 获取谷歌测试异常抛出消息

转载 作者:可可西里 更新时间:2023-11-01 17:45:18 26 4
gpt4 key购买 nike

<分区>

我正在为我的项目使用谷歌测试框架。我从代码中抛出异常:

throw DerivedClassException("message");  

并在测试框架中使用 as:

ASSERT_THROW(commond(), DerivedClassException);  

我想通过 what() API 获取消息。获取异常的确切异常消息的任何方式。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com