Browse Source

Fixed wrong variable types in cache.c, updated name scheme in the raster3d test framework.

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58025 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 11 years ago
parent
commit
b8684ea059

+ 5 - 3
lib/raster3d/cache.c

@@ -56,8 +56,10 @@ static int initCacheRead(RASTER3D_Map * map, int nCached)
 static int cacheWrite_readFun(int tileIndex, void *tileBuf, void *closure)
 {
     RASTER3D_Map *map = closure;
-    size_t index, nBytes;
-    size_t pos, offs, offsLast;
+    int index;
+    size_t nBytes;
+    size_t offs, offsLast;
+    long int pos;
 
     pos = map->index[tileIndex];
 
@@ -121,7 +123,7 @@ static int cacheWrite_readFun(int tileIndex, void *tileBuf, void *closure)
 	return 0;
     }
 
-    index = *((int *)((unsigned char *)xdr + nBytes));
+    index = *((int*)((unsigned char *)xdr + nBytes));
     map->index[index] = -pos - 2;
 
     map->cachePosLast--;

+ 1 - 1
lib/raster3d/test/Makefile

@@ -1,6 +1,6 @@
 MODULE_TOPDIR = ../../..
 
-PGM=test.g3d.lib
+PGM=test.raster3d.lib
 
 LIBES = $(GISLIB) $(RASTER3DLIB) $(RASTERLIB) 
 DEPENDENCIES = $(GISDEP) $(RASTER3DDEP) $(RASTERDEP)

lib/raster3d/test/test.g3d.lib.html → lib/raster3d/test/test.raster3d.lib.html


+ 5 - 5
lib/raster3d/test/test_coordinate_transform.c

@@ -1,6 +1,6 @@
 #include <stdlib.h>
 #include <string.h>
-#include "test_g3d_lib.h"
+#include "test_raster3d_lib.h"
 #include "grass/interpf.h"
 
 static int test_coordinate_transform(void);
@@ -14,15 +14,15 @@ int unit_test_coordinate_transform(void)
 {
     int sum = 0;
 
-    G_message(_("\n++ Running g3d coordinate transform unit tests ++"));
+    G_message(_("\n++ Running raster3d coordinate transform unit tests ++"));
 
     sum += test_coordinate_transform();
     sum += test_region();
 
     if (sum > 0)
-	G_warning(_("\n-- g3d coordinate transform unit tests failure --"));
+	G_warning(_("\n-- raster3d coordinate transform unit tests failure --"));
     else
-	G_message(_("\n-- g3d coordinate transform unit tests finished successfully --"));
+	G_message(_("\n-- raster3d coordinate transform unit tests finished successfully --"));
 
     return sum;
 }
@@ -39,7 +39,7 @@ int test_coordinate_transform(void)
     RASTER3D_Region region, default_region;
     RASTER3D_Map *map = NULL;
     
-    /* We need to set up a specific region for the new g3d map.
+    /* We need to set up a specific region for the new raster3d map.
      * First we safe the default region. */
     Rast3d_get_window(&default_region);
     Rast3d_region_copy(&region, &default_region);

+ 5 - 5
lib/raster3d/test/test_main.c

