[Sumover-dev] [svn commit] r4556 - rat/trunk/tests

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Fri Jan 8 15:40:40 GMT 2010


Author: piers
Date: Fri Jan  8 15:40:40 2010
New Revision: 4556

Modified:
   rat/trunk/tests/Makefile
   rat/trunk/tests/rtone.c
   rat/trunk/tests/test_convert.c
   rat/trunk/tests/test_pktbuf.c
   rat/trunk/tests/test_repair.c

Log:
Fixed the tests below - though results aren't validated


Modified: rat/trunk/tests/Makefile
==============================================================================
--- rat/trunk/tests/Makefile	(original)
+++ rat/trunk/tests/Makefile	Fri Jan  8 15:40:40 2010
@@ -2,12 +2,13 @@
 DEBUG=-g
 INCLUDE = -I.. -I../../common -I../../common/src
 CFLAGS  = -W -Wall -Wbad-function-cast -Wmissing-prototypes -Werror -g -fsigned-char -DSASR -DFAST -DUSE_FLOAT_MUL -DDEBUG_MEM
-LIBS = -L../../common/src -lm -luclmmbase
+LIBS = -L../../common/src -lm -luclmmbase 
 
 CHANNEL_OBJS = ../cc_vanilla.o ../new_channel.o ../channel_types.o
 
 G728_LIB = -L../../g728lib -lg728
-CODEC_LIB = -L.. -luclcodec $(G728_LIB)
+CODEC_LIB = -L.. -luclcodec 
+CODEC_OBJS=$(CODEC_LIB)
 SNDFILE_LIB = -L../ -luclsndfile
 
 REPAIR_OBJS  = ../repair.o ../audio_util.o
@@ -22,20 +23,22 @@
 
 RTONE_OBJS = ./rtone.o
 
-test_sndfile: $(CODEC_OBJS) test_sndfile.o
-	$(CC) $(DEBUG)  -o $@ $(SNDFILE_LIB) $(CODEC_LIB) $(LIBS) test_sndfile.o
+all: test_convert rtone test_pktbuf test_repair 
 
-test_convert: $(CODEC_OBJS) test_convert.o
-	$(CC) $(DEBUG)  -o $@ $(CODEC_OBJS) $(LIBS) test_convert.o
+#test_sndfile: $(CODEC_OBJS) test_sndfile.o
+#	$(CC) $(DEBUG)  -o $@ $(SNDFILE_LIB) $(CODEC_LIB) $(LIBS) test_sndfile.o
 
-rtone: $(RTONE_OBJS) $(CODEC_OBJS) $(SNDFILE_OBJS)
+test_convert: test_convert.o
+	$(CC) $(DEBUG)  -o $@ test_convert.o $(CODEC_OBJS) $(LIBS) 
+
+rtone: $(RTONE_OBJS) $(SNDFILE_OBJS)
 	$(CC) $(DEBUG) -o $@ $(RTONE_OBJS) $(SNDFILE_LIB) $(CODEC_LIB) $(LIBS)
 
 test_pktbuf: $(PKTBUF_OBJS)
 	$(CC) $(DEBUG)  -o $@ $(PKTBUF_OBJS) $(LIBS) 
 
-test_repair: $(CODEC_OBJS) $(REPAIR_OBJS) test_repair.o 
-	$(CC) $(DEBUG)  -o $@ $(SNDFILE_LIB) $(REPAIR_OBJS) $(CODEC_LIB) $(LIBS) test_repair.o
+test_repair: $(REPAIR_OBJS) test_repair.o 
+	$(CC) $(DEBUG)  -o $@ test_repair.o $(SNDFILE_LIB) $(REPAIR_OBJS) $(CODEC_LIB) $(LIBS) 
 
 test_rdncy: $(RDNCY_OBJS) $(UTIL_OBJS)
 	$(CC) $(DEBUG) -o $@ $(RDNCY_OBJS) $(UTIL_OBJS) $(CODEC_LIB) $(LIBS)
@@ -47,17 +50,17 @@
 	$(CC) $(DEBUG)  -o $@ native.o $(CODEC_LIB) $(LIBS)
 
 test_channel: $(CHANNEL_OBJS) $(UTIL_OBJS) test_channel.o
-	$(CC) $(DEBUG)  -o $@ $(CHANNEL_OBJS) $(UTIL_OBJS) \
-	$(CODEC_LIB) $(LIBS) test_channel.o
-
+	$(CC) $(DEBUG)  -o $@  test_channel.o $(CHANNEL_OBJS) $(UTIL_OBJS) \
+	$(CODEC_LIB) $(LIBS)
 test_codecs: test_codecs.o
-	$(CC) $(DEBUG)  -o $@ $(CODEC_LIB) $(LIBS) test_codecs.o
+	$(CC) $(DEBUG)  -o $@ test_codecs.o $(CODEC_LIB) $(LIBS)
 
 test_ts: $(UTIL_OBJS) test_ts.o
 	$(CC) $(DEBUG)  -o $@ $(UTIL_OBJS) $(LIBS) test_ts.o
 
 .c.o:
-	$(CC) $(INCLUDE) $(CFLAGS) -c $< -o $@
+	$(CC) $(INCLUDE) $(CFLAGS) -c $< 
+#	$(CC) $(INCLUDE) $(CFLAGS) -c $< -o $@
 
 clean:
 	rm -rf $(CODEC_OBJS) $(3D_OBJS) $(RDNCY_OBJS) $(UTIL_OBJS) test_3d \

