[xiph-commits] r12746 - in trunk/theora-exp: . tests
j at svn.xiph.org
j at svn.xiph.org
Tue Mar 13 01:49:12 PDT 2007
Author: j
Date: 2007-03-13 01:49:08 -0700 (Tue, 13 Mar 2007)
New Revision: 12746
Added:
trunk/theora-exp/tests/
Modified:
trunk/theora-exp/Makefile.am
trunk/theora-exp/configure.ac
trunk/theora-exp/tests/Makefile.am
trunk/theora-exp/tests/comment-test.c
trunk/theora-exp/tests/noop.c
Log:
add tests from theora-trunk to exp
Modified: trunk/theora-exp/Makefile.am
===================================================================
--- trunk/theora-exp/Makefile.am 2007-03-13 00:09:43 UTC (rev 12745)
+++ trunk/theora-exp/Makefile.am 2007-03-13 08:49:08 UTC (rev 12746)
@@ -3,7 +3,7 @@
EXTRA_DIST = doc
-SUBDIRS = lib include examples
+SUBDIRS = lib include examples tests
if TH_ENCODER
TH_ENCODER_FILES=theoraenc.pc
Modified: trunk/theora-exp/configure.ac
===================================================================
--- trunk/theora-exp/configure.ac 2007-03-13 00:09:43 UTC (rev 12745)
+++ trunk/theora-exp/configure.ac 2007-03-13 08:49:08 UTC (rev 12746)
@@ -177,6 +177,7 @@
include/theora/compat/Makefile
include/theora/compat/theora/Makefile
examples/Makefile
+ tests/Makefile
theoradec.pc
theoraenc.pc
theoracompat.pc
Copied: trunk/theora-exp/tests (from rev 12672, trunk/theora/tests)
Modified: trunk/theora-exp/tests/Makefile.am
===================================================================
--- trunk/theora/tests/Makefile.am 2007-03-07 12:53:47 UTC (rev 12672)
+++ trunk/theora-exp/tests/Makefile.am 2007-03-13 08:49:08 UTC (rev 12746)
@@ -5,19 +5,20 @@
AM_CFLAGS = $(OGG_CFLAGS)
THEORADIR = ../lib
-THEORA_LIBS = $(THEORADIR)/libtheora.la $(OGG_LIBS)
+THEORA_LIBS = $(THEORADIR)/libtheoradec.la $(OGG_LIBS)
test: check
TESTS_ENVIRONMENT = $(VALGRIND_ENVIRONMENT)
-TESTS = noop comment-test
+#TESTS = noop comment-test
+TESTS = comment-test
noinst_PROGRAMS = $(TESTS)
-noop_SOURCES = noop.c
-noop_LDADD = $(THEORA_LIBS)
-noop_CFLAGS = $(OGG_CFLAGS)
+#noop_SOURCES = noop.c
+#noop_LDADD = $(THEORA_LIBS) $(THEORADIR)/libtheoraenc.la
+#noop_CFLAGS = $(OGG_CFLAGS)
comment_test_SOURCES = comment-test.c
comment_test_LDADD = $(THEORA_LIBS)
Modified: trunk/theora-exp/tests/comment-test.c
===================================================================
--- trunk/theora/tests/comment-test.c 2007-03-07 12:53:47 UTC (rev 12672)
+++ trunk/theora-exp/tests/comment-test.c 2007-03-13 08:49:08 UTC (rev 12746)
@@ -1,4 +1,4 @@
-#include <theora/theora.h>
+#include <theora/theoradec.h>
#include <string.h>
#include "tests.h"
@@ -11,55 +11,55 @@
static int
test_comments ()
{
- theora_comment tc;
+ th_comment tc;
int i, n;
char * value;
- INFO ("+ Initializing theora_comment");
- theora_comment_init (&tc);
+ INFO ("+ Initializing th_comment");
+ th_comment_init (&tc);
INFO ("+ Adding ARTIST1");
- theora_comment_add (&tc, "ARTIST=" ARTIST1);
+ th_comment_add (&tc, "ARTIST=" ARTIST1);
INFO ("+ Adding LICENSE by tag");
- theora_comment_add_tag (&tc, "LICENSE", LICENSE);
+ th_comment_add_tag (&tc, "LICENSE", LICENSE);
INFO ("+ Adding ARTIST2 by tag");
- theora_comment_add_tag (&tc, "ARTIST", ARTIST2);
+ th_comment_add_tag (&tc, "ARTIST", ARTIST2);
INFO ("+ Querying value of LICENSE");
- value = theora_comment_query (&tc, "LICENSE", 0);
+ value = th_comment_query (&tc, "LICENSE", 0);
if (strcmp (value, LICENSE))
FAIL ("Incorrect value for LICENSE");
INFO ("+ Querying count of ARTIST comments");
- n = theora_comment_query_count (&tc, "ARTIST");
+ n = th_comment_query_count (&tc, "ARTIST");
if (n != 2)
FAIL ("Incorrect count of ARTIST comments");
INFO ("+ Querying value of ARTIST index 0");
- value = theora_comment_query (&tc, "ARTIST", 0);
+ value = th_comment_query (&tc, "ARTIST", 0);
if (strcmp (value, ARTIST1))
FAIL ("Incorrect value for ARTIST index 0");
INFO ("+ Querying value of ARTIST index 1");
- value = theora_comment_query (&tc, "ARTIST", 1);
+ value = th_comment_query (&tc, "ARTIST", 1);
if (strcmp (value, ARTIST2))
FAIL ("Incorrect value for ARTIST index 1");
INFO ("+ Querying value of ARTIST index 2 (out of bounds)");
- value = theora_comment_query (&tc, "ARTIST", 2);
+ value = th_comment_query (&tc, "ARTIST", 2);
if (value != NULL)
FAIL ("Non-NULL value for ARTIST index 2 (out of bounds)");
INFO ("+ Querying value of UNDEF index 7 (tag not defined)");
- value = theora_comment_query (&tc, "UNDEF", 7);
+ value = th_comment_query (&tc, "UNDEF", 7);
if (value != NULL)
FAIL ("Non-NULL value for UNDEF index 7 (tag not defined)");
- INFO ("+ Clearing theora_comment");
- theora_comment_clear (&tc);
+ INFO ("+ Clearing th_comment");
+ th_comment_clear (&tc);
return 0;
}
Modified: trunk/theora-exp/tests/noop.c
===================================================================
--- trunk/theora/tests/noop.c 2007-03-07 12:53:47 UTC (rev 12672)
+++ trunk/theora-exp/tests/noop.c 2007-03-13 08:49:08 UTC (rev 12746)
@@ -1,24 +1,26 @@
-#include <theora/theora.h>
+#include <theora/theoradec.h>
+#include <theora/theoraenc.h>
#include "tests.h"
static int
noop_test_encode ()
{
- theora_info ti;
- theora_state th;
+ th_info ti;
+ th_enc_ctx th;
- INFO ("+ Initializing theora_info struct");
- theora_info_init (&ti);
+ INFO ("+ Initializing th_info struct");
+ th_info_init (&ti);
- INFO ("+ Initializing theora_state for encoding");
- if (theora_encode_init (&th, &ti) != OC_DISABLED) {
- INFO ("+ Clearing theora_state");
- theora_clear (&th);
+ INFO ("+ Initializing th_state for encoding");
+ th = th_encode_alloc(&ti);
+ if (th != NULL) {
+ INFO ("+ Clearing th_state");
+ th_clear (&th);
}
- INFO ("+ Clearing theora_info struct");
- theora_info_clear (&ti);
+ INFO ("+ Clearing th_info struct");
+ th_info_clear (&ti);
return 0;
}
@@ -26,20 +28,20 @@
static int
noop_test_decode ()
{
- theora_info ti;
- theora_state th;
+ th_info ti;
+ th_dec_ctx th;
- INFO ("+ Initializing theora_info struct");
- theora_info_init (&ti);
+ INFO ("+ Initializing th_info struct");
+ th_info_init (&ti);
- INFO ("+ Initializing theora_state for decoding");
- theora_decode_init (&th, &ti);
+ INFO ("+ Initializing th_state for decoding");
+ th_decode_init (&th, &ti);
- INFO ("+ Clearing theora_state");
- theora_clear (&th);
+ INFO ("+ Clearing th_state");
+ th_clear (&th);
- INFO ("+ Clearing theora_info struct");
- theora_info_clear (&ti);
+ INFO ("+ Clearing th_info struct");
+ th_info_clear (&ti);
return 0;
}
@@ -47,10 +49,10 @@
static int
noop_test_comments ()
{
- theora_comment tc;
+ th_comment tc;
- theora_comment_init (&tc);
- theora_comment_clear (&tc);
+ th_comment_init (&tc);
+ th_comment_clear (&tc);
return 0;
}
More information about the commits
mailing list