summaryrefslogtreecommitdiff
path: root/Build/source/libs/gd/libgd-2.1.0/tests/gdtest/gdtest.h
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2013-06-26 12:09:00 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2013-06-26 12:09:00 +0000
commitdf90ed95f154046518bf7aae7f88715f25a312db (patch)
tree104818c62bab65b2988983110fdca9b35927c5e7 /Build/source/libs/gd/libgd-2.1.0/tests/gdtest/gdtest.h
parent4e17498848c230539b58d870938a77805039046d (diff)
libgd 2.1.0
git-svn-id: svn://tug.org/texlive/trunk@30952 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/gd/libgd-2.1.0/tests/gdtest/gdtest.h')
-rw-r--r--Build/source/libs/gd/libgd-2.1.0/tests/gdtest/gdtest.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/Build/source/libs/gd/libgd-2.1.0/tests/gdtest/gdtest.h b/Build/source/libs/gd/libgd-2.1.0/tests/gdtest/gdtest.h
new file mode 100644
index 00000000000..81bded5a0f6
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.0/tests/gdtest/gdtest.h
@@ -0,0 +1,44 @@
+#ifndef GD_TEST_H
+#define GD_TEST_H
+
+#include <stdarg.h>
+#include "test_config.h"
+
+#define GDTEST_STRING_MAX 1024
+typedef struct CuTestImageResult CuTestImageResult;
+struct CuTestImageResult {
+ unsigned int pixels_changed;
+ unsigned int max_diff;
+};
+
+
+/* Internal versions of assert functions -- use the public versions */
+gdImagePtr gdTestImageFromPng(const char *filename);
+
+void gdTestImageDiff(gdImagePtr buf_a, gdImagePtr buf_b,
+ gdImagePtr buf_diff, CuTestImageResult *result_ret);
+
+int gdTestImageCompareToImage(const char* file, unsigned int line, const char* message,
+ gdImagePtr expected, gdImagePtr actual);
+
+int gdTestImageCompareToFile(const char* file, unsigned int line, const char* message,
+ const char *expected_file, gdImagePtr actual);
+
+int _gdTestAssert(const char* file, unsigned int line, const char* message, int condition);
+
+int _gdTestErrorMsg(const char* file, unsigned int line, const char* string, ...);
+
+/* public assert functions */
+#define gdAssertImageEqualsToFile(ex,ac) gdTestImageCompareToFile(__FILE__,__LINE__,NULL,(ex),(ac))
+#define gdAssertImageFileEqualsMsg(ex,ac) gdTestImageCompareFiles(__FILE__,__LINE__,(ms),(ex),(ac))
+
+#define gdAssertImageEquals(tc,ex,ac) CuAssertImageEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac))
+#define gdAssertImageEqualsMsg(tc,ex,ac) CuAssertImageEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac))
+
+#define gdTestAssert(cond) _gdTestAssert(__FILE__, __LINE__, "assert failed in <%s:%i>\n", (cond))
+
+#define gdTestErrorMsg(...) _gdTestErrorMsg(__FILE__, __LINE__, __VA_ARGS__)
+
+void gdSilence(int priority, const char *format, va_list args);
+
+#endif /* GD_TEST_H */