Zero-initialize all mbstate_t in the codecvt tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180108 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
08dd25303e
commit
9c2ce95063
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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());
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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());
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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());
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user