infix
A JIT-Powered FFI Library for C
|
Tests fundamental FFI operations involving pointers. More...
Macros | |
#define | DBLTAP_IMPLEMENTATION |
Functions | |
const char * | find_char_in_string (const char *s, int c) |
A strchr -like function to test pointer arguments and return values. | |
void | modify_data_via_pointers (int *a, double *b) |
Modifies the data pointed to by its arguments. | |
bool | check_if_null (void *ptr) |
Checks if the pointer it received is nullptr. | |
subtest ("Passing and returning pointers") | |
subtest ("Modifying data via pointer arguments") | |
subtest ("Passing nullptr pointers") | |
Variables | |
TEST | |
Tests fundamental FFI operations involving pointers.
Copyright (c) 2025 Sanko Robinson
This source code is dual-licensed under the Artistic License 2.0 or the MIT License. You may choose to use this code under the terms of either license.
SPDX-License-Identifier: (Artistic-2.0 OR MIT)
The documentation blocks within this file are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
SPDX-License-Identifier: CC-BY-4.0
This test suite verifies that the library can correctly handle pointers as both arguments and return values. It covers three essential scenarios:
strchr
is called to ensure that a pointer passed into a function and a pointer returned from a function both retain their correct values.nullptr
pointer is passed to a native function to ensure it is transmitted correctly without being corrupted or causing a crash. #define DBLTAP_IMPLEMENTATION |
bool check_if_null | ( | void * | ptr | ) |
Checks if the pointer it received is nullptr.
const char * find_char_in_string | ( | const char * | s, |
int | c | ||
) |
A strchr
-like function to test pointer arguments and return values.
void modify_data_via_pointers | ( | int * | a, |
double * | b | ||
) |
Modifies the data pointed to by its arguments.
subtest | ( | "Modifying data via pointer arguments" | ) |
subtest | ( | "Passing and returning pointers" | ) |
subtest | ( | "Passing nullptr pointers" | ) |