[libc++] Remove <clocale> from some system_error tests
authorLouis Dionne <ldionne@apple.com>
Wed, 28 Oct 2020 13:24:51 +0000 (09:24 -0400)
committerLouis Dionne <ldionne@apple.com>
Wed, 28 Oct 2020 13:49:36 +0000 (09:49 -0400)
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.

libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp
libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_const_char_pointer.pass.cpp
libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_string.pass.cpp
libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category.pass.cpp
libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_const_char_pointer.pass.cpp
libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_string.pass.cpp

index 2bd8467..66137cb 100644 (file)
 #include <system_error>
 #include <string>
 #include <cassert>
-#include <clocale>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    std::setlocale (LC_ALL, "C");
+int main(int, char**) {
     std::system_error se(static_cast<int>(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;
 }
index 86f4781..bcb797e 100644 (file)
 #include <system_error>
 #include <string>
 #include <cassert>
-#include <clocale>
 
 #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;
 }
index 0bb3428..a464084 100644 (file)
 #include <system_error>
 #include <string>
 #include <cassert>
-#include <clocale>
 
 #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;
 }
index bce564f..0024f07 100644 (file)
 #include <system_error>
 #include <string>
 #include <cassert>
-#include <clocale>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    std::setlocale (LC_ALL, "C");
+int main(int, char**) {
     std::system_error se(static_cast<int>(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;
 }
index 39e6958..521c359 100644 (file)
 #include <system_error>
 #include <string>
 #include <cassert>
-#include <clocale>
 
 #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<int>(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;
 }
index eac6ecf..2626fb8 100644 (file)
 #include <system_error>
 #include <string>
 #include <cassert>
-#include <clocale>
 
 #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<int>(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;
 }