-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
I forgot to check whether the result is `IMAGE_SYNTH_SUCCESS`.
echo "\033[1;92mTest Passed!\033[0m"; \ | ||
else \ | ||
echo "\033[1;91mTest Failed!\033[0m"; \ | ||
exit 1; \ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
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