提交 699d18f1 编写于 作者: Y Yu Yang

Change unittest variable name

上级 ec790e10
...@@ -16,19 +16,19 @@ limitations under the License. */ ...@@ -16,19 +16,19 @@ limitations under the License. */
#include <gtest/gtest.h> #include <gtest/gtest.h>
TEST(Status, testAll) { TEST(Error, testAll) {
paddle::Error status; paddle::Error error;
ASSERT_TRUE(status.isOK()); ASSERT_TRUE(error.isOK());
status = paddle::ErrorF("I'm the error"); error = paddle::ErrorF("I'm the error");
ASSERT_FALSE(status.isOK()); ASSERT_FALSE(error.isOK());
ASSERT_STREQ("I'm the error", status.what()); ASSERT_STREQ("I'm the error", error.what());
status = paddle::ErrorF("error2"); error = paddle::ErrorF("error2");
ASSERT_FALSE(status.isOK()); ASSERT_FALSE(error.isOK());
ASSERT_STREQ("error2", status.what()); ASSERT_STREQ("error2", error.what());
int i = 3; int i = 3;
auto status3 = paddle::ErrorF("error%d", i); auto error3 = paddle::ErrorF("error%d", i);
ASSERT_FALSE(status3.isOK()); ASSERT_FALSE(error3.isOK());
ASSERT_STREQ("error3", status3.what()); ASSERT_STREQ("error3", error3.what());
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册