Modified: rat/trunk/tests/rtone.c
==============================================================================
--- rat/trunk/tests/rtone.c	(original)
+++ rat/trunk/tests/rtone.c	Fri Jan  8 15:40:40 2010
@@ -157,18 +157,16 @@
 static void
 usage()
 {
-	fprintf(stderr, "\
-rtone [-c <codec>] [-f freq] [-g gain] [-l] [-s sp] [-t ttl] [-u <upp>] addr/port
-where:
-\t-c selects the codec used.
-\t-f sets the tone frequency.
-\t-F <filename> stream file.
-\t-g sets the gain (0-32767).
-\t-j <jitter> set jitter in ms.
-\t-l lists available codecs.
-\t-s sets the speed relative to real time (>1.0 == faster).
-\t-S set rtp SSRC.
-\t-t sets ttl.
+	fprintf(stderr, "rtone [-c <codec>] [-f freq] [-g gain] [-l] [-s sp] [-t ttl] [-u <upp>] addr/port where:\
+\t-c selects the codec used.\
+\t-f sets the tone frequency.\
+\t-F <filename> stream file.\
+\t-g sets the gain (0-32767).\
+\t-j <jitter> set jitter in ms.\
+\t-l lists available codecs.\
+\t-s sets the speed relative to real time (>1.0 == faster).\
+\t-S set rtp SSRC.\
+\t-t sets ttl.\
 \t-u sets units per packet.\n");
 	exit(-1);
 }
@@ -212,7 +210,7 @@
 }
 
 static void
-rtp_callback(struct rtp *session, rtp_event *e)
+rtone_rtp_callback(struct rtp *session, rtp_event *e)
 {
 	UNUSED(session);
 	if (e->type == RX_RTP) {
@@ -309,7 +307,7 @@
 		usage();
 	}
 
-	session = rtp_init(addr, atoi(port), atoi(port), ttl, 64000, rtp_callback, NULL);
+	session = rtp_init(addr, atoi(port), atoi(port), ttl, 64000, rtone_rtp_callback, NULL);
 	if (session == NULL) {
 		fprintf(stderr, "Failed with -t %d %s/%s\n", ttl, addr, port);
 		exit(-1);
@@ -323,9 +321,7 @@
 	packet_us = 1000000 * upp * cf->format.bytes_per_block / (cf->format.channels * cf->format.sample_rate * (cf->format.bits_per_sample / 8));
 
 	printf("%s port %s ttl %d\n", addr, port, ttl);
-	printf("Codec: %s %d units per packet
-Tone freq: %d gain: %d (%f dBov)
-Packets every %ld us\n",
+	printf("Codec: %s %d units per packet Tone freq: %d gain: %d (%f dBov) Packets every %ld us\n",
 	       cf->long_name, upp,
 	       freq, gain, -20 * log(32767.0/(double)gain),
 	       packet_us);

Modified: rat/trunk/tests/test_convert.c
==============================================================================
--- rat/trunk/tests/test_convert.c	(original)
+++ rat/trunk/tests/test_convert.c	Fri Jan  8 15:40:40 2010
@@ -98,7 +98,8 @@
 static void
 dump_frame(coded_unit *cu, int offset)
 {
-        uint16_t rate, channels;
+        uint16_t channels;
+        uint32_t rate;
         sample *src;
         int i, j, n;
         codec_get_native_info( cu->id, &rate, &channels);

Modified: rat/trunk/tests/test_pktbuf.c
==============================================================================
--- rat/trunk/tests/test_pktbuf.c	(original)
+++ rat/trunk/tests/test_pktbuf.c	Fri Jan  8 15:40:40 2010
@@ -43,7 +43,7 @@
 		n = lrand48() % 16;
 		for(j = 0; j <= n; j++) {
 			pp = (rtp_packet*)xmalloc(sizeof(rtp_packet));
-			pp->ts = ts ++;
+			pp->fields.ts = ts ++;
 			add_thing(pb, pp);
 		}
 		n = lrand48() % 16;

Modified: rat/trunk/tests/test_repair.c
==============================================================================
--- rat/trunk/tests/test_repair.c	(original)
+++ rat/trunk/tests/test_repair.c	Fri Jan  8 15:40:40 2010
@@ -242,12 +242,11 @@
 static void
 usage(void)
 {
-        fprintf(stderr, "test_repair [options] -c <codec> -r <repair> -d <rate> <src_file> <dst_file>
-where options are:
-\t-codecs to list available codecs
-\t-repairs to list available repair schemes
-\t-n to disable codec specific repair (default csra permitted)
-\t-s <seed> to set seed of rng (default 0)
+        fprintf(stderr, "test_repair [options] -c <codec> -r <repair> -d <rate> <src_file> <dst_file> where options are:\
+\t-codecs to list available codecs\
+\t-repairs to list available repair schemes\
+\t-n to disable codec specific repair (default csra permitted)\
+\t-s <seed> to set seed of rng (default 0)\
 \t-u <units> set audio frames per packet (default 1 == 20ms)\n");
         exit(-1);
 }
@@ -418,14 +417,14 @@
                 exit(-1);
         }
 
-        printf("# Parameters
-#\tseed: %ld
-#\tdrop: %.2f
-#\tcodec:  %s
-#\tunits per packet: %d
-#\trepair: %s
-#\tcodec specific repair (when available): %d
-#\tsource file: %s
+        printf("# Parameters \
+#\tseed: %ld \
+#\tdrop: %.2f \
+#\tcodec:  %s \
+#\tunits per packet: %d \
+#\trepair: %s \
+#\tcodec specific repair (when available): %d \
+#\tsource file: %s \
 #\tdestination file %s\n",
 seed, drop, codec_name, units_per_packet, repair_name, csra, argv[argc - 2], argv[argc - 1]);
 



More information about the Sumover-dev mailing list