Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix examples/hello test round#2 #3

Merged
merged 3 commits into from Feb 23, 2022
Merged

Fix examples/hello test round#2 #3

merged 3 commits into from Feb 23, 2022

Conversation

jakwings
Copy link

I forgot to check whether the result is IMAGE_SYNTH_SUCCESS.

Also add GitHub continuous integration for macos and ubuntu. (I only tested on macos.)

closes #1

J.W added 2 commits February 23, 2022 14:29
I forgot to check whether the result is `IMAGE_SYNTH_SUCCESS`.
@61315 61315 added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Feb 23, 2022
@61315 61315 self-requested a review February 23, 2022 06:35
echo "\033[1;92mTest Passed!\033[0m"; \
else \
echo "\033[1;91mTest Failed!\033[0m"; \
exit 1; \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

examples/hello.c with no change

Testing...
IMAGE_SYNTH_SUCCESS
Test Passed!
Done!

examples/hello.c with an empty mask

diff --git a/examples/hello.c b/examples.hello.c
-      mask_image_data[i * HEIGHT + j] = 0xFF;
+      mask_image_data[i * HEIGHT + j] = 0x00;
Testing...
IMAGE_SYNTH_ERROR_EMPTY_TARGET
Test Failed!
make: *** [test] Error 1

examples/hello.c with indexing beyond array boundaries

diff --git a/examples/hello.c b/examples.hello.c
-      mask_image_data[i * HEIGHT + j] = 0xFF;
+      mask_image_data[i * HEIGHT * HEIGHT + j] = 0xFF;
Testing...
/bin/sh: line 1: 12061 Segmentation fault: 11  examples/hello
Test Failed!
make: *** [test] Error 1

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected.

@@ -2,7 +2,7 @@
CC = clang -std=c99
CPPFLAGS = -MMD -MP -DSYNTH_LIB_ALONE
CFLAGS = -Wall -Wextra -pedantic -O3
LDFLAGS =
LDFLAGS = -lm
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very helpful.
I really didn't understand before why there has to be the -lm flag. Thanks!
Why do you have to link the math library in C?

@61315 61315 merged commit 89fb3b8 into 61315:master Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can use SDL2.framework bundle instead of pkg-config sdl2
2 participants