From 93f0df58e5323be4e4043c5d9e8b6d93ffb7cf9e Mon Sep 17 00:00:00 2001 From: mrdudz Date: Thu, 9 Jul 2020 15:57:51 +0200 Subject: [PATCH] test related to issue #1071 --- test/val/bug1071.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 test/val/bug1071.c diff --git a/test/val/bug1071.c b/test/val/bug1071.c new file mode 100644 index 000000000..02b069de0 --- /dev/null +++ b/test/val/bug1071.c @@ -0,0 +1,87 @@ + +/* test related to issue #1071 */ + +#include +#include +#include + +struct ImageStruct +{ + uint8_t _imageData; + #if !defined(NO_COLOR) + uint8_t _color; + #endif +}; + +typedef struct ImageStruct Image; + +struct CharacterStruct +{ + // character coordinates + uint8_t _x; + uint8_t _y; + + // _status decides whether the character is active + uint8_t _status; + + Image* _imagePtr; +}; + +typedef struct CharacterStruct Character; + +uint16_t ghostLevel; +uint8_t level; +uint16_t loop; + +#define GHOSTS_NUMBER 10 +#define BOMBS_NUMBER 3 + +#define MAX_GHOST_LEVEL_SCALE 3 +#define MAX_GHOST_LEVEL (1400/MAX_GHOST_LEVEL_SCALE) + +#define MAX_GHOST_LOOP_SCALE 3 +#define MAX_GHOST_LOOP (1800/MAX_GHOST_LOOP_SCALE) + +#define INITIAL_GHOST_SLOWDOWN 16000 + +#define ACTION_GHOST_MIN_SLOWDOWN_SCALE 1 +#define GHOST_MIN_SLOWDOWN_SCALE ACTION_GHOST_MIN_SLOWDOWN_SCALE +#define GHOST_MIN_SLOWDOWN (3000/GHOST_MIN_SLOWDOWN_SCALE) + +Character ghosts[GHOSTS_NUMBER]; +Character bombs[BOMBS_NUMBER]; + +uint16_t test1(void) +{ + if((loop