spec: Use %license macro to copy license
[platform/upstream/libtheora.git] / tests / noop_theora.c
1 /********************************************************************
2  *                                                                  *
3  * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE.   *
4  * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
5  * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6  * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
7  *                                                                  *
8  * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009                *
9  * by the Xiph.Org Foundation http://www.xiph.org/                  *
10  *                                                                  *
11  ********************************************************************
12
13   function: routines for validating codec initialization
14   last mod: $Id: noop_theora.c 16503 2009-08-22 18:14:02Z giles $
15
16  ********************************************************************/
17
18 #include <theora/theora.h>
19
20 #include "tests.h"
21
22 static int
23 noop_test_encode ()
24 {
25   theora_info ti;
26   theora_state th;
27
28   INFO ("+ Initializing theora_info struct");
29   theora_info_init (&ti);
30
31   INFO ("+ Setting a 16x16 frame");
32   ti.width = 16;
33   ti.height = 16;
34
35   INFO ("+ Initializing theora_state for encoding");
36   if (theora_encode_init (&th, &ti) != OC_DISABLED) {
37     INFO ("+ Clearing theora_state");
38     theora_clear (&th);
39   }
40
41   INFO ("+ Clearing theora_info struct");
42   theora_info_clear (&ti);
43
44   return 0;
45 }
46
47 static int
48 noop_test_decode ()
49 {
50   theora_info ti;
51   theora_state th;
52
53   INFO ("+ Initializing theora_info struct");
54   theora_info_init (&ti);
55
56   INFO ("+ Initializing theora_state for decoding");
57   theora_decode_init (&th, &ti);
58
59   INFO ("+ Clearing theora_state");
60   theora_clear (&th);
61
62   INFO ("+ Clearing theora_info struct");
63   theora_info_clear (&ti);
64
65   return 0;
66 }
67
68 static int
69 noop_test_comments ()
70 {
71   theora_comment tc;
72
73   theora_comment_init (&tc);
74   theora_comment_clear (&tc);
75
76   return 0;
77 }
78
79 int main(int argc, char *argv[])
80 {
81   /*noop_test_decode ();*/
82
83   noop_test_encode ();
84
85   noop_test_comments ();
86
87   exit (0);
88 }