test mussa class
authorDiane Trout <diane@caltech.edu>
Wed, 22 Feb 2006 02:06:03 +0000 (02:06 +0000)
committerDiane Trout <diane@caltech.edu>
Wed, 22 Feb 2006 02:06:03 +0000 (02:06 +0000)
Also the test case extension should match that of the other source
files.

Makefile
mussa.cxx
test/module.mk
test/test_flp.cpp [deleted file]
test/test_flp.cxx [new file with mode: 0644]
test/test_main.cpp [deleted file]
test/test_main.cxx [new file with mode: 0644]
test/test_mussa.cxx [new file with mode: 0644]
test/test_nway.cpp [deleted file]
test/test_nway.cxx [new file with mode: 0644]

index dd18cf51f77dc3b193bd44d09b82574430130c8c..0b09c3b4cbe044bf8706c6e6a6974108d2ae60d5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,7 @@ BINEXT :=
 OBJEXT := .o
 LIBEXT := .a
 
+CXX := g++ 
 CXXFLAGS :=  
 LDFLAGS := 
 
@@ -24,19 +25,22 @@ include test/module.mk
 include module.mk
 
 # process what the module.mks defined
-OBJ := $(patsubst %.cxx,%.o, $(filter %.cxx,$(SRC)))
+OBJ := $(patsubst %.cxx,%.o, $(filter %.cxx,$(SRC))) 
 DEPS := $(OBJ:.o=.d)
 
 targets: $(TARGETLIBS) $(TARGETBINS)
 
-#mussa: $(OBJ)
-#      g++ -o $@ $(CXXFLAGS) $(LDFLAGS) $^
-
+# $(call make-depend,source-file,object-file,depend-file)
+define make-depend
+  $(CXX) -MM -MF $3 -MP -MT $2 $(CFLAGS) $(CXXFLAGS) $1
+endef
+       
 %.d: %.cxx
-       makedepend -o.d $(dirname $^) $(CFLAGS) $(CXXFILAGS) $^ -f- > $@
+       $(call make-depend,$<,$@,$(subst .o,.d,$@))
+#      makedepend -o.d $(dirname $^) $(CFLAGS) $(CXXFILAGS) $^ -f- > $@
 
 %.o: %.cxx
-       g++ -c -o $@ $(CXXFLAGS) $^
+       $(CXX) -c -o $@ $(CXXFLAGS) $^
 
 include $(DEPS)
 
index 7dabcdbba5655a8f925fbcceed59043f96016a82..9b7b393bd34f79939177c80293712745ea3c998f 100644 (file)
--- a/mussa.cxx
+++ b/mussa.cxx
@@ -105,7 +105,6 @@ parse_args(int argc, char **argv, string *a_file_path, int *window,
   *ana_mode = 't'; // default to transitivie analyses mode
 
 
   // no args means gui only mode
   if (argc == 1)
     run_mode = 'g';
@@ -188,7 +187,6 @@ parse_args(int argc, char **argv, string *a_file_path, int *window,
       }
     }
   }
-
   return run_mode;
 }
 
index adefb3416baf5be6df324b42be7c635d40abed7f..62b5aea672babb3be8ff1c713fb7cd099cdf4461 100644 (file)
@@ -1,8 +1,9 @@
 CURDIR := $(BASEDIR)test/
 
-SOURCES.cxx := test_main.cpp \
-               test_flp.cpp \
-               test_nway.cpp
+SOURCES.cxx := test_main.cxx \
+               test_flp.cxx \
+                                                        test_mussa.cxx \
+               test_nway.cxx
 
 TESTSRC := $(addprefix $(CURDIR), $(SOURCES.cxx))
 
diff --git a/test/test_flp.cpp b/test/test_flp.cpp
deleted file mode 100644 (file)
index a9a89a9..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <boost/test/auto_unit_test.hpp>
-
-#include "flp.hh"
-
-BOOST_AUTO_TEST_CASE( flp_test )
-{
-  FLPs flp;
-}
diff --git a/test/test_flp.cxx b/test/test_flp.cxx
new file mode 100644 (file)
index 0000000..a9a89a9
--- /dev/null
@@ -0,0 +1,8 @@
+#include <boost/test/auto_unit_test.hpp>
+
+#include "flp.hh"
+
+BOOST_AUTO_TEST_CASE( flp_test )
+{
+  FLPs flp;
+}
diff --git a/test/test_main.cpp b/test/test_main.cpp
deleted file mode 100644 (file)
index 39987f2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define BOOST_AUTO_TEST_MAIN
-#include <boost/test/auto_unit_test.hpp>
-
diff --git a/test/test_main.cxx b/test/test_main.cxx
new file mode 100644 (file)
index 0000000..39987f2
--- /dev/null
@@ -0,0 +1,3 @@
+#define BOOST_AUTO_TEST_MAIN
+#include <boost/test/auto_unit_test.hpp>
+
diff --git a/test/test_mussa.cxx b/test/test_mussa.cxx
new file mode 100644 (file)
index 0000000..41b6b7b
--- /dev/null
@@ -0,0 +1,27 @@
+#include <boost/test/auto_unit_test.hpp>
+
+#include "alg/mussa_class.hh"
+
+//! can we initialize a mussa object?
+BOOST_AUTO_TEST_CASE( mussa_simple )
+{
+  Mussa m;
+  BOOST_CHECK_EQUAL(m.get_name(), "" );
+  BOOST_CHECK_EQUAL(m.get_window(), 0);
+  BOOST_CHECK_EQUAL(m.get_threshold(), 0);
+  BOOST_CHECK_EQUAL(m.get_analysis_mode(), Mussa::TransitiveNway);
+  m.set_name( "hello" );
+  BOOST_CHECK_EQUAL(m.get_name(), "hello" );
+  m.set_window(30);
+  BOOST_CHECK_EQUAL(m.get_window(), 30);
+  m.set_threshold(21);
+  BOOST_CHECK_EQUAL(m.get_threshold(), 21);
+  m.set_analysis_mode(Mussa::RadialNway);
+  BOOST_CHECK_EQUAL(m.get_analysis_mode(), Mussa::RadialNway);
+    
+  m.clear();
+  BOOST_CHECK_EQUAL(m.get_name(), "" );
+  BOOST_CHECK_EQUAL(m.get_window(), 0);
+  BOOST_CHECK_EQUAL(m.get_threshold(), 0);
+  BOOST_CHECK_EQUAL(m.get_analysis_mode(), Mussa::TransitiveNway);
+}
diff --git a/test/test_nway.cpp b/test/test_nway.cpp
deleted file mode 100644 (file)
index efd7889..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <boost/test/auto_unit_test.hpp>
-
-BOOST_AUTO_TEST_CASE( nway_test )
-{
-}
diff --git a/test/test_nway.cxx b/test/test_nway.cxx
new file mode 100644 (file)
index 0000000..efd7889
--- /dev/null
@@ -0,0 +1,5 @@
+#include <boost/test/auto_unit_test.hpp>
+
+BOOST_AUTO_TEST_CASE( nway_test )
+{
+}