@@ -1,7 +1,7 @@
 
 /*****************************************************************************
 *
-* MODULE:       Grass g3d Library
+* MODULE:       Grass raster3d Library
 * AUTHOR(S):    Soeren Gebbert, Braunschweig (GER) Jun 2011
 * 		        soerengebbert <at> googlemail <dot> com
 *               
@@ -17,7 +17,7 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include "test_g3d_lib.h"
+#include "test_raster3d_lib.h"
 
 /*- Parameters and global variables -----------------------------------------*/
 typedef struct {
@@ -108,7 +108,7 @@ int main(int argc, char *argv[]) {
 
     module = G_define_module();
     module->description
-            = _("Performs unit and integration tests for the g3d library");
+            = _("Performs unit and integration tests for the raster3d library");
 
     /* Get parameters from user */
     set_params();
@@ -174,9 +174,9 @@ int main(int argc, char *argv[]) {
     }
     
     if (returnstat != 0)
-        G_warning("Errors detected while testing the g3d lib");
+        G_warning("Errors detected while testing the raster3d lib");
     else
-        G_message("\n-- g3d lib tests finished successfully --");
+        G_message("\n-- raster3d lib tests finished successfully --");
 
     return (returnstat);
 }

+ 8 - 8
lib/raster3d/test/test_put_get_value.c

@@ -1,7 +1,7 @@
 
 /*****************************************************************************
 *
-* MODULE:       Grass g3d Library
+* MODULE:       Grass raster3d Library
 * AUTHOR(S):    Soeren Gebbert, Braunschweig (GER) Jun 2011
 * 		        soerengebbert <at> googlemail <dot> com
 *               
@@ -16,7 +16,7 @@
 *****************************************************************************/
 #include <stdlib.h>
 #include <string.h>
-#include "test_g3d_lib.h"
+#include "test_raster3d_lib.h"
 #include "grass/interpf.h"
 
 static int test_put_get_value_dcell(void);
@@ -35,7 +35,7 @@ int unit_test_put_get_value()
 {
     int sum = 0;
 
-    G_message(_("\n++ Running g3d put/get value unit tests ++"));
+    G_message(_("\n++ Running raster3d put/get value unit tests ++"));
 
     //sum += test_put_get_value_dcell();
     //sum += test_put_get_value_fcell();
@@ -43,9 +43,9 @@ int unit_test_put_get_value()
 
 
     if (sum > 0)
-	G_warning(_("\n-- g3d put/get value unit tests failure --"));
+	G_warning(_("\n-- raster3d put/get value unit tests failure --"));
     else
-	G_message(_("\n-- g3d put/get value unit tests finished successfully --"));
+	G_message(_("\n-- raster3d put/get value unit tests finished successfully --"));
 
     return sum;
 }
@@ -67,7 +67,7 @@ int test_put_get_value_dcell(void)
     RASTER3D_Region region;
     RASTER3D_Map *map = NULL;
     
-    /* We need to set up a specific region for the new g3d map.
+    /* We need to set up a specific region for the new raster3d map.
      * First we safe the default region. */
     Rast3d_get_window(&region);
     
@@ -211,7 +211,7 @@ int test_put_get_value_fcell(void)
     RASTER3D_Region region;
     RASTER3D_Map *map = NULL;
     
-    /* We need to set up a specific region for the new g3d map.
+    /* We need to set up a specific region for the new raster3d map.
      * First we safe the default region. */
     Rast3d_get_window(&region);
     
@@ -337,7 +337,7 @@ int test_put_get_value_resampling(void)
     RASTER3D_Region window;
     RASTER3D_Map *map = NULL;
     
-    /* We need to set up a specific region for the new g3d map.
+    /* We need to set up a specific region for the new raster3d map.
      * First we safe the default region. */
     Rast3d_get_window(&region);
     

+ 9 - 9
lib/raster3d/test/test_put_get_value_large_file.c

@@ -1,7 +1,7 @@
 
 /*****************************************************************************
 *
-* MODULE:       Grass g3d Library
+* MODULE:       Grass raster3d Library
 * AUTHOR(S):    Soeren Gebbert, Braunschweig (GER) Jun 2011
 * 		        soerengebbert <at> googlemail <dot> com
 *               
@@ -16,7 +16,7 @@
 *****************************************************************************/
 #include <stdlib.h>
 #include <string.h>
-#include "test_g3d_lib.h"
+#include "test_raster3d_lib.h"
 #include "grass/interpf.h"
 
 #define EPSILON 0.000000001
@@ -34,7 +34,7 @@ int unit_test_put_get_value_large_file(int depths, int rows, int cols, int tile_
 {
     int sum = 0;
 
-    G_message(_("\n++ Running g3d put/get value large file unit tests ++"));
+    G_message(_("\n++ Running raster3d put/get value large file unit tests ++"));
 
     sum += test_large_file_random(depths, rows, cols, tile_size);
     sum += test_large_file_sparse_random(depths, rows, cols, tile_size);
@@ -45,9 +45,9 @@ int unit_test_put_get_value_large_file(int depths, int rows, int cols, int tile_
 
 
     if (sum > 0)
-	G_warning(_("\n-- g3d put/get value large file unit tests failure --"));
+	G_warning(_("\n-- raster3d put/get value large file unit tests failure --"));
     else
-	G_message(_("\n-- g3d put/get value large file unit tests finished successfully --"));
+	G_message(_("\n-- raster3d put/get value large file unit tests finished successfully --"));
 
     return sum;
 }
@@ -65,7 +65,7 @@ int test_large_file(int depths, int rows, int cols, int tile_size)
     RASTER3D_Region region;
     RASTER3D_Map *map = NULL;
     
-    /* We need to set up a specific region for the new g3d map.
+    /* We need to set up a specific region for the new raster3d map.
      * First we safe the default region. */
     Rast3d_get_window(&region);
     
@@ -150,7 +150,7 @@ int test_large_file_zeros(int depths, int rows, int cols, int tile_size)
     RASTER3D_Region region;
     RASTER3D_Map *map = NULL;
 
-    /* We need to set up a specific region for the new g3d map.
+    /* We need to set up a specific region for the new raster3d map.
      * First we safe the default region. */
     Rast3d_get_window(&region);
 
@@ -232,7 +232,7 @@ int test_large_file_random(int depths, int rows, int cols, int tile_size)
     RASTER3D_Region region;
     RASTER3D_Map *map = NULL;
 
-    /* We need to set up a specific region for the new g3d map.
+    /* We need to set up a specific region for the new raster3d map.
      * First we safe the default region. */
     Rast3d_get_window(&region);
 
@@ -332,7 +332,7 @@ int test_large_file_sparse_random(int depths, int rows, int cols, int tile_size)
     RASTER3D_Region region;
     RASTER3D_Map *map = NULL;
 
-    /* We need to set up a specific region for the new g3d map.
+    /* We need to set up a specific region for the new raster3d map.
      * First we safe the default region. */
     Rast3d_get_window(&region);
 

+ 1 - 1
lib/raster3d/test/test_g3d_lib.h

@@ -1,7 +1,7 @@
 
 /*****************************************************************************
 *
-* MODULE:       Grass g3d Library
+* MODULE:       Grass raster3d Library
 * AUTHOR(S):    Soeren Gebbert, Braunschweig (GER) Jun 2011
 *               soerengebbert <at> googlemail <dot> com
 *               

+ 2 - 2
lib/raster3d/test/test_tools.c

@@ -1,7 +1,7 @@
 
 /*****************************************************************************
 *
-* MODULE:       Grass g3d Library
+* MODULE:       Grass raster3d Library
 * AUTHOR(S):    Soeren Gebbert, Braunschweig (GER) Jun 2011
 * 	            soerengebbert <at> googlemail <dot> com
 *               
@@ -19,7 +19,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
-#include "test_g3d_lib.h"
+#include "test_raster3d_lib.h"
 #include <sys/time.h>
 
 /* *************************************************************** */