Ticket 734: Default gtopo30 not set in objects hudson-beamb-20-FAILURE
authorAnders Henja <anders@baltrad.eu>
Tue, 3 Jan 2012 08:18:34 +0000 (09:18 +0100)
committerAnders Henja <anders@baltrad.eu>
Tue, 3 Jan 2012 08:18:34 +0000 (09:18 +0100)
configure
configure.in
def.mk.in
lib/beamblockagemap.c
lib/config.h.in
test/pytest/PyBeamBlockageMapTest.py
test/pytest/PyBeamBlockageTest.py

index 019aee9..87b5535 100755 (executable)
--- a/configure
+++ b/configure
@@ -563,6 +563,7 @@ PACKAGE_URL=''
 
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
+BEAMB_GTOPO30_DIR
 BEAMB_CACHE_DIR
 LD_PRINTOUT
 HLHDFLDSHARED
@@ -2743,6 +2744,8 @@ if [ "$HLHDF_SZLIB_LIB" != "" ]; then
 fi
 
 BEAMB_CACHE_DIR=`echo $localstatedir`/cache/beamb
+BEAMB_GTOPO30_DIR=`echo $prefix`/share/beamb/data/gtopo30
+
 
 
 
index d30653a..02bc693 100644 (file)
@@ -181,6 +181,7 @@ if [[ "$HLHDF_SZLIB_LIB" != "" ]]; then
 fi
 
 BEAMB_CACHE_DIR=`echo $localstatedir`/cache/beamb
+BEAMB_GTOPO30_DIR=`echo $prefix`/share/beamb/data/gtopo30
 
 AC_SUBST(RAVE_ROOT_DIR)
 AC_SUBST(RAVE_INCLUDE_FLAG)
@@ -201,6 +202,7 @@ AC_SUBST(HLHDF_LIBRARY_FLAG)
 AC_SUBST(HLHDFLDSHARED)
 AC_SUBST(LD_PRINTOUT)
 AC_SUBST(BEAMB_CACHE_DIR)
+AC_SUBST(BEAMB_GTOPO30_DIR)
 
 AC_CONFIG_FILES(def.mk lib/config.h)
 AC_OUTPUT
\ No newline at end of file
index c0f2b6c..8bddf8e 100644 (file)
--- a/def.mk.in
+++ b/def.mk.in
@@ -42,6 +42,11 @@ HLHDF_INCLUDE_FLAG= @HLHDF_INCLUDE_FLAG@
 #
 BEAMB_CACHE_DIR= @BEAMB_CACHE_DIR@
 
+#
+# GTOPO30 files are stored here
+#
+BEAMB_GTOPO30_DIR= @BEAMB_GTOPO30_DIR@
+
 # Special flag to be used for printouts of the necessary LD_LIBRARY_PATH
 #
 LD_PRINTOUT=        @LD_PRINTOUT@
index 91c4809..a147019 100644 (file)
@@ -31,6 +31,7 @@ along with beamb.  If not, see <http://www.gnu.org/licenses/>.
 #include "polarnav.h"
 #include <stdio.h>
 #include <arpa/inet.h>
+#include "config.h"
 
 /**
  * Represents the beam blockage algorithm
@@ -61,13 +62,14 @@ static int BeamBlockageMap_constructor(RaveCoreObject* obj)
   self->topodir = NULL;
   self->navigator = RAVE_OBJECT_NEW(&PolarNavigator_TYPE);
 
-  if (self->navigator == NULL) {
+  if (self->navigator == NULL || !BeamBlockageMap_setTopo30Directory(self, BEAMB_GTOPO30_DIR)) {
     goto error;
   }
 
   return 1;
 error:
   RAVE_OBJECT_RELEASE(self->navigator);
+  RAVE_FREE(self->topodir);
   return 0;
 }
 
index 2a64bca..12406df 100644 (file)
@@ -17,10 +17,19 @@ You should have received a copy of the GNU Lesser General Public License
 along with beamb.  If not, see <http://www.gnu.org/licenses/>.
 ------------------------------------------------------------------------*/
 /**
- * Basic configuration file containing path information
+ * Basic configuration file containing path information. Created by configure.
+ *
  * @file
  * @author Anders Henja (SMHI)
  * @date 2011-12-21
  */
+
+/**
+ * The cache directory where the quality fields are stored
+ */
 #define BEAMB_CACHE_DIR "@BEAMB_CACHE_DIR@"
+
+/**
+ * Location where the gtopo30 files are stored.
+ */
+#define BEAMB_GTOPO30_DIR "@BEAMB_GTOPO30_DIR@"
index 99bbd6c..320fbb4 100644 (file)
@@ -47,7 +47,8 @@ class PyBeamBlockageMapTest(unittest.TestCase):
 
   def testTopo30(self):
     a = _beamblockagemap.new()
-    self.assertEquals(None, a.topo30dir)
+    self.assertTrue(None != a.topo30dir)
+    self.assertTrue(os.path.exists("%s/E020N90.DEM" % a.topo30dir))
     a.topo30dir="/tmp"
     self.assertEquals("/tmp", a.topo30dir)
   
index 33209e5..c1d0a4d 100644 (file)
@@ -61,7 +61,8 @@ class PyBeamBlockageTest(unittest.TestCase):
 
   def testTopo30(self):
     a = _beamblockage.new()
-    self.assertEquals(None, a.topo30dir)
+    self.assertTrue(None != a.topo30dir)
+    self.assertTrue(os.path.exists("%s/E020N90.DEM" % a.topo30dir))
     a.topo30dir="/tmp"
     self.assertEquals("/tmp", a.topo30dir)