[Sumover-dev] [svn commit] r4313 - vic/branches/cc/cc/test

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Wed Nov 12 19:23:40 GMT 2008


Author: soohyunc
Date: Wed Nov 12 19:23:39 2008
New Revision: 4313

Added:
   vic/branches/cc/cc/test/cc_output.h   (contents, props changed)
   vic/branches/cc/cc/test/test.cpp   (contents, props changed)
Modified:
   vic/branches/cc/cc/test/Makefile
   vic/branches/cc/cc/test/cc_output.cpp
   vic/branches/cc/cc/test/config.h

Log:
added an example code for packet generation


Modified: vic/branches/cc/cc/test/Makefile
==============================================================================
--- vic/branches/cc/cc/test/Makefile	(original)
+++ vic/branches/cc/cc/test/Makefile	Wed Nov 12 19:23:39 2008
@@ -11,7 +11,7 @@
 
 SRCS 		:= $(wildcard *.cpp)
 OBJS		:= $(SRCS:.cpp=.o)
-APP			:= cc
+APP			:= test
 
 .PHONY: 	clean distclean
 

Modified: vic/branches/cc/cc/test/cc_output.cpp
==============================================================================
--- vic/branches/cc/cc/test/cc_output.cpp	(original)
+++ vic/branches/cc/cc/test/cc_output.cpp	Wed Nov 12 19:23:39 2008
@@ -4,17 +4,16 @@
 
 /* $Id$ */
 
-#include "buffer.h"
+#include "cc_output.h"
 
-// pre-define functions
-Buffer gen_packets(int num);
-
-int main() {
+// cc_output() method emulation
+int cc_output() {
 
 	Buffer pktbuf;
 	const int NUMPACK = 10;
 
 	pktbuf = gen_packets (NUMPACK);
+	printf("\ngenerated packet sequence numbers\n");
 	pktbuf.display();
 
 	return 0;

Added: vic/branches/cc/cc/test/cc_output.h
==============================================================================
--- (empty file)
+++ vic/branches/cc/cc/test/cc_output.h	Wed Nov 12 19:23:39 2008
@@ -0,0 +1,10 @@
+/*
+ * cc_output.h
+ */
+
+/* $Id$ */
+
+#include "buffer.h"
+
+int		cc_output();
+Buffer	gen_packets(int num);

Modified: vic/branches/cc/cc/test/config.h
==============================================================================
--- vic/branches/cc/cc/test/config.h	(original)
+++ vic/branches/cc/cc/test/config.h	Wed Nov 12 19:23:39 2008
@@ -15,4 +15,6 @@
 #include <time.h>       // support sleep function
 #include <sys/types.h>
 
+#define UNUSED(x) (x) = (x)
+
 #endif /* vic_cc_test_config_h */

Added: vic/branches/cc/cc/test/test.cpp
==============================================================================
--- (empty file)
+++ vic/branches/cc/cc/test/test.cpp	Wed Nov 12 19:23:39 2008
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+#include "buffer.h"
+#include "cc_output.h"
+
+#define UNUSED(x) (x) = (x)
+
+int main (int argc, char *argv[]) {
+
+	UNUSED(argc);
+	UNUSED(argv);
+
+	int val = cc_output();
+
+	return val;
+}



More information about the Sumover-dev mailing list