blob: 80749ed550188fafd962faf4b1ee9335e11b8177 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
/* See LICENSE file for copyright and license details. */
#include "common.h"
#ifndef TEST
int
(libnormalform_evaluate)(LIBNORMALFORM_SENTENCE *this)
{
return this->evaluate(this, NULL);
}
#else
#define EVALUATION_RESULT 5
static LIBNORMALFORM_SENTENCE *evaluation_this;
static int
evaluation(LIBNORMALFORM_SENTENCE *this, void *input)
{
ASSERT(this);
ASSERT(this == evaluation_this);
ASSERT(input == NULL);
return EVALUATION_RESULT;
}
int
main(void)
{
TEST_BEGIN;
LIBNORMALFORM_SENTENCE a;
evaluation_this = &a;
a.evaluate = &evaluation;
ASSERT(libnormalform_evaluate(&a) == EVALUATION_RESULT);
TEST_END;
}
#endif
|