From 545d85e234bb5140f5898f06aee377cc27c406b3 Mon Sep 17 00:00:00 2001 From: Nikita Kitaev Date: Fri, 26 Nov 2010 15:28:06 -0800 Subject: [PATCH] Correct code and enable tests for ETL "spline" and "value" --- ETL/ETL/_bspline.h | 8 ++++---- ETL/ETL/_value.h | 2 +- ETL/test/Makefile.am | 16 ++++++++-------- ETL/test/spline.cpp | 10 +++++----- ETL/test/value.cpp | 2 ++ 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/ETL/ETL/_bspline.h b/ETL/ETL/_bspline.h index edc00a7..3c56683 100644 --- a/ETL/ETL/_bspline.h +++ b/ETL/ETL/_bspline.h @@ -91,11 +91,11 @@ public: while(m>(signed)_cpoints.size()) m--; for(i=0;i(signed)_cpoints.size()) m--; for(i=0;i<=(signed)_cpoints.size()-m+1;i++) - *_knots.insert(_knots.end())=i; + _knots.insert(_knots.end(), i); } } diff --git a/ETL/ETL/_value.h b/ETL/ETL/_value.h index adf7816..e7b5f0d 100644 --- a/ETL/ETL/_value.h +++ b/ETL/ETL/_value.h @@ -158,7 +158,7 @@ private: //implementation interface } public: //allocation interface - void *operator new(unsigned int size) + void *operator new(size_t size) { assert(size == sizeof(holder)); diff --git a/ETL/test/Makefile.am b/ETL/test/Makefile.am index 2b1b6e9..6a22fdb 100644 --- a/ETL/test/Makefile.am +++ b/ETL/test/Makefile.am @@ -23,9 +23,9 @@ TESTS = \ pen \ surface \ smart_ptr \ - benchmark -# spline \ -# value + benchmark \ + spline \ + value check_PROGRAMS = \ fixed \ @@ -39,9 +39,9 @@ check_PROGRAMS = \ surface \ smart_ptr \ benchmark \ - smach -# spline \ -# value + smach \ + spline \ + value benchmark_SOURCES=benchmark.cpp smart_ptr_SOURCES=smart_ptr.cpp @@ -54,9 +54,9 @@ fixed_SOURCES=fixed.cpp smach_SOURCES=smach.cpp clock_SOURCES=clock.cpp hermite_SOURCES=hermite.cpp -#spline_SOURCES=spline.cpp +spline_SOURCES=spline.cpp stringf_SOURCES=stringf.cpp -#value_SOURCES=value.cpp +value_SOURCES=value.cpp # FIXME: fix compiler errors for the spline and value tests. EXTRA_DIST = \ diff --git a/ETL/test/spline.cpp b/ETL/test/spline.cpp index eaae237..f6dfd0a 100644 --- a/ETL/test/spline.cpp +++ b/ETL/test/spline.cpp @@ -45,11 +45,11 @@ int bspline_basic_test(void) etl::clock timer; double t; - *BSpline.cpoints().insert(BSpline.cpoints().end())=0; - *BSpline.cpoints().insert(BSpline.cpoints().end())=-1; - *BSpline.cpoints().insert(BSpline.cpoints().end())=0; - *BSpline.cpoints().insert(BSpline.cpoints().end())=1; - *BSpline.cpoints().insert(BSpline.cpoints().end())=0; + BSpline.cpoints().insert(BSpline.cpoints().end(), 0.0); + BSpline.cpoints().insert(BSpline.cpoints().end(), -1.0); + BSpline.cpoints().insert(BSpline.cpoints().end(), 0.0); + BSpline.cpoints().insert(BSpline.cpoints().end(), 1.0); + BSpline.cpoints().insert(BSpline.cpoints().end(), 0.0); BSpline.set_m(4); BSpline.reset_knots(); diff --git a/ETL/test/value.cpp b/ETL/test/value.cpp index bf01490..c83e83b 100644 --- a/ETL/test/value.cpp +++ b/ETL/test/value.cpp @@ -57,11 +57,13 @@ struct stupidp } }; +#if 0 template <> class etl::value_store_type { typedef stupidv value_type; }; +#endif int main() { -- 2.7.4