Fixed a bug in wstring_convert concerning zero-length inputs. Thanks to Jonathan Coxhead for reporting this bug.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@160136 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2012-07-12 18:07:41 +00:00
parent 591e32d624
commit 1ca23672a0
3 changed files with 8 additions and 2 deletions

View File

@@ -33,5 +33,7 @@ int main()
assert(ws == L"\x40003");
ws = myconv.from_bytes(bs.data(), bs.data() + bs.size());
assert(ws == L"\x40003");
ws = myconv.from_bytes("");
assert(ws.size() == 0);
}
}

View File

@@ -33,5 +33,7 @@ int main()
assert(bs == "\xF1\x80\x80\x83");
bs = myconv.to_bytes(ws.data(), ws.data() + ws.size());
assert(bs == "\xF1\x80\x80\x83");
bs = myconv.to_bytes(L"");
assert(bs.size() == 0);
}
}