Skip to content

Commit ab48745

Browse files
committed
updated standard in wchar.yaml; improved test for 0 count
1 parent bf6863b commit ab48745

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

libc/include/wchar.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ functions:
5252
- type: size_t
5353
- name: wmempcpy
5454
standards:
55-
- stdc
55+
- gnu
5656
return_type: wchar_t *
5757
arguments:
5858
- type: wchar_t *

libc/test/src/wchar/wmempcpy_test.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@ TEST(LlvmLibcWMempcpyTest, Simple) {
2525

2626
TEST(LlvmLibcWmempcpyTest, ZeroCount) {
2727
const wchar_t *src = L"12345";
28-
wchar_t dest[10];
28+
wchar_t dest[5] = {};
2929
void *result = LIBC_NAMESPACE::wmempcpy(dest, src, 0);
3030
ASSERT_EQ(static_cast<wchar_t *>(result), dest);
31+
32+
ASSERT_TRUE(dest[0] == 0);
33+
ASSERT_TRUE(dest[1] == 0);
34+
ASSERT_TRUE(dest[2] == 0);
35+
ASSERT_TRUE(dest[3] == 0);
36+
ASSERT_TRUE(dest[4] == 0);
3137
}
3238

3339
TEST(LlvmLibcWMempcpyTest, BoundaryCheck) {

0 commit comments

Comments
 (0)