Compare commits

...

4 Commits

Author SHA1 Message Date
Sergey Fionov
4e4939c53a
Merge 80e2be17ad into 86c9f79991 2024-05-14 13:57:15 +02:00
jeans
86c9f79991 refactor: added apple macro for fs handling 2024-05-14 13:53:42 +02:00
jeans
8e1a247c1f refactor: added macOS include file
MacOS supports util.h as well
2024-05-14 13:53:42 +02:00
Erik Ekman
1cc1536e6a test/unit: fix inconsistent nullness check error
Inside a testcase, but still. Trying to address #160
2024-04-09 20:11:39 +02:00
3 changed files with 19 additions and 7 deletions

View File

@ -35,7 +35,7 @@
#include <stdlib.h>
#include <stdio.h>
#if defined(LWIP_UNIX_OPENBSD)
#if defined(LWIP_UNIX_OPENBSD) || defined(LWIP_UNIX_MACH)
#include <util.h>
#endif
#include <termios.h>

View File

@ -77,7 +77,7 @@ static int deflate_level; /* default compression level, can be changed via comma
#define CHDIR(path) SetCurrentDirectoryA(path)
#define CHDIR_SUCCEEDED(ret) (ret == TRUE)
#elif __linux__
#elif __linux__ || __APPLE__
#define GETCWD(path, len) getcwd(path, len)
#define GETCWD_SUCCEEDED(ret) (ret != NULL)

View File

@ -88,6 +88,7 @@ START_TEST(test_pbuf_copy_zero_pbuf)
fail_unless(p2->ref == 1);
p3 = pbuf_alloc(PBUF_RAW, p1->tot_len, PBUF_POOL);
fail_unless(p3 != NULL);
err = pbuf_copy(p3, p1);
fail_unless(err == ERR_VAL);
@ -161,8 +162,8 @@ START_TEST(test_pbuf_copy_partial_pbuf)
b->payload = packet;
pbuf_cat(a, b);
dest = pbuf_alloc(PBUF_RAW, 14, PBUF_RAM);
memset(dest->payload, 0, dest->len);
fail_unless(dest != NULL);
memset(dest->payload, 0, dest->len);
/* Don't copy if data will not fit */
err = pbuf_copy_partial_pbuf(dest, a, a->tot_len, 4);
@ -198,6 +199,7 @@ START_TEST(test_pbuf_split_64k_on_small_pbufs)
LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, 1, PBUF_POOL);
fail_unless(p != NULL);
pbuf_split_64k(p, &rest);
fail_unless(p->tot_len == 1);
pbuf_free(p);
@ -267,9 +269,14 @@ START_TEST(test_pbuf_take_at_edge)
u8_t *out;
int i;
u8_t testdata[] = { 0x01, 0x08, 0x82, 0x02 };
struct pbuf *p = pbuf_alloc(PBUF_RAW, 1024, PBUF_POOL);
struct pbuf *q = p->next;
struct pbuf *p;
struct pbuf *q;
LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, 1024, PBUF_POOL);
fail_unless(p != NULL);
q = p->next;
/* alloc big enough to get a chain of pbufs */
fail_if(p->tot_len == p->len);
memset(p->payload, 0, p->len);
@ -319,9 +326,14 @@ START_TEST(test_pbuf_get_put_at_edge)
u8_t *out;
u8_t testdata = 0x01;
u8_t getdata;
struct pbuf *p = pbuf_alloc(PBUF_RAW, 1024, PBUF_POOL);
struct pbuf *q = p->next;
struct pbuf *p;
struct pbuf *q;
LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, 1024, PBUF_POOL);
fail_unless(p != NULL);
q = p->next;
/* alloc big enough to get a chain of pbufs */
fail_if(p->tot_len == p->len);
memset(p->payload, 0, p->len);