From: Louis Dionne Date: Wed, 28 Oct 2020 13:24:51 +0000 (-0400) Subject: [libc++] Remove from some system_error tests X-Git-Tag: llvmorg-13-init~7877 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=201184b30b286340e323c08d7d1f5f86cfa15489;p=platform%2Fupstream%2Fllvm.git [libc++] Remove from some system_error tests The explicit call to `std::setlocale(LC_ALL, "C")` isn't required, since the Standard already says the equivalent of this call is performed on program startup. --- diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp index 2bd8467..66137cb 100644 --- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp +++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp @@ -17,18 +17,15 @@ #include #include #include -#include #include "test_macros.h" -int main(int, char**) -{ - std::setlocale (LC_ALL, "C"); +int main(int, char**) { std::system_error se(static_cast(std::errc::not_a_directory), std::generic_category(), "some text"); assert(se.code() == std::make_error_code(std::errc::not_a_directory)); std::string what_message(se.what()); assert(what_message.find("Not a directory") != std::string::npos); - return 0; + return 0; } diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_const_char_pointer.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_const_char_pointer.pass.cpp index 86f4781..bcb797e 100644 --- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_const_char_pointer.pass.cpp +++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_const_char_pointer.pass.cpp @@ -17,13 +17,10 @@ #include #include #include -#include #include "test_macros.h" -int main(int, char**) -{ - std::setlocale (LC_ALL, "C"); +int main(int, char**) { std::string what_arg("test message"); std::system_error se(make_error_code(std::errc::not_a_directory), what_arg.c_str()); assert(se.code() == std::make_error_code(std::errc::not_a_directory)); @@ -31,5 +28,5 @@ int main(int, char**) assert(what_message.find(what_arg) != std::string::npos); assert(what_message.find("Not a directory") != std::string::npos); - return 0; + return 0; } diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_string.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_string.pass.cpp index 0bb3428..a464084 100644 --- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_string.pass.cpp +++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_string.pass.cpp @@ -17,13 +17,10 @@ #include #include #include -#include #include "test_macros.h" -int main(int, char**) -{ - std::setlocale (LC_ALL, "C"); +int main(int, char**) { std::string what_arg("test message"); std::system_error se(make_error_code(std::errc::not_a_directory), what_arg); assert(se.code() == std::make_error_code(std::errc::not_a_directory)); @@ -31,5 +28,5 @@ int main(int, char**) assert(what_message.find(what_arg) != std::string::npos); assert(what_message.find("Not a directory") != std::string::npos); - return 0; + return 0; } diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category.pass.cpp index bce564f..0024f07 100644 --- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category.pass.cpp +++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category.pass.cpp @@ -17,18 +17,15 @@ #include #include #include -#include #include "test_macros.h" -int main(int, char**) -{ - std::setlocale (LC_ALL, "C"); +int main(int, char**) { std::system_error se(static_cast(std::errc::not_a_directory), std::generic_category()); assert(se.code() == std::make_error_code(std::errc::not_a_directory)); std::string what_message(se.what()); assert(what_message.find("Not a directory") != std::string::npos); - return 0; + return 0; } diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_const_char_pointer.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_const_char_pointer.pass.cpp index 39e6958..521c359 100644 --- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_const_char_pointer.pass.cpp +++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_const_char_pointer.pass.cpp @@ -17,13 +17,10 @@ #include #include #include -#include #include "test_macros.h" -int main(int, char**) -{ - std::setlocale (LC_ALL, "C"); +int main(int, char**) { std::string what_arg("test message"); std::system_error se(static_cast(std::errc::not_a_directory), std::generic_category(), what_arg.c_str()); @@ -32,5 +29,5 @@ int main(int, char**) assert(what_message.find(what_arg) != std::string::npos); assert(what_message.find("Not a directory") != std::string::npos); - return 0; + return 0; } diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_string.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_string.pass.cpp index eac6ecf..2626fb8 100644 --- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_string.pass.cpp +++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_string.pass.cpp @@ -17,13 +17,10 @@ #include #include #include -#include #include "test_macros.h" -int main(int, char**) -{ - std::setlocale (LC_ALL, "C"); +int main(int, char**) { std::string what_arg("test message"); std::system_error se(static_cast(std::errc::not_a_directory), std::generic_category(), what_arg); @@ -32,5 +29,5 @@ int main(int, char**) assert(what_message.find(what_arg) != std::string::npos); assert(what_message.find("Not a directory") != std::string::npos); - return 0; + return 0; }