From f2c7e891c4916e31ec23e1d3b9ee9f025d0caf88 Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Fri, 4 May 2012 18:50:36 +0000 Subject: [PATCH] Added 'unsigned char' as argument option to wrap, added make targets --- .cproject | 323 +++++++++++++++------------- wrap/Argument.cpp | 6 +- wrap/Module.cpp | 3 +- wrap/tests/expected/Makefile | 4 +- wrap/tests/expected/make_geometry.m | 1 + wrap/tests/geometry.h | 1 + wrap/tests/testWrap.cpp | 2 +- 7 files changed, 189 insertions(+), 151 deletions(-) diff --git a/.cproject b/.cproject index 1fa7dadc5..54f296c33 100644 --- a/.cproject +++ b/.cproject @@ -311,6 +311,14 @@ true true + + make + -j2 + testGaussianFactor.run + true + true + true + make -j2 @@ -337,7 +345,6 @@ make - tests/testBayesTree.run true false @@ -345,7 +352,6 @@ make - testBinaryBayesNet.run true false @@ -393,7 +399,6 @@ make - testSymbolicBayesNet.run true false @@ -401,7 +406,6 @@ make - tests/testSymbolicFactor.run true false @@ -409,7 +413,6 @@ make - testSymbolicFactorGraph.run true false @@ -425,20 +428,11 @@ make - tests/testBayesTree true false true - - make - -j2 - testGaussianFactor.run - true - true - true - make -j2 @@ -465,6 +459,7 @@ make + testGraph.run true false @@ -536,6 +531,7 @@ make + testInference.run true false @@ -543,6 +539,7 @@ make + testGaussianFactor.run true false @@ -550,6 +547,7 @@ make + testJunctionTree.run true false @@ -557,6 +555,7 @@ make + testSymbolicBayesNet.run true false @@ -564,6 +563,7 @@ make + testSymbolicFactorGraph.run true false @@ -633,22 +633,6 @@ false true - - make - -j2 - tests/testPose2.run - true - true - true - - - make - -j2 - tests/testPose3.run - true - true - true - make -j2 @@ -665,6 +649,22 @@ true true + + make + -j2 + tests/testPose2.run + true + true + true + + + make + -j2 + tests/testPose3.run + true + true + true + make -j2 @@ -689,26 +689,18 @@ true true - + make - -j2 - all + -j5 + nonlinear.testValues.run true true true - + make - -j2 - check - true - true - true - - - make - -j2 - clean + -j5 + nonlinear.testOrdering.run true true true @@ -745,18 +737,26 @@ true true - + make - -j5 - nonlinear.testValues.run + -j2 + all true true true - + make - -j5 - nonlinear.testOrdering.run + -j2 + check + true + true + true + + + make + -j2 + clean true true true @@ -1067,7 +1067,6 @@ make - testErrors.run true false @@ -1523,6 +1522,7 @@ make + testSimulated2DOriented.run true false @@ -1562,6 +1562,7 @@ make + testSimulated2D.run true false @@ -1569,6 +1570,7 @@ make + testSimulated3D.run true false @@ -1768,6 +1770,7 @@ make + tests/testGaussianISAM2 true false @@ -1789,6 +1792,102 @@ true true + + make + -j2 + testRot3.run + true + true + true + + + make + -j2 + testRot2.run + true + true + true + + + make + -j2 + testPose3.run + true + true + true + + + make + -j2 + timeRot3.run + true + true + true + + + make + -j2 + testPose2.run + true + true + true + + + make + -j2 + testCal3_S2.run + true + true + true + + + make + -j2 + testSimpleCamera.run + true + true + true + + + make + -j2 + testHomography2.run + true + true + true + + + make + -j2 + testCalibratedCamera.run + true + true + true + + + make + -j2 + check + true + true + true + + + make + -j2 + clean + true + true + true + + + make + -j2 + testPoint2.run + true + true + true + make -j2 @@ -1990,7 +2089,6 @@ cpack - -G DEB true false @@ -1998,7 +2096,6 @@ cpack - -G RPM true false @@ -2006,7 +2103,6 @@ cpack - -G TGZ true false @@ -2014,7 +2110,6 @@ cpack - --config CPackSourceConfig.cmake true false @@ -2036,98 +2131,74 @@ true true - + make - -j2 - testRot3.run + -j5 + check.wrap true true true - + make - -j2 - testRot2.run + -j5 + check.dynamics_unstable true true true - + make - -j2 - testPose3.run + -j5 + check.slam_unstable true true true - + make - -j2 - timeRot3.run + -j5 + check.base_unstable true true true - + make - -j2 - testPose2.run + -j5 + testSpirit.run true true true - + make - -j2 - testCal3_S2.run + -j5 + testWrap.run true true true - + make - -j2 - testSimpleCamera.run + -j5 + check.wrap true true true - + make - -j2 - testHomography2.run + -j5 + wrap_gtsam true true true - + make - -j2 - testCalibratedCamera.run - true - true - true - - - make - -j2 - check - true - true - true - - - make - -j2 - clean - true - true - true - - - make - -j2 - testPoint2.run + -j5 + wrap true true true @@ -2171,46 +2242,6 @@ false true - - make - -j5 - wrap.testSpirit.run - true - true - true - - - make - -j5 - wrap.testWrap.run - true - true - true - - - make - -j5 - check.wrap - true - true - true - - - make - -j5 - wrap_gtsam - true - true - true - - - make - -j5 - wrap - true - true - true - diff --git a/wrap/Argument.cpp b/wrap/Argument.cpp index 6fe26834e..ff42b33b1 100644 --- a/wrap/Argument.cpp +++ b/wrap/Argument.cpp @@ -28,8 +28,10 @@ using namespace wrap; /* ************************************************************************* */ string Argument::matlabClass(const string& delim) const { string result; - BOOST_FOREACH(const string& ns, namespaces) result += ns + delim; - if (type=="string") return result + "char"; + BOOST_FOREACH(const string& ns, namespaces) + result += ns + delim; + if (type=="string") + return result + "char"; if (type=="bool" || type=="int" || type=="size_t" || type=="Vector" || type=="Matrix") return result + "double"; return result + type; diff --git a/wrap/Module.cpp b/wrap/Module.cpp index e4321dd66..179ee86ef 100644 --- a/wrap/Module.cpp +++ b/wrap/Module.cpp @@ -74,7 +74,7 @@ Module::Module(const string& interfacePath, Rule comments_p = comment_p("/*", "*/") | comment_p("//", eol_p); Rule basisType_p = - (str_p("string") | "bool" | "size_t" | "int" | "double" | "char"); + (str_p("string") | "bool" | "size_t" | "int" | "double" | "char" | "unsigned char"); Rule keywords_p = (str_p("const") | "static" | "namespace" | basisType_p); @@ -306,6 +306,7 @@ void Module::matlab_code(const string& toolboxPath, validTypes.push_back("int"); validTypes.push_back("bool"); validTypes.push_back("char"); + validTypes.push_back("unsigned char"); validTypes.push_back("size_t"); validTypes.push_back("double"); validTypes.push_back("Vector"); diff --git a/wrap/tests/expected/Makefile b/wrap/tests/expected/Makefile index 8425a50e0..a8959757b 100644 --- a/wrap/tests/expected/Makefile +++ b/wrap/tests/expected/Makefile @@ -23,10 +23,12 @@ delete_Point2.$(MEXENDING): delete_Point2.cpp $(MEX) $(mex_flags) @Point2/returnChar.cpp -output @Point2/returnChar @Point2/argChar.$(MEXENDING): @Point2/argChar.cpp $(MEX) $(mex_flags) @Point2/argChar.cpp -output @Point2/argChar +@Point2/argUChar.$(MEXENDING): @Point2/argUChar.cpp + $(MEX) $(mex_flags) @Point2/argUChar.cpp -output @Point2/argUChar @Point2/vectorConfusion.$(MEXENDING): @Point2/vectorConfusion.cpp $(MEX) $(mex_flags) @Point2/vectorConfusion.cpp -output @Point2/vectorConfusion -Point2: new_Point2_.$(MEXENDING) new_Point2_dd.$(MEXENDING) delete_Point2.$(MEXENDING) @Point2/x.$(MEXENDING) @Point2/y.$(MEXENDING) @Point2/dim.$(MEXENDING) @Point2/returnChar.$(MEXENDING) @Point2/argChar.$(MEXENDING) @Point2/vectorConfusion.$(MEXENDING) +Point2: new_Point2_.$(MEXENDING) new_Point2_dd.$(MEXENDING) delete_Point2.$(MEXENDING) @Point2/x.$(MEXENDING) @Point2/y.$(MEXENDING) @Point2/dim.$(MEXENDING) @Point2/returnChar.$(MEXENDING) @Point2/argChar.$(MEXENDING) @Point2/argUChar.$(MEXENDING) @Point2/vectorConfusion.$(MEXENDING) # Point3 new_Point3_ddd.$(MEXENDING): new_Point3_ddd.cpp diff --git a/wrap/tests/expected/make_geometry.m b/wrap/tests/expected/make_geometry.m index f0fb6dae6..7baac182f 100644 --- a/wrap/tests/expected/make_geometry.m +++ b/wrap/tests/expected/make_geometry.m @@ -19,6 +19,7 @@ mex -O5 y.cpp mex -O5 dim.cpp mex -O5 returnChar.cpp mex -O5 argChar.cpp +mex -O5 argUChar.cpp mex -O5 vectorConfusion.cpp %% Point3 diff --git a/wrap/tests/geometry.h b/wrap/tests/geometry.h index 17fa85933..02502979a 100644 --- a/wrap/tests/geometry.h +++ b/wrap/tests/geometry.h @@ -15,6 +15,7 @@ class Point2 { int dim() const; char returnChar() const; void argChar(char a) const; + void argUChar(unsigned char a) const; VectorNotEigen vectorConfusion(); }; diff --git a/wrap/tests/testWrap.cpp b/wrap/tests/testWrap.cpp index 789c949dc..90ea65ebc 100644 --- a/wrap/tests/testWrap.cpp +++ b/wrap/tests/testWrap.cpp @@ -84,7 +84,7 @@ TEST( wrap, parse ) { Class cls = module.classes.at(0); EXPECT(assert_equal("Point2", cls.name)); EXPECT_LONGS_EQUAL(2, cls.constructors.size()); - EXPECT_LONGS_EQUAL(6, cls.methods.size()); + EXPECT_LONGS_EQUAL(7, cls.methods.size()); EXPECT_LONGS_EQUAL(0, cls.static_methods.size()); EXPECT_LONGS_EQUAL(0, cls.namespaces.size()); }