Lines Matching refs:StrNCmp
238 // strncmp
239 EXPECT_EQ(0, strncmp("a", "b", 0));
240 EXPECT_EQ(0, strncmp("abcd", "abcd", 10));
241 EXPECT_EQ(0, strncmp("abcd", "abcef", 3));
242 EXPECT_GT(0, strncmp("abcde", "abcfa", 4));
243 EXPECT_GT(0, strncmp("a", "b", 5));
244 EXPECT_GT(0, strncmp("bc", "bcde", 4));
245 EXPECT_LT(0, strncmp("xyz", "xyy", 10));
246 EXPECT_LT(0, strncmp("baa", "aaa", 1));
247 EXPECT_LT(0, strncmp("zyx", "", 2));
319 void RunStrNCmpTest(PointerToStrNCmp StrNCmp) {
325 // Normal StrNCmp calls
326 Ident(StrNCmp(s1, s2, size + 2));
329 Ident(StrNCmp(s1 + size - 2, s2 + size - 2, size));
331 Ident(StrNCmp(s1 - 1, s2 - 1, 0));
332 Ident(StrNCmp(s1 + size - 1, s2 + size - 1, 1));
334 EXPECT_DEATH(Ident(StrNCmp)(s1 - 1, s2, 1), LeftOOBReadMessage(1));
335 EXPECT_DEATH(Ident(StrNCmp)(s1, s2 - 1, 1), LeftOOBReadMessage(1));
336 EXPECT_DEATH(Ident(StrNCmp)(s1 + size, s2, 1), RightOOBReadMessage(0));
337 EXPECT_DEATH(Ident(StrNCmp)(s1, s2 + size, 1), RightOOBReadMessage(0));
339 EXPECT_DEATH(Ident(StrNCmp)(s1 + 1, s2 + 1, size), RightOOBReadMessage(0));
340 EXPECT_DEATH(Ident(StrNCmp)(s1 + size - 1, s2, 2), RightOOBReadMessage(0));
346 RunStrNCmpTest(&strncmp);