am 4955cde2: Merge "Add a regression test for a fixed strnlen bug."

* commit '4955cde2c55d4860f12039a96d14fc756b1308a3':
  Add a regression test for a fixed strnlen bug.
This commit is contained in:
Elliott Hughes 2015-07-28 15:30:24 +00:00 committed by Android Git Automerger
commit c9bee10805

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)));