This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via ff0706d61e00ba22fcb83e4902461b1832ab1023 (commit)
from d0453af494e305191b9d85f6f35fbc06b828d61d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/ff0706d61e00ba22fcb83e4902461b1832ab…
commit ff0706d61e00ba22fcb83e4902461b1832ab1023
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Oct 31 18:30:59 2012 +0100
gfx: algo: Fix negative and zero radius for Circle
The gfx prototypes are not correct though.
diff --git a/libs/gfx/algo/Circle.algo.h b/libs/gfx/algo/Circle.algo.h
index f5f5acc..76deb83 100644
--- a/libs/gfx/algo/Circle.algo.h
+++ b/libs/gfx/algo/Circle.algo.h
@@ -74,10 +74,20 @@
* FN_NAME - name of the function to be defined
*/
#define DEF_CIRCLE_FN(FN_NAME, CONTEXT_T, PIXVAL_T, PUTPIXEL) -void FN_NAME(CONTEXT_T context, int xcenter, int ycenter, unsigned int r, +void FN_NAME(CONTEXT_T context, int xcenter, int ycenter, int r, PIXVAL_T pixval) { int x, y, error; ++ /* Special case for r == 0 */ + if (r == 0) { + PUTPIXEL(context, xcenter, ycenter, pixval); + return; + } ++ /* Clip negative r */ + r = r < 0 ? -r : r; + for (x = 0, error = -r, y = r; y >= 0; y--) { /* Iterate X until we can pass to the next line. */
-----------------------------------------------------------------------
Summary of changes:
libs/gfx/algo/Circle.algo.h | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via a74fce450b62265d5dc4b80f43a89bfeb570e271 (commit)
from 8701e8765185f90507ff6a02c03fcf0c22ae1e8f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/a74fce450b62265d5dc4b80f43a89bfeb570…
commit a74fce450b62265d5dc4b80f43a89bfeb570e271
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Tue Oct 30 22:25:02 2012 +0100
tests: Remove pixeltests.
diff --git a/tests/SDL/Makefile b/tests/SDL/Makefile
index 6985861..35a76e1 100644
--- a/tests/SDL/Makefile
+++ b/tests/SDL/Makefile
@@ -7,7 +7,7 @@ LDLIBS+=-lGP -L$(TOPDIR)/build/ -lGP_SDL -lSDL
ifeq ($(HAVE_LIBSDL),yes)
CSOURCES=$(shell echo *.c)
-APPS=pixeltest fonttest+APPS=fonttest symbolstest textaligntest blittest subcontext aatest mixpixeltest
endif
diff --git a/tests/SDL/pixeltest.c b/tests/SDL/pixeltest.c
deleted file mode 100644
index 6d7ccf0..0000000
--- a/tests/SDL/pixeltest.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*****************************************************************************
- * This file is part of gfxprim library. *
- * *
- * Gfxprim is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Lesser General Public *
- * License as published by the Free Software Foundation; either *
- * version 2.1 of the License, or (at your option) any later version. *
- * *
- * Gfxprim is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with gfxprim; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
- * Boston, MA 02110-1301 USA *
- * *
- * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos *
- * <jiri.bluebear.dluhos(a)gmail.com> *
- * *
- * Copyright (C) 2009-2011 Cyril Hrubis <metan(a)ucw.cz> *
- * *
- *****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <SDL/SDL.h>
-
-#include "GP.h"
-#include "GP_SDL.h"
-
-/* The surface used as a display (in fact it is a software surface). */
-SDL_Surface *display = NULL;
-GP_Context context;
-
-/* Timer used for refreshing the display */
-SDL_TimerID timer;
-
-/* An event used for signaling that the timer was triggered. */
-SDL_UserEvent timer_event;
-
-/* Values for color pixels in display format. */
-GP_Pixel red_pixel, green_pixel, blue_pixel, white_pixel;
-
-Uint32 timer_callback(__attribute__((unused)) Uint32 interval,
- __attribute__((unused)) void *param)
-{
- timer_event.type = SDL_USEREVENT;
- SDL_PushEvent((SDL_Event *) &timer_event);
- return 30;
-}
-
-void draw_pixel(void)
-{
- GP_Pixel pixel;
- int x = random() % 320;
- int y = random() % 240;
-
- pixel = GP_GetPixel(&context, x, y);
-
- if (pixel == blue_pixel) {
- GP_PutPixel(&context, x, y, green_pixel);
- }
- else if (pixel == red_pixel) {
- GP_PutPixel(&context, x, y, white_pixel);
- }
- else {
- if (x < 160) {
- GP_PutPixel(&context, x, y, blue_pixel);
- } else {
- GP_PutPixel(&context, x, y, red_pixel);
- }
- }
-}
-
-void draw_pixels(void)
-{
- SDL_LockSurface(display);
-
- /* Draw some pixels (exact number is not important). */
- int i;
- for (i = 0; i < 30; i++)
- draw_pixel();
-
- SDL_UnlockSurface(display);
-}
-
-void event_loop(void)
-{
- SDL_Event event;
-
- while (SDL_WaitEvent(&event) > 0) {
- switch (event.type) {
- case SDL_USEREVENT:
- draw_pixels();
- SDL_Flip(display);
- break;
- case SDL_KEYDOWN:
- case SDL_QUIT:
- return;
- }
- }
-}
-
-int main(int argc, char **argv)
-{
- int display_bpp = 0;
-
- int i;
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-16") == 0) {
- display_bpp = 16;
- } else if (strcmp(argv[i], "-24") == 0) {
- display_bpp = 24;
- }
- }
-
- /* Initialize SDL */
- if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) {
- fprintf(stderr, "Could not initialize SDL: %sn", SDL_GetError());
- return 1;
- }
-
- /* Create a window with a software back surface */
- display = SDL_SetVideoMode(320, 240, display_bpp, SDL_SWSURFACE);
- if (display == NULL) {
- fprintf(stderr, "Could not open display: %sn", SDL_GetError());
- goto fail;
- }
-
-
- /* Print basic information about the surface */
- printf("Display surface properties:n");
- printf(" width: %4d, height: %4d, pitch: %4dn",
- display->w, display->h, display->pitch);
- printf(" bits per pixel: %2d, bytes per pixel: %2dn",
- display->format->BitsPerPixel, display->format->BytesPerPixel);
-
- /* Set up a clipping rectangle to test proper clipping of pixels */
- SDL_Rect clip_rect = {10, 10, 300, 220};
- SDL_SetClipRect(display, &clip_rect);
-
- GP_SDL_ContextFromSurface(&context, display);
-
- /* Load pixel values compatible with the display. */
- red_pixel = GP_ColorToContextPixel(GP_COL_RED, &context);
- green_pixel = GP_ColorToContextPixel(GP_COL_GREEN, &context);
- blue_pixel = GP_ColorToContextPixel(GP_COL_BLUE, &context);
- white_pixel = GP_ColorToContextPixel(GP_COL_WHITE, &context);
-
- /* Set up the refresh timer */
- timer = SDL_AddTimer(30, timer_callback, NULL);
- if (timer == 0) {
- fprintf(stderr, "Could not set up timer: %sn", SDL_GetError());
- goto fail;
- }
-
- /* Enter the event loop */
- event_loop();
-
- /* We're done */
- SDL_Quit();
- return 0;
-
-fail:
- SDL_Quit();
- return 1;
-}
-----------------------------------------------------------------------
Summary of changes:
tests/SDL/Makefile | 2 +-
tests/SDL/pixeltest.c | 169 -------------------------------------------------
2 files changed, 1 insertions(+), 170 deletions(-)
delete mode 100644 tests/SDL/pixeltest.c
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via 101233f4b4f483e4633302fe978f051ee5c4e472 (commit)
from 7d30cb21d991fc207b0cc99038494e647307a598 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/101233f4b4f483e4633302fe978f051ee5c4…
commit 101233f4b4f483e4633302fe978f051ee5c4e472
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Oct 20 11:13:41 2012 +0200
tests: framework: Add UNTESTED test status.
diff --git a/tests/framework/test.c b/tests/framework/test.c
index f4a8692..ccef65d 100644
--- a/tests/framework/test.c
+++ b/tests/framework/test.c
@@ -186,11 +186,25 @@ int fail_FILE(void)
return TST_SUCCESS;
}
+/*
+ * This status is returned when the could not be started
+ * because of unsufficient configuration
+ */
static int skipped_fn(void)
{
return TST_SKIPPED;
}
+/*
+ * This status is returned when there was failure prior
+ * the actuall testing so we could not test the feature
+ * at all.
+ */
+static int untested_fn(void)
+{
+ return TST_UNTESTED;
+}
+
static int res_fn(void)
{
if (access("test.c", R_OK) == 0)
@@ -226,6 +240,7 @@ const struct tst_suite tst_suite = {
.tests = {
{.name = "Success test", .tst_fn = success_fn},
{.name = "Skipped test", .tst_fn = skipped_fn},
+ {.name = "Untested test", .tst_fn = untested_fn},
{.name = "Sigsegv test", .tst_fn = sigsegv_fn},
{.name = "Failed test", .tst_fn = failed_fn},
{.name = "Stack overflow test", .tst_fn = stack_overflow_fn},
diff --git a/tests/framework/tst_job.c b/tests/framework/tst_job.c
index a1f7272..8a0789b 100644
--- a/tests/framework/tst_job.c
+++ b/tests/framework/tst_job.c
@@ -77,6 +77,9 @@ static void stop_test(struct tst_job *job)
case TST_SKIPPED:
result = "[ e[1;30mSKIPPEDe[0m ]";
break;
+ case TST_UNTESTED:
+ result = "[ e[1;34mUNTESTEDe[0m ]";
+ break;
case TST_INTERR:
result = "[ e[1;31mINTERNAL ERRORe[0m ]";
break;
diff --git a/tests/framework/tst_log.c b/tests/framework/tst_log.c
index 772b20b..a70f8c0 100644
--- a/tests/framework/tst_log.c
+++ b/tests/framework/tst_log.c
@@ -36,6 +36,8 @@ static const char *ret_to_bg_color(enum tst_ret ret)
return "#008000";
case TST_SKIPPED:
return "#888888";
+ case TST_UNTESTED:
+ return "#0000bb";
case TST_INTERR:
return "#800000";
case TST_SIGSEGV:
@@ -64,6 +66,8 @@ static const char *ret_to_str(enum tst_ret ret)
return "Success";
case TST_SKIPPED:
return "Skipped";
+ case TST_UNTESTED:
+ return "Untested";
case TST_INTERR:
return "Internal Error";
case TST_SIGSEGV:
diff --git a/tests/framework/tst_test.h b/tests/framework/tst_test.h
index b9a0c17..c6ef4fe 100644
--- a/tests/framework/tst_test.h
+++ b/tests/framework/tst_test.h
@@ -24,15 +24,16 @@
#define TST_TEST_H
enum tst_ret {
- TST_SUCCESS, /* Test succedded */
- TST_SKIPPED, /* Test skipped due to not enough memory, ENOSYS ... */
- TST_INTERR, /* Test framework error */
- TST_SIGSEGV, /* Test ended with SIGSEGV */
- TST_TIMEOUT, /* Test hasn't finished in time */
- TST_ABORTED, /* The abort() was called (possible double free) */
- TST_FPE, /* Floating point exception */
- TST_MEMLEAK, /* Memory leak was detected */
- TST_FAILED, /* Test failed */
+ TST_SUCCESS, /* Test succedded */
+ TST_SKIPPED, /* Test skipped due to not enough memory, ENOSYS ... */
+ TST_UNTESTED, /* Test not finished because of failure */
+ TST_INTERR, /* Test framework error */
+ TST_SIGSEGV, /* Test ended with SIGSEGV */
+ TST_TIMEOUT, /* Test hasn't finished in time */
+ TST_ABORTED, /* The abort() was called (possible double free) */
+ TST_FPE, /* Floating point exception */
+ TST_MEMLEAK, /* Memory leak was detected */
+ TST_FAILED, /* Test failed */
TST_MAX = TST_FAILED+1,
};
-----------------------------------------------------------------------
Summary of changes:
tests/framework/test.c | 15 +++++++++++++++
tests/framework/tst_job.c | 3 +++
tests/framework/tst_log.c | 4 ++++
tests/framework/tst_test.h | 19 ++++++++++---------
4 files changed, 32 insertions(+), 9 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via 7d30cb21d991fc207b0cc99038494e647307a598 (commit)
from f5e28f46785b6f44488672e5a1a6a878137a44be (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/7d30cb21d991fc207b0cc99038494e647307…
commit 7d30cb21d991fc207b0cc99038494e647307a598
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Oct 20 00:17:14 2012 +0200
tests: framework: Fix benchmark JSON output.
diff --git a/tests/framework/tst_log.c b/tests/framework/tst_log.c
index b1e43b8..772b20b 100644
--- a/tests/framework/tst_log.c
+++ b/tests/framework/tst_log.c
@@ -341,7 +341,7 @@ static void append_benchmark_json(struct tst_job *job, FILE *f)
fprintf(f, "tttt"Iterations": %in", job->bench_iter);
- fprintf(f, "ttt}n");
+ fprintf(f, "ttt},n");
}
static int hack_json_start = 0;
-----------------------------------------------------------------------
Summary of changes:
tests/framework/tst_log.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")