skip to content
==> tests/constants.c <==
1/* Every constant of @ajax/mesh-abi-name equals the Rust's (values printed by the Rust itself), and the
2 * Rust const asserts that need a function call hold. Generated from alpha-rust-mesh. */
3#include "mesh/abi/name.h"
4#include "mesh/check.h"
5
6#include <stdint.h>
7#include <string.h>
8
9int main(void) {
10    CHECK(mesh_valid_name((const uint8_t *)"hello", 5)); /* valid_name(b"hello") */
11    CHECK(mesh_valid_name((const uint8_t *)"a-1", 3)); /* valid_name(b"a-1") */
12    CHECK(!mesh_valid_name((const uint8_t *)"", 0)); /* !valid_name(b"") */
13    CHECK(!mesh_valid_name((const uint8_t *)"Hello", 5)); /* !valid_name(b"Hello") */
14    CHECK(!mesh_valid_name((const uint8_t *)"0123456789abcdef", 16)); /* !valid_name(b"0123456789abcdef") */
15    return mesh_check_done();
16}