~ubuntu-branches/ubuntu/maverick/openturns/maverick

« back to all changes in this revision

Viewing changes to lib/test/t_Library_std.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Fabrice Coutadeur
  • Date: 2009-08-18 18:14:38 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090818181438-copqi92r4z7y0ejc
Tags: 0.13.1-1ubuntu1
debian/python-openturns.install: update to use python* and *-packages.
This fix a FTBFS with python2.6.  (LP: #350437)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21
21
 *
22
22
 *  @author: $LastChangedBy: dutka $
23
 
 *  @date:   $LastChangedDate: 2007-09-28 12:38:16 +0200 (ven 28 sep 2007) $
24
 
 *  Id:      $Id: t_Library_std.cxx 551 2007-09-28 10:38:16Z dutka $
 
23
 *  @date:   $LastChangedDate: 2009-05-28 14:47:53 +0200 (jeu. 28 mai 2009) $
 
24
 *  Id:      $Id: t_Library_std.cxx 1262 2009-05-28 12:47:53Z dutka $
25
25
 */
26
26
#include <iostream>
27
27
#include <sstream>
29
29
#include <cstdlib>
30
30
#include "OT.hxx"
31
31
#include "OTtestcode.hxx"
 
32
#include "OStream.hxx"
32
33
#include "LibraryLoader.hxx"
33
34
#include "Library.hxx"
34
35
 
35
36
using namespace OT;
36
37
using namespace OT::Test;
37
38
using namespace OT::Base::Common;
 
39
using namespace OT::Base::Common;
38
40
using namespace OT::Base::Func;
39
41
 
40
42
 
41
43
int main(int argc, char *argv[])
42
44
{
43
45
  TESTPREAMBLE;
 
46
  OStream fullprint(std::cout);
44
47
 
45
48
  try {
46
49
    const String path(std::getenv("OPENTURNS_WRAPPER_PATH"));
49
52
    LibraryLoader & loader = LibraryLoader::GetInstance();
50
53
 
51
54
    try {
 
55
#ifndef WIN32
52
56
      String libraryPath1 = path + "/testwrapper_1.so";
 
57
#else
 
58
      String libraryPath1 = path + "/testwrapper_1-0.dll";
 
59
#endif
53
60
      Library library = loader.load( libraryPath1.c_str() );
54
 
      std::cout << loader  << std::endl;
55
 
      std::cout << library << std::endl;
 
61
      fullprint << loader  << std::endl;
 
62
      fullprint << library << std::endl;
56
63
 
57
64
      OT::LibrarySymbol symbol = library.getSymbol("fonction1");
58
 
      std::cout << "Symbol found at address " << symbol << std::endl;
 
65
      fullprint << "Symbol found at address " << symbol << std::endl;
59
66
 
60
67
 
61
68
    }
62
69
    catch (DynamicLibraryException & ex) {
63
 
      throw TestFailed(ex.str());
 
70
      throw TestFailed(ex.__repr__());
64
71
    }
65
72
 
66
73