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";
|
const char from[] = "some text";
|
||||||
F::intern_type to[9];
|
F::intern_type to[9];
|
||||||
const F& f = std::use_facet<F>(l);
|
const F& f = std::use_facet<F>(l);
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
const char* from_next = 0;
|
const char* from_next = 0;
|
||||||
F::intern_type* to_next = 0;
|
F::intern_type* to_next = 0;
|
||||||
assert(f.in(mbs, from, from + 9, from_next,
|
assert(f.in(mbs, from, from + 9, from_next,
|
||||||
|
@ -22,7 +22,7 @@ int main()
|
|||||||
{
|
{
|
||||||
std::locale l = std::locale::classic();
|
std::locale l = std::locale::classic();
|
||||||
const F& f = std::use_facet<F>(l);
|
const F& f = std::use_facet<F>(l);
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
const char from[] = "some text";
|
const char from[] = "some text";
|
||||||
assert(f.length(mbs, from, from+10, 0) == 0);
|
assert(f.length(mbs, from, from+10, 0) == 0);
|
||||||
assert(f.length(mbs, from, from+10, 8) == 8);
|
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'};
|
F::intern_type from[9] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't'};
|
||||||
char to[9] = {0};
|
char to[9] = {0};
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
const F::intern_type* from_next = 0;
|
const F::intern_type* from_next = 0;
|
||||||
char* to_next = 0;
|
char* to_next = 0;
|
||||||
F::result r = f.out(mbs, from, from + 9, from_next,
|
F::result r = f.out(mbs, from, from + 9, from_next,
|
||||||
|
@ -26,7 +26,7 @@ int main()
|
|||||||
std::locale l = std::locale::classic();
|
std::locale l = std::locale::classic();
|
||||||
std::vector<char> to(3);
|
std::vector<char> to(3);
|
||||||
const F& f = std::use_facet<F>(l);
|
const F& f = std::use_facet<F>(l);
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
char* to_next = 0;
|
char* to_next = 0;
|
||||||
assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
|
assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
|
||||||
assert(to_next == to.data());
|
assert(to_next == to.data());
|
||||||
|
@ -28,7 +28,7 @@ int main()
|
|||||||
const char from[] = "some text";
|
const char from[] = "some text";
|
||||||
F::intern_type to[9];
|
F::intern_type to[9];
|
||||||
const F& f = std::use_facet<F>(l);
|
const F& f = std::use_facet<F>(l);
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
const char* from_next = 0;
|
const char* from_next = 0;
|
||||||
F::intern_type* to_next = 0;
|
F::intern_type* to_next = 0;
|
||||||
assert(f.in(mbs, from, from + 9, from_next,
|
assert(f.in(mbs, from, from + 9, from_next,
|
||||||
|
@ -22,7 +22,7 @@ int main()
|
|||||||
{
|
{
|
||||||
std::locale l = std::locale::classic();
|
std::locale l = std::locale::classic();
|
||||||
const F& f = std::use_facet<F>(l);
|
const F& f = std::use_facet<F>(l);
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
const char from[] = "some text";
|
const char from[] = "some text";
|
||||||
assert(f.length(mbs, from, from+10, 0) == 0);
|
assert(f.length(mbs, from, from+10, 0) == 0);
|
||||||
assert(f.length(mbs, from, from+10, 8) == 8);
|
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'};
|
F::intern_type from[9] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't'};
|
||||||
char to[9] = {0};
|
char to[9] = {0};
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
const F::intern_type* from_next = 0;
|
const F::intern_type* from_next = 0;
|
||||||
char* to_next = 0;
|
char* to_next = 0;
|
||||||
F::result r = f.out(mbs, from, from + 9, from_next,
|
F::result r = f.out(mbs, from, from + 9, from_next,
|
||||||
|
@ -26,7 +26,7 @@ int main()
|
|||||||
std::locale l = std::locale::classic();
|
std::locale l = std::locale::classic();
|
||||||
std::vector<char> to(3);
|
std::vector<char> to(3);
|
||||||
const F& f = std::use_facet<F>(l);
|
const F& f = std::use_facet<F>(l);
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
char* to_next = 0;
|
char* to_next = 0;
|
||||||
assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
|
assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
|
||||||
assert(to_next == to.data());
|
assert(to_next == to.data());
|
||||||
|
@ -28,7 +28,7 @@ int main()
|
|||||||
const std::basic_string<F::intern_type> from("some text");
|
const std::basic_string<F::intern_type> from("some text");
|
||||||
std::vector<char> to(from.size());
|
std::vector<char> to(from.size());
|
||||||
const F& f = std::use_facet<F>(l);
|
const F& f = std::use_facet<F>(l);
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
const char* from_next = 0;
|
const char* from_next = 0;
|
||||||
char* to_next = 0;
|
char* to_next = 0;
|
||||||
assert(f.in(mbs, from.data(), from.data() + from.size(), from_next,
|
assert(f.in(mbs, from.data(), from.data() + from.size(), from_next,
|
||||||
|
@ -22,7 +22,7 @@ int main()
|
|||||||
{
|
{
|
||||||
std::locale l = std::locale::classic();
|
std::locale l = std::locale::classic();
|
||||||
const F& f = std::use_facet<F>(l);
|
const F& f = std::use_facet<F>(l);
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
const char from[10]= {0};
|
const char from[10]= {0};
|
||||||
assert(f.length(mbs, from, from+10, 0) == 0);
|
assert(f.length(mbs, from, from+10, 0) == 0);
|
||||||
assert(f.length(mbs, from, from+10, 9) == 9);
|
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");
|
const std::basic_string<F::intern_type> from("some text");
|
||||||
std::vector<char> to(from.size());
|
std::vector<char> to(from.size());
|
||||||
const F& f = std::use_facet<F>(l);
|
const F& f = std::use_facet<F>(l);
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
const char* from_next = 0;
|
const char* from_next = 0;
|
||||||
char* to_next = 0;
|
char* to_next = 0;
|
||||||
assert(f.out(mbs, from.data(), from.data() + from.size(), from_next,
|
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::locale l = std::locale::classic();
|
||||||
std::vector<char> to(3);
|
std::vector<char> to(3);
|
||||||
const F& f = std::use_facet<F>(l);
|
const F& f = std::use_facet<F>(l);
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
char* to_next = 0;
|
char* to_next = 0;
|
||||||
assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
|
assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
|
||||||
assert(to_next == to.data());
|
assert(to_next == to.data());
|
||||||
|
@ -29,7 +29,7 @@ int main()
|
|||||||
{
|
{
|
||||||
const std::basic_string<F::intern_type> from(L"some text");
|
const std::basic_string<F::intern_type> from(L"some text");
|
||||||
std::vector<char> to(from.size()+1);
|
std::vector<char> to(from.size()+1);
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
const F::intern_type* from_next = 0;
|
const F::intern_type* from_next = 0;
|
||||||
char* to_next = 0;
|
char* to_next = 0;
|
||||||
F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
|
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");
|
std::basic_string<F::intern_type> from(L"some text");
|
||||||
from[4] = '\0';
|
from[4] = '\0';
|
||||||
std::vector<char> to(from.size()+1);
|
std::vector<char> to(from.size()+1);
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
const F::intern_type* from_next = 0;
|
const F::intern_type* from_next = 0;
|
||||||
char* to_next = 0;
|
char* to_next = 0;
|
||||||
F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
|
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::basic_string<F::intern_type> from(L"some text");
|
||||||
std::vector<char> to(from.size()-1);
|
std::vector<char> to(from.size()-1);
|
||||||
std::mbstate_t mbs;
|
std::mbstate_t mbs = {0};
|
||||||
const F::intern_type* from_next = 0;
|
const F::intern_type* from_next = 0;
|
||||||
char* to_next = 0;
|
char* to_next = 0;
|
||||||
F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
|
F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
|
||||||
|
Loading…
Reference in New Issue
Block a user