Skip to content

Commit

Permalink
[graphx] fix and add tests for graphx #471
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoconlechuga committed Oct 7, 2024
1 parent bbcff52 commit 5e35560
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/library_examples/graphx/shapes/autotest.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@
"description": "Test triangle fill display",
"start": "vram_start",
"size": "vram_8_size",
"expected_CRCs": [ "A1154AE5" ]
"expected_CRCs": [ "7AA72F13" ]
},
"6":
{
"description": "Test line display",
"start": "vram_start",
"size": "vram_8_size",
"expected_CRCs": [ "08AE93E1" ]
"expected_CRCs": [ "D94140BB" ]
},
"7":
{
Expand Down
12 changes: 6 additions & 6 deletions examples/library_examples/graphx/shapes/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ int main(void)

/* Line Drawing */
gfx_SetColor(227);
gfx_Line(-10, -10, 330, 250);
gfx_Line(-10, 250, 330, -10);
gfx_Line_NoClip(0, 0, 320, 0);
gfx_Line_NoClip(0, 0, 0, 240);
gfx_Line_NoClip(0, 240, 320, 240);
gfx_Line_NoClip(320, 240, 320, 0);
gfx_Line(-10, -10, 329, 249);
gfx_Line(-10, 249, 329, -10);
gfx_Line_NoClip(0, 0, 319, 0);
gfx_Line_NoClip(0, 0, 0, 239);
gfx_Line_NoClip(0, 239, 319, 239);
gfx_Line_NoClip(319, 239, 319, 0);
gfx_SetColor(18);
gfx_HorizLine(-10, 10, 340);
gfx_HorizLine_NoClip(0, 230, 320);
Expand Down
36 changes: 36 additions & 0 deletions test/graphx/bug_471/autotest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"transfer_files":
[
"bin/DEMO.8xp"
],
"target":
{
"name": "DEMO",
"isASM": true
},
"sequence":
[
"action|launch",
"delay|100",
"hashWait|1",
"key|enter",
"hashWait|2"
],
"hashes":
{
"1":
{
"description": "Test line display",
"start": "vram_start",
"size": "vram_8_size",
"expected_CRCs": [ "69DA2AC4" ]
},
"2":
{
"description": "Test program exit",
"start": "vram_start",
"size": "vram_16_size",
"expected_CRCs": [ "FFAF89BA", "101734A5", "9DA19F44", "A32840C8", "349F4775" ]
}
}
}
15 changes: 15 additions & 0 deletions test/graphx/bug_471/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ----------------------------
# Makefile Options
# ----------------------------

NAME = DEMO
ICON = icon.png
DESCRIPTION = "CE C Toolchain Demo"
COMPRESSED = NO

CFLAGS = -Wall -Wextra -Oz
CXXFLAGS = -Wall -Wextra -Oz

# ----------------------------

include $(shell cedev-config --makefile)
19 changes: 19 additions & 0 deletions test/graphx/bug_471/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <ti/getcsc.h>
#include <graphx.h>

int main(void)
{
gfx_Begin();

gfx_SetColor(7); // green
gfx_Line(-100, 20, 30, 40);

gfx_SetColor(224); // red
gfx_Line(30, 40, -100, 20); // same numbers as above, just flipped order

while (!os_GetCSC());

gfx_End();

return 0;
}

0 comments on commit 5e35560

Please sign in to comment.