Skip to content

Commit c90fa40

Browse files
committed
Fix tests, simulator, and formatting
1 parent b8a68dc commit c90fa40

File tree

6 files changed

+22
-14
lines changed

6 files changed

+22
-14
lines changed

simulator/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: clean
22
CFLAGS=-std=c99 -g -Wall -fno-common -DSIM -I. -I../src -I../libavr32/src
3-
DEPS =
3+
DEPS = ../src/gen/op_enum.h
44
OBJ = tt.o ../src/teletype.o ../src/command.o ../src/helpers.o ../src/drum_helpers.o \
55
../src/every.o ../src/gen/match_token.o ../src/gen/scanner.o \
66
../src/scale.o ../src/scene_serialization.o \

src/ops/grid_ops.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ static void op_G_BTN_X_set(const void *NOTUSED(data), scene_state_t *ss,
616616
s16 y = GBC.y;
617617
s16 w = GBC.w;
618618
s16 h = GBC.h;
619-
CLAMP_X_Y_W_H(return );
619+
CLAMP_X_Y_W_H(return);
620620

621621
GBC.x = x;
622622
GBC.y = y;
@@ -640,7 +640,7 @@ static void op_G_BTN_Y_set(const void *NOTUSED(data), scene_state_t *ss,
640640
s16 x = GBC.x;
641641
s16 w = GBC.w;
642642
s16 h = GBC.h;
643-
CLAMP_X_Y_W_H(return );
643+
CLAMP_X_Y_W_H(return);
644644

645645
GBC.x = x;
646646
GBC.y = y;
@@ -691,7 +691,7 @@ static void op_G_BTNX_set(const void *NOTUSED(data), scene_state_t *ss,
691691
s16 y = GBC.y;
692692
s16 w = GBC.w;
693693
s16 h = GBC.h;
694-
CLAMP_X_Y_W_H(return );
694+
CLAMP_X_Y_W_H(return);
695695

696696
GBC.x = x;
697697
GBC.y = y;
@@ -713,7 +713,7 @@ static void op_G_BTNY_set(const void *NOTUSED(data), scene_state_t *ss,
713713
s16 x = GBC.x;
714714
s16 w = GBC.w;
715715
s16 h = GBC.h;
716-
CLAMP_X_Y_W_H(return );
716+
CLAMP_X_Y_W_H(return);
717717

718718
GBC.x = x;
719719
GBC.y = y;
@@ -1138,7 +1138,7 @@ static void op_G_FDR_X_set(const void *NOTUSED(data), scene_state_t *ss,
11381138
s16 y = GFC.y;
11391139
s16 w = GFC.w;
11401140
s16 h = GFC.h;
1141-
CLAMP_X_Y_W_H(return );
1141+
CLAMP_X_Y_W_H(return);
11421142

11431143
GFC.x = x;
11441144
GFC.y = y;
@@ -1162,7 +1162,7 @@ static void op_G_FDR_Y_set(const void *NOTUSED(data), scene_state_t *ss,
11621162
s16 x = GFC.x;
11631163
s16 w = GFC.w;
11641164
s16 h = GFC.h;
1165-
CLAMP_X_Y_W_H(return );
1165+
CLAMP_X_Y_W_H(return);
11661166

11671167
GFC.x = x;
11681168
GFC.y = y;
@@ -1252,7 +1252,7 @@ static void op_G_FDRX_set(const void *NOTUSED(data), scene_state_t *ss,
12521252
s16 y = GFC.y;
12531253
s16 w = GFC.w;
12541254
s16 h = GFC.h;
1255-
CLAMP_X_Y_W_H(return );
1255+
CLAMP_X_Y_W_H(return);
12561256

12571257
GFC.x = x;
12581258
GFC.y = y;
@@ -1274,7 +1274,7 @@ static void op_G_FDRY_set(const void *NOTUSED(data), scene_state_t *ss,
12741274
s16 x = GFC.x;
12751275
s16 w = GFC.w;
12761276
s16 h = GFC.h;
1277-
CLAMP_X_Y_W_H(return );
1277+
CLAMP_X_Y_W_H(return);
12781278

12791279
GFC.x = x;
12801280
GFC.y = y;
@@ -1398,7 +1398,7 @@ static void op_G_XYP_get(const void *NOTUSED(data), scene_state_t *ss,
13981398

13991399
if (i < (s16)0 || i >= (s16)GRID_XYPAD_COUNT) return;
14001400
if (script < 0 || script > INIT_SCRIPT) script = -1;
1401-
CLAMP_X_Y_W_H(return );
1401+
CLAMP_X_Y_W_H(return);
14021402

14031403
GXYC.enabled = true;
14041404
GXYC.group = SG.current_group;

tests/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
.PHONY: clean test
22
CFLAGS = -std=c99 -g -Wall -fno-common -DSIM -I../src -I../libavr32/src
33

4-
tests: main.o \
4+
DEPS = ../src/gen/op_enum.h
5+
6+
OBJ = main.o \
57
log.o \
68
match_token_tests.o op_mod_tests.o \
79
parser_tests.o process_tests.o \
@@ -28,8 +30,14 @@ tests: main.o \
2830
../libavr32/src/euclidean/data.o ../libavr32/src/euclidean/euclidean.o \
2931
../libavr32/src/music.o ../libavr32/src/util.o ../libavr32/src/random.o
3032

33+
34+
%.o: %.c $(DEPS)
35+
$(CC) -c -o $@ $< $(CFLAGS)
36+
37+
tests: $(OBJ)
3138
$(CC) -o $@ $^ $(CFLAGS)
3239

40+
3341
include ../codegen.mk
3442

3543
test: tests

tests/match_token_tests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
#include <string.h>
44

5+
#include "gen/op_enum.h"
56
#include "greatest/greatest.h"
67
#include "match_token.h"
78
#include "ops/op.h"
8-
#include "gen/op_enum.h"
99

1010
// This test asserts that match_token always returns the correct op, it does
1111
// this by starting with the op in question, extracting the name and running

tests/parser_tests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "parser_tests.h"
22

3+
#include "gen/op_enum.h"
34
#include "greatest/greatest.h"
45
#include "ops/op.h"
5-
#include "gen/op_enum.h"
66
#include "teletype.h"
77

88
#define CORPUS_COUNT 141

tests/serialize_scene_tests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#include <stdlib.h>
44
#include <string.h>
55

6+
#include "gen/op_enum.h"
67
#include "greatest/greatest.h"
78
#include "log.h"
8-
#include "gen/op_enum.h"
99
#include "scene_serialization.h"
1010
#include "serializer.h"
1111
#include "state.h"

0 commit comments

Comments
 (0)