mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 00:57:19 +03:00
Refactor tests.
Refactor tests to use explicit testing assertions, rather than diff'ing test output. This makes the test code a bit shorter, more explicitly encodes testing intent, and makes test failure diagnosis more straightforward.
This commit is contained in:
parent
9f35a71a81
commit
2a83ed0284
31 changed files with 880 additions and 708 deletions
|
|
@ -77,7 +77,7 @@ malloc_write(const char *s)
|
|||
* provide a wrapper.
|
||||
*/
|
||||
int
|
||||
buferror(char *buf, size_t buflen)
|
||||
buferror(int err, char *buf, size_t buflen)
|
||||
{
|
||||
|
||||
#ifdef _WIN32
|
||||
|
|
@ -85,14 +85,14 @@ buferror(char *buf, size_t buflen)
|
|||
(LPSTR)buf, buflen, NULL);
|
||||
return (0);
|
||||
#elif defined(_GNU_SOURCE)
|
||||
char *b = strerror_r(errno, buf, buflen);
|
||||
char *b = strerror_r(err, buf, buflen);
|
||||
if (b != buf) {
|
||||
strncpy(buf, b, buflen);
|
||||
buf[buflen-1] = '\0';
|
||||
}
|
||||
return (0);
|
||||
#else
|
||||
return (strerror_r(errno, buf, buflen));
|
||||
return (strerror_r(err, buf, buflen));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue