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:
commit
c9bee10805
@ -22,6 +22,7 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "buffer_tests.h"
|
#include "buffer_tests.h"
|
||||||
|
|
||||||
@ -1396,6 +1397,10 @@ TEST(string, strnlen_147048) {
|
|||||||
delete[] heap_src;
|
delete[] heap_src;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(string, strnlen_74741) {
|
||||||
|
ASSERT_EQ(4U, strnlen("test", SIZE_MAX));
|
||||||
|
}
|
||||||
|
|
||||||
TEST(string, mempcpy) {
|
TEST(string, mempcpy) {
|
||||||
char dst[6];
|
char dst[6];
|
||||||
ASSERT_EQ(&dst[4], reinterpret_cast<char*>(mempcpy(dst, "hello", 4)));
|
ASSERT_EQ(&dst[4], reinterpret_cast<char*>(mempcpy(dst, "hello", 4)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user