Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
test_utils.h File Reference
#include "munit.h"
#include <fp2.h>
#include <utilities.h>
#include <stdio.h>
Include dependency graph for test_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TEST_END    { NULL, NULL, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL }
 
#define SUITE_END    { NULL, NULL, NULL, 0, MUNIT_SUITE_OPTION_NONE }
 
#define PARAM_END    { NULL, NULL }
 
#define TEST_CASE(test_func)    { #test_func, test_func, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL }
 
#define TEST_CASE_SETUP(test_func, setup, teardown)    { #test_func, test_func, setup, teardown, MUNIT_TEST_OPTION_NONE, NULL }
 
#define BENCHMARK(test_func, setup, teardown, params)    { #test_func, test_func, setup, teardown, MUNIT_TEST_OPTION_SINGLE_ITERATION, params }
 
#define SUITE(suite_name, test_cases)    { suite_name, test_cases, NULL, 0, MUNIT_SUITE_OPTION_NONE }
 
#define SUITE_IT(suite_name, test_cases, iterations)    { suite_name, test_cases, NULL, iterations, MUNIT_SUITE_OPTION_NONE }
 
#define SUITE_OF_SUITE(suite_name, nested_suite)    { suite_name, NULL, nested_suite, 0, MUNIT_SUITE_OPTION_NONE }
 
#define RANDOM_FP_ELEMENT(out)
 
#define RANDOM_SEED(out)
 
#define RANDOM_BIT_STRING(out)
 
#define RANDOM_TRIT_STRING(out)
 
#define MAX_MARKER_LEN   50
 

Macro Definition Documentation

◆ BENCHMARK

#define BENCHMARK (   test_func,
  setup,
  teardown,
  params 
)     { #test_func, test_func, setup, teardown, MUNIT_TEST_OPTION_SINGLE_ITERATION, params }

Definition at line 25 of file test_utils.h.

@ MUNIT_TEST_OPTION_SINGLE_ITERATION
Definition munit.h:442
Definition setup.py:1
for i

◆ MAX_MARKER_LEN

#define MAX_MARKER_LEN   50

Definition at line 78 of file test_utils.h.

◆ PARAM_END

#define PARAM_END    { NULL, NULL }

Definition at line 15 of file test_utils.h.

16 { NULL, NULL }

◆ RANDOM_BIT_STRING

#define RANDOM_BIT_STRING (   out)
Value:
{ \
}
#define munit_uint8_t
Definition munit.h:51
#define BIT_LENGTH_PATH
Definition p254.h:14

Definition at line 58 of file test_utils.h.

59{ \
61}

◆ RANDOM_FP_ELEMENT

#define RANDOM_FP_ELEMENT (   out)
Value:
{ \
while (!multiprecision_is_smaller((out), FIELD_CHARACTERISTIC, FIELD_64BITS_WORDS)) { \
} \
}
#define FIELD_BYTES
Definition p254.h:8
#define FIELD_64BITS_WORDS
Definition p254.h:9
#define MASK_FIELD_ELEMENT
Definition p254.h:11
uint8_t multiprecision_is_smaller(const uint64_t *input_a, const uint64_t *input_b, uint64_t input_length)
Definition utilities.c:111

Definition at line 38 of file test_utils.h.

39{ \
42 while (!multiprecision_is_smaller((out), FIELD_CHARACTERISTIC, FIELD_64BITS_WORDS)) { \
45 } \
46}

◆ RANDOM_SEED

#define RANDOM_SEED (   out)
Value:
{ \
}
#define SECURITY_BITS
Definition p254.h:12

Definition at line 48 of file test_utils.h.

49{ \
51}

◆ RANDOM_TRIT_STRING

#define RANDOM_TRIT_STRING (   out)
Value:
{ \
uint8_t bound = 0xF3; \
for(int i = 0; i < (TRITLENGTH_PATH / 5); i++) { \
while (issmaller(bound, trit_str)) { \
} \
out[i] = trit_str; \
} \
}
#define TRITLENGTH_PATH
Definition p254.h:15

Definition at line 64 of file test_utils.h.

65{ \
66 uint8_t bound = 0xF3; \
67 for(int i = 0; i < (TRITLENGTH_PATH / 5); i++) { \
70 while (issmaller(bound, trit_str)) { \
72 } \
73 out[i] = trit_str; \
74 } \
75}

◆ SUITE

Definition at line 28 of file test_utils.h.

@ MUNIT_SUITE_OPTION_NONE
Definition munit.h:462

◆ SUITE_END

#define SUITE_END    { NULL, NULL, NULL, 0, MUNIT_SUITE_OPTION_NONE }

Definition at line 13 of file test_utils.h.

◆ SUITE_IT

#define SUITE_IT (   suite_name,
  test_cases,
  iterations 
)     { suite_name, test_cases, NULL, iterations, MUNIT_SUITE_OPTION_NONE }

Definition at line 31 of file test_utils.h.

◆ SUITE_OF_SUITE

#define SUITE_OF_SUITE (   suite_name,
  nested_suite 
)     { suite_name, NULL, nested_suite, 0, MUNIT_SUITE_OPTION_NONE }

Definition at line 34 of file test_utils.h.

◆ TEST_CASE

Definition at line 19 of file test_utils.h.

◆ TEST_CASE_SETUP

#define TEST_CASE_SETUP (   test_func,
  setup,
  teardown 
)     { #test_func, test_func, setup, teardown, MUNIT_TEST_OPTION_NONE, NULL }

Definition at line 22 of file test_utils.h.

◆ TEST_END

#define TEST_END    { NULL, NULL, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL }

Definition at line 11 of file test_utils.h.