Macros | Functions
test-idna.c File Reference
#include "task.h"
#include "../src/idna.c"
#include <string.h>
Include dependency graph for test-idna.c:

Go to the source code of this file.

Macros

#define F(input, err)
 
#define T(input, expected)
 

Functions

 TEST_IMPL (idna_toascii)
 
 TEST_IMPL (utf8_decode1)
 

Macro Definition Documentation

◆ F

#define F (   input,
  err 
)
Value:
do { \
char d[256] = {0}; \
static const char s[] = "" input ""; \
ASSERT(err == uv__idna_toascii(s, s + sizeof(s) - 1, d, d + sizeof(d))); \
} while (0)

Definition at line 102 of file test-idna.c.

◆ T

#define T (   input,
  expected 
)
Value:
do { \
long n; \
char d1[256] = {0}; \
char d2[256] = {0}; \
static const char s[] = "" input ""; \
n = uv__idna_toascii(s, s + sizeof(s) - 1, d1, d1 + sizeof(d1)); \
ASSERT(n == sizeof(expected)); \
ASSERT(0 == memcmp(d1, expected, n)); \
/* Sanity check: encoding twice should not change the output. */ \
n = uv__idna_toascii(d1, d1 + strlen(d1), d2, d2 + sizeof(d2)); \
ASSERT(n == sizeof(expected)); \
ASSERT(0 == memcmp(d2, expected, n)); \
ASSERT(0 == memcmp(d1, d2, sizeof(d2))); \
} while (0)

Definition at line 109 of file test-idna.c.

Function Documentation

◆ TEST_IMPL() [1/2]

TEST_IMPL ( idna_toascii  )

Definition at line 125 of file test-idna.c.

◆ TEST_IMPL() [2/2]

TEST_IMPL ( utf8_decode1  )

Definition at line 26 of file test-idna.c.

error_ref_leak.err
err
Definition: error_ref_leak.py:35
absl::FormatConversionChar::s
@ s
d2
static const fe d2
Definition: curve25519_tables.h:39
d
static const fe d
Definition: curve25519_tables.h:19
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
input
std::string input
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc:197
uv__idna_toascii
long uv__idna_toascii(const char *s, const char *se, char *d, char *de)
Definition: idna.c:250


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:33