Merge "Add a regression test for a fixed strnlen bug."

This commit is contained in:
Elliott Hughes 2015-07-28 14:55:50 +00:00 committed by Gerrit Code Review
commit 4955cde2c5

View File

@ -22,6 +22,7 @@
#include <gtest/gtest.h>
#include <malloc.h>
#include <math.h>
#include <stdint.h>
#include "buffer_tests.h"
@ -1396,6 +1397,10 @@ TEST(string, strnlen_147048) {
delete[] heap_src;
}
TEST(string, strnlen_74741) {
ASSERT_EQ(4U, strnlen("test", SIZE_MAX));
}
TEST(string, mempcpy) {
char dst[6];
ASSERT_EQ(&dst[4], reinterpret_cast<char*>(mempcpy(dst, "hello", 4)));