[libcxx] r180108 - Zero-initialize all mbstate_t in the codecvt tests.

Howard Hinnant hhinnant at apple.com
Tue Apr 23 07:09:36 PDT 2013


Author: hhinnant
Date: Tue Apr 23 09:09:35 2013
New Revision: 180108

URL: http://llvm.org/viewvc/llvm-project?rev=180108&view=rev
Log:
Zero-initialize all mbstate_t in the codecvt tests.

Modified:
    libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp
    libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp
    libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp
    libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp
    libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp
    libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp
    libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp
    libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp
    libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp
    libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp
    libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp
    libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp
    libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp

Modified: libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp?rev=180108&r1=180107&r2=180108&view=diff
==============================================================================
--- libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp (original)
+++ libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp Tue Apr 23 09:09:35 2013
@@ -28,7 +28,7 @@ int main()
     const char from[] = "some text";
     F::intern_type to[9];
     const F& f = std::use_facet<F>(l);
-    std::mbstate_t mbs;
+    std::mbstate_t mbs = {0};
     const char* from_next = 0;
     F::intern_type* to_next = 0;
     assert(f.in(mbs, from, from + 9, from_next,

Modified: libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp?rev=180108&r1=180107&r2=180108&view=diff
==============================================================================
--- libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp (original)
+++ libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp Tue Apr 23 09:09:35 2013
@@ -22,7 +22,7 @@ int main()
 {
     std::locale l = std::locale::classic();
     const F& f = std::use_facet<F>(l);
-    std::mbstate_t mbs;
+    std::mbstate_t mbs = {0};
     const char from[] = "some text";
     assert(f.length(mbs, from, from+10, 0) == 0);
     assert(f.length(mbs, from, from+10, 8) == 8);

Modified: libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp?rev=180108&r1=180107&r2=180108&view=diff
==============================================================================
--- libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp (original)
+++ libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp Tue Apr 23 09:09:35 2013
@@ -31,7 +31,7 @@ int main()
     {
         F::intern_type from[9] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't'};
         char to[9] = {0};
-        std::mbstate_t mbs;
+        std::mbstate_t mbs = {0};
         const F::intern_type* from_next = 0;
         char* to_next = 0;
         F::result r = f.out(mbs, from, from + 9, from_next,

Modified: libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp?rev=180108&r1=180107&r2=180108&view=diff
==============================================================================
--- libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp (original)
+++ libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp Tue Apr 23 09:09:35 2013
@@ -26,7 +26,7 @@ int main()
     std::locale l = std::locale::classic();
     std::vector<char> to(3);
     const F& f = std::use_facet<F>(l);
-    std::mbstate_t mbs;
+    std::mbstate_t mbs = {0};
     char* to_next = 0;
     assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
     assert(to_next == to.data());

Modified: libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp?rev=180108&r1=180107&r2=180108&view=diff
==============================================================================
--- libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp (original)
+++ libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp Tue Apr 23 09:09:35 2013
@@ -28,7 +28,7 @@ int main()
     const char from[] = "some text";
     F::intern_type to[9];
     const F& f = std::use_facet<F>(l);
-    std::mbstate_t mbs;
+    std::mbstate_t mbs = {0};
     const char* from_next = 0;
     F::intern_type* to_next = 0;
     assert(f.in(mbs, from, from + 9, from_next,

Modified: libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp?rev=180108&r1=180107&r2=180108&view=diff
==============================================================================
--- libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp (original)
+++ libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp Tue Apr 23 09:09:35 2013
@@ -22,7 +22,7 @@ int main()
 {
     std::locale l = std::locale::classic();
     const F& f = std::use_facet<F>(l);
-    std::mbstate_t mbs;
+    std::mbstate_t mbs = {0};
     const char from[] = "some text";
     assert(f.length(mbs, from, from+10, 0) == 0);
     assert(f.length(mbs, from, from+10, 8) == 8);

Modified: libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp?rev=180108&r1=180107&r2=180108&view=diff
==============================================================================
--- libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp (original)
+++ libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp Tue Apr 23 09:09:35 2013
@@ -31,7 +31,7 @@ int main()
     {
         F::intern_type from[9] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't'};
         char to[9] = {0};
-        std::mbstate_t mbs;
+        std::mbstate_t mbs = {0};
         const F::intern_type* from_next = 0;
         char* to_next = 0;
         F::result r = f.out(mbs, from, from + 9, from_next,

Modified: libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp?rev=180108&r1=180107&r2=180108&view=diff
==============================================================================
--- libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp (original)
+++ libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp Tue Apr 23 09:09:35 2013
@@ -26,7 +26,7 @@ int main()
     std::locale l = std::locale::classic();
     std::vector<char> to(3);
     const F& f = std::use_facet<F>(l);
-    std::mbstate_t mbs;
+    std::mbstate_t mbs = {0};
     char* to_next = 0;
     assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
     assert(to_next == to.data());

Modified: libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp?rev=180108&r1=180107&r2=180108&view=diff
==============================================================================
--- libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp (original)
+++ libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp Tue Apr 23 09:09:35 2013
@@ -28,7 +28,7 @@ int main()
     const std::basic_string<F::intern_type> from("some text");
     std::vector<char> to(from.size());
     const F& f = std::use_facet<F>(l);
-    std::mbstate_t mbs;
+    std::mbstate_t mbs = {0};
     const char* from_next = 0;
     char* to_next = 0;
     assert(f.in(mbs, from.data(), from.data() + from.size(), from_next,

Modified: libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp?rev=180108&r1=180107&r2=180108&view=diff
==============================================================================
--- libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp (original)
+++ libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp Tue Apr 23 09:09:35 2013
@@ -22,7 +22,7 @@ int main()
 {
     std::locale l = std::locale::classic();
     const F& f = std::use_facet<F>(l);
-    std::mbstate_t mbs;
+    std::mbstate_t mbs = {0};
     const char from[10]= {0};
     assert(f.length(mbs, from, from+10, 0) == 0);
     assert(f.length(mbs, from, from+10, 9) == 9);

Modified: libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp?rev=180108&r1=180107&r2=180108&view=diff
==============================================================================
--- libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp (original)
+++ libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp Tue Apr 23 09:09:35 2013
@@ -28,7 +28,7 @@ int main()
     const std::basic_string<F::intern_type> from("some text");
     std::vector<char> to(from.size());
     const F& f = std::use_facet<F>(l);
-    std::mbstate_t mbs;
+    std::mbstate_t mbs = {0};
     const char* from_next = 0;
     char* to_next = 0;
     assert(f.out(mbs, from.data(), from.data() + from.size(), from_next,

Modified: libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp?rev=180108&r1=180107&r2=180108&view=diff
==============================================================================
--- libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp (original)
+++ libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp Tue Apr 23 09:09:35 2013
@@ -26,7 +26,7 @@ int main()
     std::locale l = std::locale::classic();
     std::vector<char> to(3);
     const F& f = std::use_facet<F>(l);
-    std::mbstate_t mbs;
+    std::mbstate_t mbs = {0};
     char* to_next = 0;
     assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
     assert(to_next == to.data());

Modified: libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp?rev=180108&r1=180107&r2=180108&view=diff
==============================================================================
--- libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp (original)
+++ libcxx/trunk/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp Tue Apr 23 09:09:35 2013
@@ -29,7 +29,7 @@ int main()
     {
         const std::basic_string<F::intern_type> from(L"some text");
         std::vector<char> to(from.size()+1);
-        std::mbstate_t mbs;
+        std::mbstate_t mbs = {0};
         const F::intern_type* from_next = 0;
         char* to_next = 0;
         F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
@@ -43,7 +43,7 @@ int main()
         std::basic_string<F::intern_type> from(L"some text");
         from[4] = '\0';
         std::vector<char> to(from.size()+1);
-        std::mbstate_t mbs;
+        std::mbstate_t mbs = {0};
         const F::intern_type* from_next = 0;
         char* to_next = 0;
         F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
@@ -56,7 +56,7 @@ int main()
     {
         std::basic_string<F::intern_type> from(L"some text");
         std::vector<char> to(from.size()-1);
-        std::mbstate_t mbs;
+        std::mbstate_t mbs = {0};
         const F::intern_type* from_next = 0;
         char* to_next = 0;
         F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,





More information about the cfe-commits mailing list