reactor-c
C Runtime for Lingua Franca
|
#include <stdlib.h>
#include <stdio.h>
#include "vector.h"
#include "rand_utils.h"
#include "util.h"
Macros | |
#define | CAPACITY 100 |
#define | MAX_PUSHALL 8 |
#define | N 5000 |
#define | RANDOM_SEED 1614 |
Functions | |
void | test_push (vector_t *v) |
Test the append functionality of v . | |
void | test_pop (vector_t *v) |
Test the pop functionality of v . | |
int | test_pushall (vector_t *v) |
Test the "push all" functionality of v . | |
void | test_random_access (vector_t *v) |
Check that the result of a random access to v yields the correct result. | |
void | test_vote (vector_t *v) |
Check that voting does not cause an error. | |
int | run_test (vector_t *v, int *distribution) |
Run a randomly selected test on v . | |
int | main () |
#define CAPACITY 100 |
#define MAX_PUSHALL 8 |
#define N 5000 |
#define RANDOM_SEED 1614 |
int main | ( | ) |
int run_test | ( | vector_t * | v, |
int * | distribution ) |
Run a randomly selected test on v
.
v | A vector. |
distribution | The desired probability distribution with which each of four actions are performed, expressed as percents. |
v
. void test_pop | ( | vector_t * | v | ) |
Test the pop functionality of v
.
v | A vector. |
void test_push | ( | vector_t * | v | ) |
Test the append functionality of v
.
v | A vector. |
x | Any pointer. |
int test_pushall | ( | vector_t * | v | ) |
Test the "push all" functionality of v
.
v | A vector |
v
. void test_random_access | ( | vector_t * | v | ) |
Check that the result of a random access to v
yields the correct result.
v | A vector. |
void test_vote | ( | vector_t * | v | ) |
Check that voting does not cause an error.
v | A vector. |