Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64295 - sandbox/SOC/2010/process/libs/process/test
From: boris_at_[hidden]
Date: 2010-07-23 08:17:40


Author: bschaeling
Date: 2010-07-23 08:17:40 EDT (Fri, 23 Jul 2010)
New Revision: 64295
URL: http://svn.boost.org/trac/boost/changeset/64295

Log:
Patch to build test cases on Linux
Text files modified:
   sandbox/SOC/2010/process/libs/process/test/Jamfile.jam | 4 ++
   sandbox/SOC/2010/process/libs/process/test/environment.cpp | 48 ++++++++++++++++++++--------------------
   2 files changed, 27 insertions(+), 25 deletions(-)

Modified: sandbox/SOC/2010/process/libs/process/test/Jamfile.jam
==============================================================================
--- sandbox/SOC/2010/process/libs/process/test/Jamfile.jam (original)
+++ sandbox/SOC/2010/process/libs/process/test/Jamfile.jam 2010-07-23 08:17:40 EDT (Fri, 23 Jul 2010)
@@ -17,7 +17,9 @@
 alias bfs : /boost//filesystem : : : <link>shared:<source>/boost//system ;
 explicit bfs ;
 
-project : requirements <target-os>windows:<define>WIN32_LEAN_AND_MEAN ;
+project : requirements
+ <target-os>windows:<define>WIN32_LEAN_AND_MEAN
+ <target-os>linux:<linkflags>-lpthread ;
 
 exe helpers : util/helpers.cpp bfs ;
 explicit helpers ;

Modified: sandbox/SOC/2010/process/libs/process/test/environment.cpp
==============================================================================
--- sandbox/SOC/2010/process/libs/process/test/environment.cpp (original)
+++ sandbox/SOC/2010/process/libs/process/test/environment.cpp 2010-07-23 08:17:40 EDT (Fri, 23 Jul 2010)
@@ -54,22 +54,22 @@
     env.insert(bp::environment_t::value_type("VAR2", "value2"));
     env.insert(bp::environment_t::value_type("VAR3", "value3"));
 
- char **ep = bpd::environment_to_envp(env);
+ std::pair<std::size_t, char**> ep = bpd::environment_to_envp(env);
 
- BOOST_REQUIRE(ep[0] != NULL);
- BOOST_REQUIRE_EQUAL(std::string(ep[0]), "VAR1=value1");
- delete[] ep[0];
-
- BOOST_REQUIRE(ep[1] != NULL);
- BOOST_REQUIRE_EQUAL(std::string(ep[1]), "VAR2=value2");
- delete[] ep[1];
-
- BOOST_REQUIRE(ep[2] != NULL);
- BOOST_REQUIRE_EQUAL(std::string(ep[2]), "VAR3=value3");
- delete[] ep[2];
+ BOOST_REQUIRE(ep.second[0] != NULL);
+ BOOST_REQUIRE_EQUAL(std::string(ep.second[0]), "VAR1=value1");
+ delete[] ep.second[0];
+
+ BOOST_REQUIRE(ep.second[1] != NULL);
+ BOOST_REQUIRE_EQUAL(std::string(ep.second[1]), "VAR2=value2");
+ delete[] ep.second[1];
+
+ BOOST_REQUIRE(ep.second[2] != NULL);
+ BOOST_REQUIRE_EQUAL(std::string(ep.second[2]), "VAR3=value3");
+ delete[] ep.second[2];
 
- BOOST_REQUIRE(ep[3] == NULL);
- delete[] ep;
+ BOOST_REQUIRE(ep.second[3] == NULL);
+ delete[] ep.second;
 }
 
 BOOST_AUTO_TEST_CASE(test_envp_unsorted)
@@ -78,18 +78,18 @@
     env.insert(bp::environment_t::value_type("VAR2", "value2"));
     env.insert(bp::environment_t::value_type("VAR1", "value1"));
 
- char **ep = bpd::environment_to_envp(env);
+ std::pair<std::size_t, char**> ep = bpd::environment_to_envp(env);
 
- BOOST_REQUIRE(ep[0] != NULL);
- BOOST_REQUIRE_EQUAL(std::string(ep[0]), "VAR1=value1");
- delete[] ep[0];
-
- BOOST_REQUIRE(ep[1] != NULL);
- BOOST_REQUIRE_EQUAL(std::string(ep[1]), "VAR2=value2");
- delete[] ep[1];
+ BOOST_REQUIRE(ep.second[0] != NULL);
+ BOOST_REQUIRE_EQUAL(std::string(ep.second[0]), "VAR1=value1");
+ delete[] ep.second[0];
+
+ BOOST_REQUIRE(ep.second[1] != NULL);
+ BOOST_REQUIRE_EQUAL(std::string(ep.second[1]), "VAR2=value2");
+ delete[] ep.second[1];
 
- BOOST_REQUIRE(ep[2] == NULL);
- delete[] ep;
+ BOOST_REQUIRE(ep.second[2] == NULL);
+ delete[] ep.second;
 }
 #endif
 


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