include/SDL_test_compare.h
author Andreas Schiffler <aschiffler@ferzkopp.net>
Sat, 22 Dec 2012 16:06:55 -0800
changeset 6763 9cbd31a3450b
child 6772 5229a117ef97
permissions -rw-r--r--
Test lib updates: updated harness to support filtering, added surface comparer, updated interface to test images; added Render test suite from GSOC project
aschiffler@6763
     1
/*
aschiffler@6763
     2
  Simple DirectMedia Layer
aschiffler@6763
     3
  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
aschiffler@6763
     4
aschiffler@6763
     5
  This software is provided 'as-is', without any express or implied
aschiffler@6763
     6
  warranty.  In no event will the authors be held liable for any damages
aschiffler@6763
     7
  arising from the use of this software.
aschiffler@6763
     8
aschiffler@6763
     9
  Permission is granted to anyone to use this software for any purpose,
aschiffler@6763
    10
  including commercial applications, and to alter it and redistribute it
aschiffler@6763
    11
  freely, subject to the following restrictions:
aschiffler@6763
    12
aschiffler@6763
    13
  1. The origin of this software must not be misrepresented; you must not
aschiffler@6763
    14
     claim that you wrote the original software. If you use this software
aschiffler@6763
    15
     in a product, an acknowledgment in the product documentation would be
aschiffler@6763
    16
     appreciated but is not required.
aschiffler@6763
    17
  2. Altered source versions must be plainly marked as such, and must not be
aschiffler@6763
    18
     misrepresented as being the original software.
aschiffler@6763
    19
  3. This notice may not be removed or altered from any source distribution.
aschiffler@6763
    20
*/
aschiffler@6763
    21
aschiffler@6763
    22
/**
aschiffler@6763
    23
 *  \file SDL_test_compare.h
aschiffler@6763
    24
 *  
aschiffler@6763
    25
 *  Include file for SDL test framework.
aschiffler@6763
    26
 *
aschiffler@6763
    27
 *  This code is a part of the SDL2_test library, not the main SDL library.
aschiffler@6763
    28
 */
aschiffler@6763
    29
aschiffler@6763
    30
/* 
aschiffler@6763
    31
aschiffler@6763
    32
 Defines comparison functions (i.e. for surfaces).
aschiffler@6763
    33
  
aschiffler@6763
    34
*/
aschiffler@6763
    35
aschiffler@6763
    36
#ifndef _SDL_test_compare_h
aschiffler@6763
    37
#define _SDL_test_compare_h
aschiffler@6763
    38
aschiffler@6763
    39
#include "SDL.h"
aschiffler@6763
    40
#include "SDL_test_images.h"
aschiffler@6763
    41
aschiffler@6763
    42
#include "begin_code.h"
aschiffler@6763
    43
/* Set up for C function definitions, even when using C++ */
aschiffler@6763
    44
#ifdef __cplusplus
aschiffler@6763
    45
/* *INDENT-OFF* */
aschiffler@6763
    46
extern "C" {
aschiffler@6763
    47
/* *INDENT-ON* */
aschiffler@6763
    48
#endif
aschiffler@6763
    49
aschiffler@6763
    50
/**
aschiffler@6763
    51
 * \brief Compares a surface and with reference image data for equality
aschiffler@6763
    52
 *
aschiffler@6763
    53
 * \param sur Surface used in comparison
aschiffler@6763
    54
 * \param img Test Surface used in comparison
aschiffler@6763
    55
 * \param allowable_error Allowable difference in blending accuracy
aschiffler@6763
    56
 *
aschiffler@6763
    57
 * \returns 0 if comparison succeeded, >0 (=number of pixels where comparison failed) if comparison failed, <0 for any other error.
aschiffler@6763
    58
 */
aschiffler@6763
    59
int SDLTest_CompareSurfaces(SDL_Surface *sur, SDL_Surface *img, int allowable_error);
aschiffler@6763
    60
      
aschiffler@6763
    61
aschiffler@6763
    62
/* Ends C function definitions when using C++ */
aschiffler@6763
    63
#ifdef __cplusplus
aschiffler@6763
    64
/* *INDENT-OFF* */
aschiffler@6763
    65
}
aschiffler@6763
    66
/* *INDENT-ON* */
aschiffler@6763
    67
#endif
aschiffler@6763
    68
#include "close_code.h"
aschiffler@6763
    69
aschiffler@6763
    70
#endif /* _SDL_test_compare_h */
aschiffler@6763
    71
aschiffler@6763
    72
/* vi: set ts=4 sw=4 expandtab: */