Correct code and enable tests for ETL "spline" and "value"
authorNikita Kitaev <nikitakit@gmail.com>
Fri, 26 Nov 2010 23:28:06 +0000 (15:28 -0800)
committerCarlos Lopez <genetita@gmail.com>
Sun, 12 Dec 2010 20:28:57 +0000 (21:28 +0100)
ETL/ETL/_bspline.h
ETL/ETL/_value.h
ETL/test/Makefile.am
ETL/test/spline.cpp
ETL/test/value.cpp

index edc00a7..3c56683 100644 (file)
@@ -91,11 +91,11 @@ public:
                        while(m>(signed)_cpoints.size())
                                m--;
                        for(i=0;i<m;i++)
-                               *_knots.insert(_knots.end())=0;
+                               _knots.insert(_knots.end(), 0);
                        for(i=1;i<(signed)_cpoints.size()-m+1;i++)
-                               *_knots.insert(_knots.end())=i;
+                               _knots.insert(_knots.end(), i);
                        for(i=0;i<m;i++)
-                               *_knots.insert(_knots.end())=_cpoints.size()-m+1;
+                               _knots.insert(_knots.end(), _cpoints.size()-m+1);
                }
                else
                {
@@ -105,7 +105,7 @@ public:
                        while(m>(signed)_cpoints.size())
                                m--;
                        for(i=0;i<=(signed)_cpoints.size()-m+1;i++)
-                               *_knots.insert(_knots.end())=i;
+                               _knots.insert(_knots.end(), i);
                }
        }
 
index adf7816..e7b5f0d 100644 (file)
@@ -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<T>));
 
index 2b1b6e9..6a22fdb 100644 (file)
@@ -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 = \
index eaae237..f6dfd0a 100644 (file)
@@ -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();
index bf01490..c83e83b 100644 (file)
@@ -57,11 +57,13 @@ struct stupidp
        }
 };
 
+#if 0
 template <>
 class etl::value_store_type<stupidp>
 {
        typedef stupidv value_type;
 };
+#endif
 
 int main()
 {