summaryrefslogtreecommitdiff
path: root/Tests/FindJPEG/Test/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/FindJPEG/Test/main.c')
-rw-r--r--Tests/FindJPEG/Test/main.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/FindJPEG/Test/main.c b/Tests/FindJPEG/Test/main.c
new file mode 100644
index 000000000..0e23eff5f
--- /dev/null
+++ b/Tests/FindJPEG/Test/main.c
@@ -0,0 +1,16 @@
+#include <assert.h>
+#include <stdio.h>
+
+#include <jpeglib.h>
+
+int main()
+{
+ /* Without any JPEG file to open, test that the call fails as
+ expected. This tests that linking worked. */
+ struct jpeg_decompress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+ cinfo.err = jpeg_std_error(&jerr);
+ jpeg_create_decompress(&cinfo);
+
+ return (JPEG_LIB_VERSION != CMAKE_EXPECTED_JPEG_VERSION);
+}