Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep tests assert in release build #266

Merged
merged 12 commits into from
Oct 20, 2023
4 changes: 3 additions & 1 deletion tests/z_api_alignment_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>

#include <assert.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#undef NDEBUG
#include <assert.h>

#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#include <windows.h>
#define sleep(x) Sleep(x * 1000)
Expand Down
4 changes: 3 additions & 1 deletion tests/z_client_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>

#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
Expand All @@ -21,6 +20,9 @@
#include "zenoh-pico/api/types.h"
#include "zenoh-pico/collections/string.h"

#undef NDEBUG
#include <assert.h>

#define MSG 1000
#define MSG_LEN 1024
#define QRY 100
Expand Down
4 changes: 3 additions & 1 deletion tests/z_data_struct_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#include <assert.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -22,6 +21,9 @@
#include "zenoh-pico/system/platform.h"
#include "zenoh-pico/transport/transport.h"

#undef NDEBUG
#include <assert.h>

void entry_list_test(void) {
_z_transport_peer_entry_list_t *root = _z_transport_peer_entry_list_new();
for (int i = 0; i < 10; i++) {
Expand Down
4 changes: 3 additions & 1 deletion tests/z_endpoint_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand All @@ -22,6 +21,9 @@
#include "zenoh-pico/link/endpoint.h"
#include "zenoh-pico/utils/result.h"

#undef NDEBUG
#include <assert.h>

int main(void) {
char *s = (char *)malloc(64);

Expand Down
5 changes: 4 additions & 1 deletion tests/z_iobuf_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>
//
#include <assert.h>

#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
Expand All @@ -20,6 +20,9 @@

#include "zenoh-pico/protocol/iobuf.h"

#undef NDEBUG
#include <assert.h>

#define RUNS 1000

/*=============================*/
Expand Down
4 changes: 3 additions & 1 deletion tests/z_msgcodec_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "zenoh-pico/protocol/definitions/transport.h"
#define ZENOH_PICO_TEST_H

#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Expand All @@ -41,6 +40,9 @@
#include "zenoh-pico/protocol/keyexpr.h"
#include "zenoh-pico/system/platform.h"

#undef NDEBUG
#include <assert.h>

#define RUNS 1000

#define _Z_MOCK_EXTENSION_UNIT 0x01
Expand Down
4 changes: 3 additions & 1 deletion tests/z_peer_multicast_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
Expand All @@ -22,6 +21,9 @@
#include "zenoh-pico/collections/bytes.h"
#include "zenoh-pico/protocol/core.h"

#undef NDEBUG
#include <assert.h>

#define MSG 10
#define MSG_LEN 1024
#define QRY 10
Expand Down
Loading