From b384395585f928abbda1953f4b4283eaa6428460 Mon Sep 17 00:00:00 2001
From: marco <marco@5a81b35b-ba03-0410-adc8-b2c5c5119f08>
Date: Wed, 12 May 2010 08:21:45 +0000
Subject: [PATCH] fixes for unit tests to link/work properly with
 -fvisibility=hidden

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2249 5a81b35b-ba03-0410-adc8-b2c5c5119f08
---
 modules/base/src/CMakeLists.txt              |  2 --
 modules/base/src/integrity_error.cc          | 29 -------------------
 modules/base/src/integrity_error.hh          |  6 ++--
 modules/base/src/invalid_handle.cc           | 30 --------------------
 modules/base/src/invalid_handle.hh           |  6 ++--
 modules/base/src/test_utils/compare_files.cc |  3 ++
 modules/base/src/test_utils/compare_files.hh |  8 +++++-
 7 files changed, 18 insertions(+), 66 deletions(-)
 delete mode 100644 modules/base/src/integrity_error.cc
 delete mode 100644 modules/base/src/invalid_handle.cc

diff --git a/modules/base/src/CMakeLists.txt b/modules/base/src/CMakeLists.txt
index c2d698cf9..30660f6d5 100644
--- a/modules/base/src/CMakeLists.txt
+++ b/modules/base/src/CMakeLists.txt
@@ -1,7 +1,5 @@
 set(OST_BASE_SOURCES 
 generic_property.cc
-invalid_handle.cc
-integrity_error.cc
 log.cc
 profile.cc
 units.cc
diff --git a/modules/base/src/integrity_error.cc b/modules/base/src/integrity_error.cc
deleted file mode 100644
index ced74b0c9..000000000
--- a/modules/base/src/integrity_error.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-//------------------------------------------------------------------------------
-// This file is part of the OpenStructure project <www.openstructure.org>
-//
-// Copyright (C) 2008-2010 by the OpenStructure authors
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License as published by the Free
-// Software Foundation; either version 3.0 of the License, or (at your option)
-// any later version.
-// This library is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-// FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
-// details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this library; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-//------------------------------------------------------------------------------
-#include "integrity_error.hh"
-#include <ost/message.hh>
-
-namespace ost {
-IntegrityError::IntegrityError(const String& msg):
-  Error(msg)
-{
-  
-}
-
-}
diff --git a/modules/base/src/integrity_error.hh b/modules/base/src/integrity_error.hh
index 45c4e263c..95f371dc8 100644
--- a/modules/base/src/integrity_error.hh
+++ b/modules/base/src/integrity_error.hh
@@ -25,9 +25,11 @@
 
 namespace ost {
 
-class DLLEXPORT_OST_BASE IntegrityError : public Error {
+class DLLEXPORT IntegrityError : public Error {
 public:
-  IntegrityError(const String& msg);  
+  IntegrityError::IntegrityError(const String& msg):
+    Error(msg)
+  { } 
 };
 
 }
diff --git a/modules/base/src/invalid_handle.cc b/modules/base/src/invalid_handle.cc
deleted file mode 100644
index 86a631ad5..000000000
--- a/modules/base/src/invalid_handle.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-//------------------------------------------------------------------------------
-// This file is part of the OpenStructure project <www.openstructure.org>
-//
-// Copyright (C) 2008-2010 by the OpenStructure authors
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License as published by the Free
-// Software Foundation; either version 3.0 of the License, or (at your option)
-// any later version.
-// This library is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-// FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
-// details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this library; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-//------------------------------------------------------------------------------
-#include <ost/message.hh>
-
-#include "invalid_handle.hh"
-
-namespace ost {
-
-InvalidHandle::InvalidHandle()
-  : Error("Can not access invalid handle or view") {
-    
-}
-
-}
diff --git a/modules/base/src/invalid_handle.hh b/modules/base/src/invalid_handle.hh
index 03814ef7b..33292cfe0 100644
--- a/modules/base/src/invalid_handle.hh
+++ b/modules/base/src/invalid_handle.hh
@@ -27,9 +27,11 @@
 namespace ost {
 
 /// \brief Signals access of member functions of invalid handles
-class DLLEXPORT_OST_BASE InvalidHandle : public Error {
+class DLLEXPORT InvalidHandle : public Error {
 public:
-  InvalidHandle();
+  InvalidHandle::InvalidHandle()
+    : Error("Can not access invalid handle or view") 
+  {}
 }; 
 
 template <typename H>
diff --git a/modules/base/src/test_utils/compare_files.cc b/modules/base/src/test_utils/compare_files.cc
index ff5578299..a1c1b9307 100644
--- a/modules/base/src/test_utils/compare_files.cc
+++ b/modules/base/src/test_utils/compare_files.cc
@@ -21,6 +21,7 @@
 #include <fstream>
 #include "compare_files.hh"
 
+namespace ost {
 bool compare_files(const String& test, const String& gold_standard)
 {
   std::ifstream test_stream(test.c_str());
@@ -50,3 +51,5 @@ bool compare_files(const String& test, const String& gold_standard)
   }
   return true;
 }
+
+}
diff --git a/modules/base/src/test_utils/compare_files.hh b/modules/base/src/test_utils/compare_files.hh
index 7f441ae69..8944e0805 100644
--- a/modules/base/src/test_utils/compare_files.hh
+++ b/modules/base/src/test_utils/compare_files.hh
@@ -21,7 +21,13 @@
 #define OST_COMPARE_FILES_HH
 
 #include <ost/base.hh>
+#include <ost/module_config.hh>
+
+namespace ost {
+
+bool DLLEXPORT_OST_BASE compare_files(const String& test, 
+                                      const String& gold_standard);  
+}
 
-bool compare_files(const String& test, const String& gold_standard);
 
 #endif
-- 
GitLab