Module: synfig/synfig
Branch: master
Commit: 545d85e234bb5140f5898f06aee377cc27c406b3
URL:    
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig/synfig;a=commit;h=545d85e234bb5140f5898f06aee377cc27c406b3

Author: Nikita Kitaev <[email protected]>
Date:   Fri Nov 26 15:28:06 2010 -0800

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<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);
                }
        }
 
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<T>));
 
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<stupidp>
 {
        typedef stupidv value_type;
 };
+#endif
 
 int main()
 {


------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to