Fixed errors in tests
This commit is contained in:
parent
ef18ff2bc0
commit
7777b533e8
|
|
@ -119,7 +119,7 @@ typedef struct {
|
|||
} StringLiteral;
|
||||
|
||||
typedef struct {
|
||||
const Token *tokens;
|
||||
Token *tokens; // TODO: Bootstrap Problem
|
||||
size_t length;
|
||||
} TokenString;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "sls/sls_errors.h"
|
||||
|
|
@ -36,6 +37,13 @@ static void clean_up_test(LexerResult result) {
|
|||
clean_token_result(result.result);
|
||||
}
|
||||
|
||||
static TestResult error_test(LexerTest *test, LexerResult result, SlsError error) {
|
||||
clean_up_test(result);
|
||||
test->result.status = TEST_ERROR;
|
||||
test->result.error = error;
|
||||
return test->result;
|
||||
}
|
||||
|
||||
static TestResult logic_fail_test(LexerTest *test, LexerResult result, const char *message) {
|
||||
if (message == 0) return error_test(test, result, (SlsError) {
|
||||
.message = "Out of Memory Error!", .code = 3458, });
|
||||
|
|
@ -52,13 +60,6 @@ static TestResult error_fail_test(LexerTest *test, LexerResult result, SlsError
|
|||
return test->result;
|
||||
}
|
||||
|
||||
static TestResult error_test(LexerTest *test, LexerResult result, SlsError error) {
|
||||
clean_up_test(result);
|
||||
test->result.status = TEST_ERROR;
|
||||
test->result.error = error;
|
||||
return test->result;
|
||||
}
|
||||
|
||||
static TestResult skip_test(LexerTest *test, LexerResult result) {
|
||||
clean_up_test(result);
|
||||
test->result.status = TEST_NOT_IMPLEMENTED;
|
||||
|
|
@ -547,9 +548,9 @@ typedef struct {
|
|||
const char *struct_name;
|
||||
Boolean (*struct_handler)(LexerTest *, LexerResult, size_t, size_t, void *, void *);
|
||||
void **values;
|
||||
} TestArrayBooleanValue;
|
||||
} TestArrayStructInlineValue;
|
||||
|
||||
static Boolean test_array_struct_inline_value(LexerTest *test, LexerResult result, size_t i, TestArrayBooleanValue *values) {
|
||||
static Boolean test_array_struct_inline_value(LexerTest *test, LexerResult result, size_t i, TestArrayStructInlineValue *values) {
|
||||
static const ArrayType array_type = ARRAY_STRUCT_INLINE;
|
||||
LexerTokenResult *head = get_token(result.result, i);
|
||||
if (test_array_type(test, result, i, array_type, values->shape, values->dimensions)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue