1 /*
2  * exempi - test-bgo.cpp
3  *
4  * Copyright (C) 2007-2008 Hubert Figuiere
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1 Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * 2 Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the
17  * distribution.
18  *
19  * 3 Neither the name of the Authors, nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software wit hout specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34  * OF THE POSSIBILITY OF SUCH DAMAGE.
35  */
36 
37 #include <stdlib.h>
38 #include <stdio.h>
39 #include <string.h>
40 
41 #include <string>
42 
43 #include <boost/test/minimal.hpp>
44 
45 #include "utils.h"
46 #include "xmpconsts.h"
47 #include "xmp.h"
48 
test_main(int argc,char * argv[])49 int test_main(int argc, char* argv[])
50 {
51   prepare_test(argc, argv, "fdo18635.jpg");
52 
53   BOOST_CHECK(xmp_init());
54 
55   XmpFilePtr xf = xmp_files_open_new(g_testfile.c_str(), XMP_OPEN_READ);
56 
57   BOOST_CHECK(xf != NULL);
58   if (xf == NULL) {
59     return 1;
60   }
61 
62   XmpPtr xmp = xmp_files_get_new_xmp(xf);
63 
64   BOOST_CHECK(xmp != NULL);
65 
66   BOOST_CHECK(xmp_free(xmp));
67   BOOST_CHECK(xmp_files_free(xf));
68 
69   xmp_terminate();
70 
71   BOOST_CHECK(!g_lt->check_leaks());
72   BOOST_CHECK(!g_lt->check_errors());
73   return 0;
74 }
75