Boost logo

Boost-Commit :

From: hljin_at_[hidden]
Date: 2007-11-19 13:35:00


Author: hljin
Date: 2007-11-19 13:34:59 EST (Mon, 19 Nov 2007)
New Revision: 41241
URL: http://svn.boost.org/trac/boost/changeset/41241

Log:
GIL: broke the main test into small tests
Added:
   trunk/libs/gil/test/error_if.cpp (contents, props changed)
Text files modified:
   trunk/libs/gil/test/Jamfile.v2 | 28 ++++++++++++++++++++++------
   trunk/libs/gil/test/channel.cpp | 11 +++++++----
   trunk/libs/gil/test/image.cpp | 27 ++++++++++++++++++---------
   trunk/libs/gil/test/image_io.cpp | 6 ++++++
   trunk/libs/gil/test/pixel.cpp | 6 ++++++
   trunk/libs/gil/test/pixel_iterator.cpp | 6 ++++++
   6 files changed, 65 insertions(+), 19 deletions(-)

Modified: trunk/libs/gil/test/Jamfile.v2
==============================================================================
--- trunk/libs/gil/test/Jamfile.v2 (original)
+++ trunk/libs/gil/test/Jamfile.v2 2007-11-19 13:34:59 EST (Mon, 19 Nov 2007)
@@ -5,13 +5,29 @@
 import testing ;
 
 test-suite gil :
- [ run main.cpp
- image.cpp
- image_io.cpp
- pixel.cpp
- pixel_iterator.cpp
- channel.cpp
+ [ run image.cpp
            sample_image.cpp
+ error_if.cpp
+ :
+ :
+ : <include>$(BOOST_ROOT) <define>BOOST_GIL_NO_IO <define>_SCL_SECURE_NO_WARNINGS ]
+ [ run channel.cpp
+ error_if.cpp
+ :
+ :
+ : <include>$(BOOST_ROOT) <define>BOOST_GIL_NO_IO <define>_SCL_SECURE_NO_WARNINGS ]
+ [ run pixel.cpp
+ error_if.cpp
+ :
+ :
+ : <include>$(BOOST_ROOT) <define>BOOST_GIL_NO_IO <define>_SCL_SECURE_NO_WARNINGS ]
+ [ run pixel_iterator.cpp
+ error_if.cpp
+ :
+ :
+ : <include>$(BOOST_ROOT) <define>BOOST_GIL_NO_IO <define>_SCL_SECURE_NO_WARNINGS ]
+ [ run image_io.cpp
+ error_if.cpp
         :
         :
         : <include>$(BOOST_ROOT) <define>BOOST_GIL_NO_IO <define>_SCL_SECURE_NO_WARNINGS ]

Modified: trunk/libs/gil/test/channel.cpp
==============================================================================
--- trunk/libs/gil/test/channel.cpp (original)
+++ trunk/libs/gil/test/channel.cpp 2007-11-19 13:34:59 EST (Mon, 19 Nov 2007)
@@ -18,10 +18,7 @@
 using namespace boost::gil;
 using namespace std;
 
-void error_if(bool condition) {
- if (condition)
- throw std::exception();
-}
+void error_if(bool);
 
 bits8 c8_min = channel_traits<bits8 >::min_value();
 bits8 c8_max = channel_traits<bits8 >::max_value();
@@ -360,6 +357,11 @@
     do_test<reference_core<const channel_archetype&> >();
 }
 
+int main(int argc, char* argv[]) {
+ test_channel();
+ return 0;
+}
+
 // TODO:
 // - provide algorithm performance overloads for scoped channel and packed channels
 // - Update concepts and documentation
@@ -367,3 +369,4 @@
 // - Performance!!
 // - is channel_convert the same as native?
 // - is operator++ on bits32f the same as native? How about if operator++ is defined in scoped_channel to do _value++?
+

Added: trunk/libs/gil/test/error_if.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/gil/test/error_if.cpp 2007-11-19 13:34:59 EST (Mon, 19 Nov 2007)
@@ -0,0 +1,7 @@
+#include <exception>
+
+void error_if(bool condition) {
+ if (condition)
+ throw std::exception();
+}
+

Modified: trunk/libs/gil/test/image.cpp
==============================================================================
--- trunk/libs/gil/test/image.cpp (original)
+++ trunk/libs/gil/test/image.cpp 2007-11-19 13:34:59 EST (Mon, 19 Nov 2007)
@@ -18,13 +18,13 @@
 #include <string>
 #include <vector>
 #include <iostream>
+#include <fstream>
 #include <map>
 #include <boost/lambda/lambda.hpp>
 #include <boost/lambda/bind.hpp>
 #include <boost/mpl/vector.hpp>
 #include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
 #include <boost/crc.hpp>
-#include <fstream>
 
 using namespace boost::gil;
 using namespace std;
@@ -566,15 +566,24 @@
     static_checks();
 }
 
+int main(int argc, char* argv[]) {
 
+ const char* local_name = "gil_reference_checksums.txt";
+ const char* name_from_status = "../libs/gil/test/gil_reference_checksums.txt";
 
+ std::ifstream file_is_there(local_name);
+ if (file_is_there) {
+ test_image(local_name);
+ } else {
+ std::ifstream file_is_there(name_from_status);
+ if (file_is_there)
+ test_image(name_from_status);
+ else {
+ std::cerr << "Unable to open gil_reference_checksums.txt"<<std::endl;
+ return 1;
+ }
+ }
 
-
-
-
-
-
-
-
-
+ return 0;
+}
 

Modified: trunk/libs/gil/test/image_io.cpp
==============================================================================
--- trunk/libs/gil/test/image_io.cpp (original)
+++ trunk/libs/gil/test/image_io.cpp 2007-11-19 13:34:59 EST (Mon, 19 Nov 2007)
@@ -183,3 +183,9 @@
     png_write_view(out_dir+"RGBNative.png",view(anyImg));
 }
 #endif
+
+int main(int argc, char* argv[]) {
+ test_image_io();
+ return 0;
+}
+

Modified: trunk/libs/gil/test/pixel.cpp
==============================================================================
--- trunk/libs/gil/test/pixel.cpp (original)
+++ trunk/libs/gil/test/pixel.cpp 2007-11-19 13:34:59 EST (Mon, 19 Nov 2007)
@@ -324,3 +324,9 @@
     error_if(g != 8);
     error_if(g16 != 8);
 }
+
+int main(int argc, char* argv[]) {
+ test_pixel();
+ return 0;
+}
+

Modified: trunk/libs/gil/test/pixel_iterator.cpp
==============================================================================
--- trunk/libs/gil/test/pixel_iterator.cpp (original)
+++ trunk/libs/gil/test/pixel_iterator.cpp 2007-11-19 13:34:59 EST (Mon, 19 Nov 2007)
@@ -290,3 +290,9 @@
     memunit_advance(rgb8_pptr,-3);
 }
 */
+
+int main(int argc, char* argv[]) {
+ test_pixel_iterator();
+ return 0;
+}
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk