mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/140472 Approved by: https://github.com/ezyang
15 lines
356 B
C++
15 lines
356 B
C++
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
#include <c10/util/error.h>
|
|
#include <gtest/gtest.h>
|
|
#include <cstring>
|
|
|
|
using namespace ::testing;
|
|
|
|
TEST(StrErrorTest, cmp_test) {
|
|
for (int err = 0; err <= EACCES; err++) {
|
|
// NOLINTNEXTLINE(concurrency-mt-unsafe)
|
|
ASSERT_EQ(c10::utils::str_error(err), std::string(strerror(err)));
|
|
}
|
|
}
|