forked from OSchip/llvm-project
Update errcat.objects tests so they test the bug fixed in r272640.
llvm-svn: 272642
This commit is contained in:
parent
61df7909ab
commit
db72c625e2
|
@ -18,10 +18,13 @@
|
|||
#include <string>
|
||||
#include <cerrno>
|
||||
|
||||
void test_message_leaves_errno_unchanged() {
|
||||
#include "test_macros.h"
|
||||
|
||||
void test_message_for_bad_value() {
|
||||
errno = E2BIG; // something that message will never generate
|
||||
const std::error_category& e_cat1 = std::generic_category();
|
||||
e_cat1.message(-1);
|
||||
const std::string msg = e_cat1.message(-1);
|
||||
LIBCPP_ASSERT(msg == "Unknown error -1");
|
||||
assert(errno == E2BIG);
|
||||
}
|
||||
|
||||
|
@ -31,6 +34,6 @@ int main()
|
|||
std::string m1 = e_cat1.name();
|
||||
assert(m1 == "generic");
|
||||
{
|
||||
test_message_leaves_errno_unchanged();
|
||||
test_message_for_bad_value();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,11 +18,13 @@
|
|||
#include <string>
|
||||
#include <cerrno>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
void test_message_leaves_errno_unchanged() {
|
||||
void test_message_for_bad_value() {
|
||||
errno = E2BIG; // something that message will never generate
|
||||
const std::error_category& e_cat1 = std::system_category();
|
||||
e_cat1.message(-1);
|
||||
const std::string msg = e_cat1.message(-1);
|
||||
LIBCPP_ASSERT(msg == "Unknown error -1");
|
||||
assert(errno == E2BIG);
|
||||
}
|
||||
|
||||
|
@ -36,6 +38,6 @@ int main()
|
|||
assert(e_cond.value() == 5000);
|
||||
assert(e_cond.category() == std::system_category());
|
||||
{
|
||||
test_message_leaves_errno_unchanged();
|
||||
test_message_for_bad_value();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue