This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug string/19907] New: Incorrect memory/string tests


https://sourceware.org/bugzilla/show_bug.cgi?id=19907

            Bug ID: 19907
           Summary: Incorrect memory/string tests
           Product: glibc
           Version: 2.24
            Status: NEW
          Severity: normal
          Priority: P2
         Component: string
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

Many memory/string tests, like string/test-memcpy.c and
benchtests/bench-memcpy.c, have

static void
do_one_test (impl_t *impl, char *dst, const char *src,
             size_t len)
{
  if (CALL (impl, dst, src, len) != MEMCPY_RESULT (dst, len))
    {
      error (0, 0, "Wrong result in function %s %p %p", impl->name,
             CALL (impl, dst, src, len), MEMCPY_RESULT (dst, len));
      ret = 1;
      return;
    }

  if (memcmp (dst, src, len) != 0)
    {
      error (0, 0, "Wrong result in function %s dst %p \"%.*s\" src %p \"%.*s\"
len %zu",
             impl->name, dst, (int) len, dst, src, (int) len, src, len);
      ret = 1;
      return;
    }
}

it doesn't clear destination set by the previous run.  They wont catch
the error when the following implementations do copy anything since
the destination buffer is unchanged from the last run.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]