Explorar el Código

temporal modules: Improved tests, using g.mremove instead of g.remove to avoid buffer overflows when g.remove is called from within the gtestsuite framework.

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@62000 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert hace 10 años
padre
commit
875d2c3d7e
Se han modificado 23 ficheros con 292 adiciones y 266 borrados
  1. 3 1
      temporal/t.connect/testsuite/test_distr_tgis_db_raster.py
  2. 3 1
      temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py
  3. 3 1
      temporal/t.connect/testsuite/test_distr_tgis_db_vector.py
  4. 1 1
      temporal/t.rast.accdetect/t.rast.accdetect.py
  5. 1 1
      temporal/t.rast.accdetect/testsuite/test.t.rast.accdetect.reverse.sh
  6. 1 1
      temporal/t.rast.accdetect/testsuite/test.t.rast.accdetect.sh
  7. 1 1
      temporal/t.rast.accumulate/t.rast.accumulate.py
  8. 0 0
      temporal/t.rast.accumulate/testsuite/data/acc_1.ref
  9. 0 0
      temporal/t.rast.accumulate/testsuite/data/acc_2.ref
  10. 0 0
      temporal/t.rast.accumulate/testsuite/data/acc_3.ref
  11. 0 0
      temporal/t.rast.accumulate/testsuite/data/acc_4.ref
  12. 0 0
      temporal/t.rast.accumulate/testsuite/data/acc_5.ref
  13. 7 5
      temporal/t.rast.accumulate/test_suite/test.t.rast.accumulate.sh
  14. 2 2
      temporal/t.rast.aggregate.ds/testsuite/test.t.rast.aggregate.ds.sh
  15. 1 2
      temporal/t.rast.aggregate/testsuite/test.t.rast.aggregate.sh
  16. 11 11
      temporal/t.rast.extract/testsuite/test_extract.py
  17. 187 187
      temporal/t.rast.to.rast3/testsuite/test_strds_to_rast3.py
  18. 7 7
      temporal/t.rast3d.list/t.rast3d.list.py
  19. 13 13
      temporal/t.remove/t.remove.py
  20. 46 27
      temporal/t.vect.mapcalc/testsuite/test.t.vect.mapcalc.sh
  21. 1 1
      temporal/t.vect.observe.strds/testsuite/test.t.vect.observe.strds.layer_bug.sh
  22. 2 2
      temporal/t.vect.observe.strds/testsuite/test.t.vect.observe.strds.relative.sh
  23. 2 2
      temporal/t.vect.observe.strds/testsuite/test.t.vect.observe.strds.sh

+ 3 - 1
temporal/t.connect/testsuite/test_distr_tgis_db_raster.py

@@ -45,7 +45,9 @@ class TestRasterExtraction(TestCase):
                                 
         entries = list_string.split("\n")
         
-        t_list = SimpleModule("t.list", quiet=True, columns=["name","mapset,start_time","end_time","number_of_maps"],  type="strds")
+        t_list = SimpleModule("t.list", quiet=True, 
+                                            columns=["name","mapset,start_time","end_time","number_of_maps"],  
+                                            type="strds",  where='name = "A"')
         self.assertModule(t_list)
         
         out = t_list.outputs["stdout"].value

+ 3 - 1
temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py

@@ -42,7 +42,9 @@ class testRaster3dExtraction(TestCase):
                                 
         entries = list_string.split("\n")
         
-        t_list = SimpleModule("t.list", quiet=True, columns=["name","mapset,start_time","end_time","number_of_maps"],  type="str3ds")
+        t_list = SimpleModule("t.list", quiet=True, 
+                                            columns=["name","mapset,start_time","end_time","number_of_maps"],  
+                                            type="str3ds",  where='name = "A"')
         self.assertModule(t_list)
         
         out = t_list.outputs["stdout"].value

+ 3 - 1
temporal/t.connect/testsuite/test_distr_tgis_db_vector.py

@@ -44,7 +44,9 @@ class TestRasterExtraction(TestCase):
                                 
         entries = list_string.split("\n")
         
-        t_list = SimpleModule("t.list", quiet=True, columns=["name","mapset,start_time","end_time","number_of_maps"],  type="stvds")
+        t_list = SimpleModule("t.list", quiet=True, 
+                                           columns=["name","mapset,start_time","end_time","number_of_maps"],  
+                                           type="stvds",  where='name = "A"')
         self.assertModule(t_list)
         
         out = t_list.outputs["stdout"].value

+ 1 - 1
temporal/t.rast.accdetect/t.rast.accdetect.py

@@ -418,7 +418,7 @@ def main():
     # Remove empty maps
     if len(empty_maps) > 0:
         for map in empty_maps:
-            grass.run_command("g.remove", rast=map.get_name(), quiet=True)
+            grass.run_command("g.mremove", type="rast",  pattern=map.get_name(), quiet=True)
 
 ############################################################################
 

+ 1 - 1
temporal/t.rast.accdetect/testsuite/test.t.rast.accdetect.reverse.sh

@@ -31,7 +31,7 @@ t.rast.list temp_accumulation col=name,start_time,min,max > data/test_2_temp_acc
 t.rast.list temp_occ col=name,start_time,min,max  > data/test_2_temp_occ.txt
 t.rast.list temp_indi col=name,start_time,min,max > data/test_2_temp_indi.txt
 
-t.remove -rf type=strds input=temp_abs1,temp_accumulation,temp_indi
+#t.remove -rf type=strds input=temp_abs1,temp_accumulation,temp_indi
 
 cd data
 

+ 1 - 1
temporal/t.rast.accdetect/testsuite/test.t.rast.accdetect.sh

@@ -51,7 +51,7 @@ t.rast.accdetect input=temp_accumulation occurrence=temp_occ base=temp_occ \
 t.rast.list temp_occ col=name,start_time,min,max          > data/test_1_temp_occ_b.txt
 t.rast.list temp_indi col=name,start_time,min,max         > data/test_1_temp_indi.txt
 
-t.remove -rf type=strds input=temp_abs1,temp_accumulation,temp_indi,minimum,maximum
+#t.remove -rf type=strds input=temp_abs1,temp_accumulation,temp_indi,minimum,maximum
 
 cd data
 

+ 1 - 1
temporal/t.rast.accumulate/t.rast.accumulate.py

@@ -500,7 +500,7 @@ def main():
     # Remove empty maps
     if len(empty_maps) > 0:
         for map in empty_maps:
-            grass.run_command("g.remove", rast=map.get_name(), quiet=True)
+            grass.run_command("g.mremove", type="rast",  pattern=map.get_name(), quiet=True)
 
 if __name__ == "__main__":
     options, flags = grass.parser()

temporal/t.rast.accumulate/test_suite/acc_1.ref → temporal/t.rast.accumulate/testsuite/data/acc_1.ref


temporal/t.rast.accumulate/test_suite/acc_2.ref → temporal/t.rast.accumulate/testsuite/data/acc_2.ref


temporal/t.rast.accumulate/test_suite/acc_3.ref → temporal/t.rast.accumulate/testsuite/data/acc_3.ref


temporal/t.rast.accumulate/test_suite/acc_4.ref → temporal/t.rast.accumulate/testsuite/data/acc_4.ref


temporal/t.rast.accumulate/test_suite/acc_5.ref → temporal/t.rast.accumulate/testsuite/data/acc_5.ref


+ 7 - 5
temporal/t.rast.accumulate/test_suite/test.t.rast.accumulate.sh

@@ -27,25 +27,25 @@ t.rast.accumulate input=precip_abs1 output=precip_abs2 base=prec_acc \
 
 # We need to filter the identifier that may be different on different systems
 # like creation time and mapset 
-t.info input=precip_abs2 | grep -v \# | grep -v Creation | grep -v register | grep -v Id | grep -v Mapset > acc_1.txt
+t.info input=precip_abs2 | grep -v \# | grep -v Creation | grep -v register | grep -v Id | grep -v Mapset > data/acc_1.txt
 
 t.rast.accumulate input=precip_abs1 output=precip_abs2 base=prec_acc \
     limits=10,30 start="2001-01-01" stop="2002-01-01" gran="4 months" \
     cycle="7 months"
 
-t.info input=precip_abs2 | grep -v \# | grep -v Creation | grep -v register | grep -v Id | grep -v Mapset > acc_2.txt
+t.info input=precip_abs2 | grep -v \# | grep -v Creation | grep -v register | grep -v Id | grep -v Mapset > data/acc_2.txt
 
 t.rast.accumulate input=precip_abs1 output=precip_abs2 base=prec_acc \
     limits=10,30 start="2001-01-01" gran="2 months" \
     cycle="12 months"
 
-t.info input=precip_abs2 | grep -v \# | grep -v Creation | grep -v register | grep -v Id | grep -v Mapset > acc_3.txt
+t.info input=precip_abs2 | grep -v \# | grep -v Creation | grep -v register | grep -v Id | grep -v Mapset > data/acc_3.txt
 
 t.rast.accumulate input=precip_abs1 output=precip_abs2 base=prec_acc \
     limits=10,30 start="2001-01-01" stop="2002-01-01" gran="1 months" \
     cycle="12 months"
 
-t.info input=precip_abs2 | grep -v \# | grep -v Creation | grep -v register | grep -v Id | grep -v Mapset > acc_4.txt
+t.info input=precip_abs2 | grep -v \# | grep -v Creation | grep -v register | grep -v Id | grep -v Mapset > data/acc_4.txt
 
 # Second test
 
@@ -62,10 +62,12 @@ t.rast.accumulate input=precip_abs1 output=precip_abs2 base=prec_acc \
     limits=8,33 lower=lower upper=upper start="2001-01-01" stop="2002-01-01" gran="1 months" \
     cycle="12 months"
 
-t.info input=precip_abs2 | grep -v \# | grep -v Creation | grep -v register | grep -v Id | grep -v Mapset > acc_5.txt
+t.info input=precip_abs2 | grep -v \# | grep -v Creation | grep -v register | grep -v Id | grep -v Mapset > data/acc_5.txt
 
 t.remove -rf type=strds input=precip_abs1,precip_abs2,lower,upper
 
+cd data
+
 for i in `ls acc_*.txt` ; do
     diff $i "`basename $i .txt`.ref" >> out.diff
 done

+ 2 - 2
temporal/t.rast.aggregate.ds/testsuite/test.t.rast.aggregate.ds.sh

@@ -48,5 +48,5 @@ t.info type=strds input=precip_abs2
 t.rast.list input=precip_abs2 method=deltagap
 
 # @postprocess
-t.remove -rf type=stvds input=soil_abs1
-t.remove -rf type=strds input=precip_abs1,precip_abs2
+#t.remove -rf type=stvds input=soil_abs1
+#t.remove -rf type=strds input=precip_abs1,precip_abs2

+ 1 - 2
temporal/t.rast.aggregate/testsuite/test.t.rast.aggregate.sh

@@ -48,5 +48,4 @@ t.rast.aggregate --v input=precip_abs1 output=precip_abs4 offset=100 \
 t.info type=strds input=precip_abs4
 t.rast.list input=precip_abs4
 
-#t.remove -rf type=strds input=precip_abs1,precip_abs2,precip_abs3,precip_abs4
-t.remove -rf type=strds input=precip_abs1,precip_abs2
+t.remove -rf type=strds input=precip_abs1,precip_abs2,precip_abs3,precip_abs4

+ 11 - 11
temporal/t.rast.extract/testsuite/test_extract.py

@@ -33,18 +33,18 @@ class TestRasterExtraction(TestCase):
         """Create input data for transient groundwater flow computation
         """
         # Use always the current mapset as temporal database
-        self.runModule("r.mapcalc", expression="prec_1 = 100")
-        self.runModule("r.mapcalc", expression="prec_2 = 200")
-        self.runModule("r.mapcalc", expression="prec_3 = 300")
-        self.runModule("r.mapcalc", expression="prec_4 = 400")
-        self.runModule("r.mapcalc", expression="prec_5 = 500")
-        self.runModule("r.mapcalc", expression="prec_6 = 600")
-        
+        self.runModule("r.mapcalc", expression="prec_1 = 100",  overwrite=True)
+        self.runModule("r.mapcalc", expression="prec_2 = 200",  overwrite=True)
+        self.runModule("r.mapcalc", expression="prec_3 = 300",  overwrite=True)
+        self.runModule("r.mapcalc", expression="prec_4 = 400",  overwrite=True)
+        self.runModule("r.mapcalc", expression="prec_5 = 500",  overwrite=True)
+        self.runModule("r.mapcalc", expression="prec_6 = 600",  overwrite=True)
+
         self.runModule("t.create",  type="strds",  temporaltype="absolute",  
-                                     output="precip_abs1",  title="A test",  description="A test")
+                                     output="precip_abs1",  title="A test",  description="A test",  overwrite=True)
         self.runModule("t.register",  flags="i",  type="rast",  input="precip_abs1",  
                                      maps="prec_1,prec_2,prec_3,prec_4,prec_5,prec_6",  
-                                     start="2001-01-01", increment="3 months")
+                                     start="2001-01-01", increment="3 months",  overwrite=True)
 
     def tearDown(self):
         """Remove generated data"""
@@ -87,7 +87,7 @@ class TestRasterExtraction(TestCase):
         self.assertModule("t.rast.extract",  input="precip_abs1",  output="precip_abs2", 
                                       where="start_time > '2001-06-01'",  
                                       expression=" if(precip_abs1 > 400, precip_abs1, null())", 
-                                      basename="new_prec",  nprocs=2)
+                                      basename="new_prec",  nprocs=2,  overwrite=True)
 
         #self.assertModule("t.info",  flags="g",  input="precip_abs2")
 
@@ -119,7 +119,7 @@ class TestRasterExtraction(TestCase):
         """Perform r.mapcalc expression and register empty maps"""
         self.assertModule("t.rast.extract",  flags="n",  input="precip_abs1",  output="precip_abs2",
                                       expression=" if(precip_abs1 > 400, precip_abs1, null())", 
-                                      basename="new_prec",  nprocs=2)
+                                      basename="new_prec",  nprocs=2,  overwrite=True)
 
         #self.assertModule("t.info",  flags="g",  input="precip_abs2")
 

+ 187 - 187
temporal/t.rast.to.rast3/testsuite/test_strds_to_rast3.py

@@ -79,76 +79,76 @@ class TestSTRDSToRast3(TestCase):
         self.assertModule("t.rast.to.rast3",  input="precip_d",  output="precip_d")
 
         univar_string="""n=576
-						null_cells=0
-						cells=576
-						min=100
-						max=600
-						range=500
-						mean=350
-						mean_of_abs=350
-						stddev=170.782512765993
-						variance=29166.6666666667
-						coeff_var=48.7950036474267
-						sum=201600"""
+                        null_cells=0
+                        cells=576
+                        min=100
+                        max=600
+                        range=500
+                        mean=350
+                        mean_of_abs=350
+                        stddev=170.782512765993
+                        variance=29166.6666666667
+                        coeff_var=48.7950036474267
+                        sum=201600"""
 
         self.assertRaster3dFitsUnivar(raster="precip_i", reference=univar_string, precision=2)
         self.assertRaster3dFitsUnivar(raster="precip_f", reference=univar_string, precision=2)
         self.assertRaster3dFitsUnivar(raster="precip_d", reference=univar_string, precision=2)
 
         tinfo_string="""north=80
-						south=0
-						east=120
-						west=0
-						bottom=1213
-						top=1231
-						nsres=10
-						ewres=10
-						tbres=3
-						rows=8
-						cols=12
-						depths=6
-						datatype="DCELL"
-						timestamp="1 Jan 2001 00:00:00 / 1 Jul 2002 00:00:00"
-						units="none"
-						vertical_units="months" """
+                        south=0
+                        east=120
+                        west=0
+                        bottom=1213
+                        top=1231
+                        nsres=10
+                        ewres=10
+                        tbres=3
+                        rows=8
+                        cols=12
+                        depths=6
+                        datatype="DCELL"
+                        timestamp="1 Jan 2001 00:00:00 / 1 Jul 2002 00:00:00"
+                        units="none"
+                        vertical_units="months" """
 
         self.assertRaster3dFitsInfo(raster="precip_i", reference=tinfo_string, precision=2)
 
         tinfo_string="""north=80
-						south=0
-						east=120
-						west=0
-						bottom=1213
-						top=1231
-						nsres=10
-						ewres=10
-						tbres=3
-						rows=8
-						cols=12
-						depths=6
-						datatype="FCELL"
-						timestamp="1 Jan 2001 00:00:00 / 1 Jul 2002 00:00:00"
-						units="none"
-						vertical_units="months" """
+                        south=0
+                        east=120
+                        west=0
+                        bottom=1213
+                        top=1231
+                        nsres=10
+                        ewres=10
+                        tbres=3
+                        rows=8
+                        cols=12
+                        depths=6
+                        datatype="FCELL"
+                        timestamp="1 Jan 2001 00:00:00 / 1 Jul 2002 00:00:00"
+                        units="none"
+                        vertical_units="months" """
 
         self.assertRaster3dFitsInfo(raster="precip_f", reference=tinfo_string, precision=2)
 
         tinfo_string="""north=80
-						south=0
-						east=120
-						west=0
-						bottom=1213
-						top=1231
-						nsres=10
-						ewres=10
-						tbres=3
-						rows=8
-						cols=12
-						depths=6
-						datatype="DCELL"
-						timestamp="1 Jan 2001 00:00:00 / 1 Jul 2002 00:00:00"
-						units="none"
-						vertical_units="months" """
+                        south=0
+                        east=120
+                        west=0
+                        bottom=1213
+                        top=1231
+                        nsres=10
+                        ewres=10
+                        tbres=3
+                        rows=8
+                        cols=12
+                        depths=6
+                        datatype="DCELL"
+                        timestamp="1 Jan 2001 00:00:00 / 1 Jul 2002 00:00:00"
+                        units="none"
+                        vertical_units="months" """
 
         self.assertRaster3dFitsInfo(raster="precip_d", reference=tinfo_string, precision=2)
 
@@ -162,75 +162,75 @@ class TestSTRDSToRast3(TestCase):
         self.assertModule("t.rast.to.rast3",  input="precip_d",  output="precip_d")
 
         univar_string="""n=480
-						null_cells=96
-						cells=576
-						min=100
-						max=600
-						range=500
-						mean=360
-						mean_of_abs=360
-						stddev=185.472369909914
-						variance=34400
-						coeff_var=51.5201027527539
-						sum=172800"""
+                        null_cells=96
+                        cells=576
+                        min=100
+                        max=600
+                        range=500
+                        mean=360
+                        mean_of_abs=360
+                        stddev=185.472369909914
+                        variance=34400
+                        coeff_var=51.5201027527539
+                        sum=172800"""
 
         univar = SimpleModule("r3.univar", flags="g", map="precip_i")
         self.assertModuleKeyValue(module=univar, reference=univar_string, precision=2, sep="=")
 
         tinfo_string="""north=80
-						south=0
-						east=120
-						west=0
-						bottom=1213
-						top=1231
-						nsres=10
-						ewres=10
-						tbres=3
-						rows=8
-						cols=12
-						depths=6
-						datatype="DCELL"
-						timestamp="1 Jan 2001 00:00:00 / 1 Jul 2002 00:00:00"
-						units="none"
-						vertical_units="months" """
+                        south=0
+                        east=120
+                        west=0
+                        bottom=1213
+                        top=1231
+                        nsres=10
+                        ewres=10
+                        tbres=3
+                        rows=8
+                        cols=12
+                        depths=6
+                        datatype="DCELL"
+                        timestamp="1 Jan 2001 00:00:00 / 1 Jul 2002 00:00:00"
+                        units="none"
+                        vertical_units="months" """
 
         self.assertRaster3dFitsInfo(raster="precip_i", reference=tinfo_string, precision=2)
 
         tinfo_string="""north=80
-						south=0
-						east=120
-						west=0
-						bottom=1213
-						top=1231
-						nsres=10
-						ewres=10
-						tbres=3
-						rows=8
-						cols=12
-						depths=6
-						datatype="FCELL"
-						timestamp="1 Jan 2001 00:00:00 / 1 Jul 2002 00:00:00"
-						units="none"
-						vertical_units="months" """
+                        south=0
+                        east=120
+                        west=0
+                        bottom=1213
+                        top=1231
+                        nsres=10
+                        ewres=10
+                        tbres=3
+                        rows=8
+                        cols=12
+                        depths=6
+                        datatype="FCELL"
+                        timestamp="1 Jan 2001 00:00:00 / 1 Jul 2002 00:00:00"
+                        units="none"
+                        vertical_units="months" """
 
         self.assertRaster3dFitsInfo(raster="precip_f", reference=tinfo_string, precision=2)
 
         tinfo_string="""north=80
-						south=0
-						east=120
-						west=0
-						bottom=1213
-						top=1231
-						nsres=10
-						ewres=10
-						tbres=3
-						rows=8
-						cols=12
-						depths=6
-						datatype="DCELL"
-						timestamp="1 Jan 2001 00:00:00 / 1 Jul 2002 00:00:00"
-						units="none"
-						vertical_units="months" """
+                        south=0
+                        east=120
+                        west=0
+                        bottom=1213
+                        top=1231
+                        nsres=10
+                        ewres=10
+                        tbres=3
+                        rows=8
+                        cols=12
+                        depths=6
+                        datatype="DCELL"
+                        timestamp="1 Jan 2001 00:00:00 / 1 Jul 2002 00:00:00"
+                        units="none"
+                        vertical_units="months" """
 
         self.assertRaster3dFitsInfo(raster="precip_d", reference=tinfo_string, precision=2)
 
@@ -270,21 +270,21 @@ class TestSTRDSToRast3MultiGran(TestCase):
         self.assertModule("t.rast.to.rast3",  input="precip_d",  output="precip_d")
 
         tinfo_string="""north=80
-						south=0
-						east=120
-						west=0
-						bottom=100
-						top=130
-						nsres=10
-						ewres=10
-						tbres=3
-						rows=8
-						cols=12
-						depths=6
-						datatype="DCELL"
-						timestamp="1 Jan 2000 00:00:00 / 1 Jan 2030 00:00:00"
-						units="none"
-						vertical_units="years" """
+                        south=0
+                        east=120
+                        west=0
+                        bottom=100
+                        top=130
+                        nsres=10
+                        ewres=10
+                        tbres=3
+                        rows=8
+                        cols=12
+                        depths=6
+                        datatype="DCELL"
+                        timestamp="1 Jan 2000 00:00:00 / 1 Jan 2030 00:00:00"
+                        units="none"
+                        vertical_units="years" """
 
         self.assertRaster3dFitsInfo(raster="precip_d", reference=tinfo_string, precision=2)
 
@@ -298,21 +298,21 @@ class TestSTRDSToRast3MultiGran(TestCase):
         self.assertModule("t.rast.to.rast3",  input="precip_d",  output="precip_d")
 
         tinfo_string="""north=80
-						south=0
-						east=120
-						west=0
-						bottom=1201
-						top=1237
-						nsres=10
-						ewres=10
-						tbres=6
-						rows=8
-						cols=12
-						depths=6
-						datatype="DCELL"
-						timestamp="1 Jan 2000 00:00:00 / 1 Jan 2003 00:00:00"
-						units="none"
-						vertical_units="months" """
+                        south=0
+                        east=120
+                        west=0
+                        bottom=1201
+                        top=1237
+                        nsres=10
+                        ewres=10
+                        tbres=6
+                        rows=8
+                        cols=12
+                        depths=6
+                        datatype="DCELL"
+                        timestamp="1 Jan 2000 00:00:00 / 1 Jan 2003 00:00:00"
+                        units="none"
+                        vertical_units="months" """
 
         self.assertRaster3dFitsInfo(raster="precip_d", reference=tinfo_string, precision=2)
 
@@ -327,21 +327,21 @@ class TestSTRDSToRast3MultiGran(TestCase):
         self.runModule("r3.info", map="precip_d")
 
         tinfo_string="""north=80
-						south=0
-						east=120
-						west=0
-						bottom=36524
-						top=36566
-						nsres=10
-						ewres=10
-						tbres=7
-						rows=8
-						cols=12
-						depths=6
-						datatype="DCELL"
-						timestamp="1 Jan 2000 00:00:00 / 12 Feb 2000 00:00:00"
-						units="none"
-						vertical_units="days" """
+                        south=0
+                        east=120
+                        west=0
+                        bottom=36524
+                        top=36566
+                        nsres=10
+                        ewres=10
+                        tbres=7
+                        rows=8
+                        cols=12
+                        depths=6
+                        datatype="DCELL"
+                        timestamp="1 Jan 2000 00:00:00 / 12 Feb 2000 00:00:00"
+                        units="none"
+                        vertical_units="days" """
 
         self.assertRaster3dFitsInfo(raster="precip_d", reference=tinfo_string, precision=2)
 
@@ -356,21 +356,21 @@ class TestSTRDSToRast3MultiGran(TestCase):
         self.runModule("r3.info", map="precip_d")
 
         tinfo_string="""north=80
-						south=0
-						east=120
-						west=0
-						bottom=36524
-						top=36524.8
-						nsres=10
-						ewres=10
-						tbres=0.125
-						rows=8
-						cols=12
-						depths=6
-						datatype="DCELL"
-						timestamp="1 Jan 2000 00:00:00 / 1 Jan 2000 18:00:00"
-						units="none"
-						vertical_units="hours" """
+                        south=0
+                        east=120
+                        west=0
+                        bottom=36524
+                        top=36524.8
+                        nsres=10
+                        ewres=10
+                        tbres=0.125
+                        rows=8
+                        cols=12
+                        depths=6
+                        datatype="DCELL"
+                        timestamp="1 Jan 2000 00:00:00 / 1 Jan 2000 18:00:00"
+                        units="none"
+                        vertical_units="hours" """
 
         self.assertRaster3dFitsInfo(raster="precip_d", reference=tinfo_string, precision=2)
 
@@ -385,21 +385,21 @@ class TestSTRDSToRast3MultiGran(TestCase):
         self.runModule("r3.info", map="precip_d")
 
         tinfo_string="""north=80
-						south=0
-						east=120
-						west=0
-						bottom=36524
-						top=36524.1
-						nsres=10
-						ewres=10
-						tbres=0.0118056
-						rows=8
-						cols=12
-						depths=6
-						datatype="DCELL"
-						timestamp="1 Jan 2000 00:00:00 / 1 Jan 2000 01:42:00"
-						units="none"
-						vertical_units="minutes" """
+                        south=0
+                        east=120
+                        west=0
+                        bottom=36524
+                        top=36524.1
+                        nsres=10
+                        ewres=10
+                        tbres=0.0118056
+                        rows=8
+                        cols=12
+                        depths=6
+                        datatype="DCELL"
+                        timestamp="1 Jan 2000 00:00:00 / 1 Jan 2000 01:42:00"
+                        units="none"
+                        vertical_units="minutes" """
 
         self.assertRaster3dFitsInfo(raster="precip_d", reference=tinfo_string, precision=2)
 

+ 7 - 7
temporal/t.rast3d.list/t.rast3d.list.py

@@ -2,15 +2,15 @@
 # -*- coding: utf-8 -*-
 ############################################################################
 #
-# MODULE:	t.rast3d.list
-# AUTHOR(S):	Soeren Gebbert
+# MODULE:   t.rast3d.list
+# AUTHOR(S):    Soeren Gebbert
 #
-# PURPOSE:	List registered maps of a space time raster3d dataset
-# COPYRIGHT:	(C) 2011-2014, Soeren Gebbert and the GRASS Development Team
+# PURPOSE:  List registered maps of a space time raster3d dataset
+# COPYRIGHT:    (C) 2011-2014, Soeren Gebbert and the GRASS Development Team
 #
-#		This program is free software under the GNU General Public
-#		License (version 2). Read the file COPYING that comes with GRASS
-#		for details.
+#       This program is free software under the GNU General Public
+#       License (version 2). Read the file COPYING that comes with GRASS
+#       for details.
 #
 #############################################################################
 

+ 13 - 13
temporal/t.remove/t.remove.py

@@ -2,15 +2,15 @@
 # -*- coding: utf-8 -*-
 ############################################################################
 #
-# MODULE:	t.remove
-# AUTHOR(S):	Soeren Gebbert
+# MODULE:   t.remove
+# AUTHOR(S):    Soeren Gebbert
 #
-# PURPOSE:	Remove space time datasets from the temporal database
-# COPYRIGHT:	(C) 2011 by the GRASS Development Team
+# PURPOSE:  Remove space time datasets from the temporal database
+# COPYRIGHT:    (C) 2011 by the GRASS Development Team
 #
-#		This program is free software under the GNU General Public
-#		License (version 2). Read the file COPYING that comes with GRASS
-#		for details.
+#       This program is free software under the GNU General Public
+#       License (version 2). Read the file COPYING that comes with GRASS
+#       for details.
 #
 #############################################################################
 
@@ -106,8 +106,8 @@ def main():
 
     statement = ""
 
-    # Create the pygrass Module object for g.remove
-    remove = pyg.Module("g.remove", quiet=True, run_=False)
+    # Create the pygrass Module object for g.mremove
+    remove = pyg.Module("g.mremove", quiet=True, run_=False)
 
     for name in dataset_list:
         name = name.strip()
@@ -132,7 +132,7 @@ def main():
                 # Delete every 100 maps
                 if count%100 == 0:
                     dbif.execute_transaction(map_statement)
-                    remove(rast=name_list, run_=True)
+                    remove(type="rast",  pattern=name_list, run_=True)
                     map_statement = ""
                     name_list = []
 
@@ -140,11 +140,11 @@ def main():
                 dbif.execute_transaction(map_statement)
             if name_list:
                 if type == "strds":
-                    remove(rast=",".join(name_list), run_=True)
+                    remove(type="rast",  pattern=",".join(name_list), run_=True)
                 if type == "stvds":
-                    remove(vect=",".join(name_list), run_=True)
+                    remove(type="vect",  pattern=",".join(name_list), run_=True)
                 if type == "str3ds":
-                    remove(rast3d=",".join(name_list), run_=True)
+                    remove(type="rast3d",  pattern=",".join(name_list), run_=True)
 
         statement += sp.delete(dbif=dbif, execute=False)
 

+ 46 - 27
temporal/t.vect.mapcalc/testsuite/test.t.vect.mapcalc.sh

@@ -5,33 +5,52 @@ g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 -p
 export GRASS_OVERWRITE=1
 
 # Test for temporal algebra in LatLon location.
-rm /tmp/vinput1_point_test.txt
-rm /tmp/vinput2_point_test.txt
-rm /tmp/vinput3_point_test.txt
-rm /tmp/vinput4_point_test.txt
-rm /tmp/vinput1_area_test.txt
-rm /tmp/vinput2_area_test.txt
-rm /tmp/vinput3_area_test.txt
-rm /tmp/vinput4_area_test.txt
+if test -f vinput1_point_test ; then
+    rm vinput1_point_test.txt
+fi
+if test -f vinput1_point_test ; then
+    rm vinput2_point_test.txt
+fi
+if test -f vinput1_point_test ; then
+    rm vinput3_point_test.txt
+fi
+if test -f vinput1_point_test ; then
+    rm vinput4_point_test.txt
+fi
+
+if test -f vinput1_point_test ; then
+    rm vinput1_area_test.txt
+fi
+if test -f vinput1_point_test ; then
+    rm vinput2_area_test.txt
+fi
+if test -f vinput1_point_test ; then
+    rm vinput3_area_test.txt
+fi
+if test -f vinput1_point_test ; then
+    rm vinput4_area_test.txt
+fi
+
+LIST="1 2 3 4 5 6 7 8 9 0 10 11 12 13 14 15 16 17 18 19 20"
 
 # Create random area test maps.
-for i in {1..60}
+for i in ${LIST}
   do
-    if [[ "$i" -le 20 ]]; then
-      echo vtestpoint1_$i >> /tmp/vinput1_point_test.txt
-      echo vtestarea1_$i  >> /tmp/vinput1_area_test.txt
+    if test "$i" -le 10 ; then
+      echo vtestpoint1_$i >> vinput1_point_test.txt
+      echo vtestarea1_$i  >> vinput1_area_test.txt
       v.random --o -z output=vtestpoint1_$i n=3 seed=$i+1
       v.voronoi --o input=vtestpoint1_$i output=vtestarea1_$i
-    elif [ "$i" -gt 20 ] && [ "$i" -le 40 ]; then
-      echo vtestpoint2_$i >> /tmp/vinput2_point_test.txt
-      echo vtestarea2_$i  >> /tmp/vinput2_area_test.txt
+    elif test "$i" -gt 10  && test "$i" -le 15 ; then
+      echo vtestpoint2_$i >> vinput2_point_test.txt
+      echo vtestarea2_$i  >> vinput2_area_test.txt
       v.random --o -z output=vtestpoint2_$i n=3 seed=$i+1
       v.voronoi --o input=vtestpoint2_$i output=vtestarea2_$i
     else
-      echo vtestpoint3_$i >> /tmp/vinput3_point_test.txt
-      echo vtestpoint4_$i >> /tmp/vinput4_point_test.txt
-      echo vtestarea3_$i  >> /tmp/vinput3_area_test.txt
-      echo vtestarea4_$i  >> /tmp/vinput4_area_test.txt
+      echo vtestpoint3_$i >> vinput3_point_test.txt
+      echo vtestpoint4_$i >> vinput4_point_test.txt
+      echo vtestarea3_$i  >> vinput3_area_test.txt
+      echo vtestarea4_$i  >> vinput4_area_test.txt
       v.random --o -z output=vtestpoint3_$i n=3 seed=$i+1
       v.voronoi --o input=vtestpoint3_$i output=vtestarea3_$i
       v.random --o -z output=vtestpoint4_$i n=3 seed=$i+1
@@ -49,14 +68,14 @@ t.create output=P2 type=stvds title="Point test dataset" descr="Point test datas
 t.create output=P3 type=stvds title="Point test dataset" descr="Point test dataset"
 t.create output=P4 type=stvds title="Point test dataset" descr="Point test dataset"
 
-t.register -i type=vect input=A1 file=/tmp/vinput1_area_test.txt increment="1 days" start="2013-01-01"
-t.register -i type=vect input=A2 file=/tmp/vinput2_area_test.txt increment="1 days" start="2013-01-10"
-t.register -i type=vect input=A3 file=/tmp/vinput3_area_test.txt increment="3 days" start="2013-01-01"
-t.register -i type=vect input=A4 file=/tmp/vinput4_area_test.txt increment="3 days" start="2013-01-10"
-t.register -i type=vect input=P1 file=/tmp/vinput1_point_test.txt increment="1 days" start="2013-01-01"
-t.register -i type=vect input=P2 file=/tmp/vinput2_point_test.txt increment="1 days" start="2013-01-10"
-t.register -i type=vect input=P3 file=/tmp/vinput3_point_test.txt increment="3 days" start="2013-01-01"
-t.register -i type=vect input=P4 file=/tmp/vinput4_point_test.txt increment="3 days" start="2013-01-10"
+t.register -i type=vect input=A1 file=vinput1_area_test.txt increment="1 days" start="2013-01-01"
+t.register -i type=vect input=A2 file=vinput2_area_test.txt increment="1 days" start="2013-01-10"
+t.register -i type=vect input=A3 file=vinput3_area_test.txt increment="3 days" start="2013-01-01"
+t.register -i type=vect input=A4 file=vinput4_area_test.txt increment="3 days" start="2013-01-10"
+t.register -i type=vect input=P1 file=vinput1_point_test.txt increment="1 days" start="2013-01-01"
+t.register -i type=vect input=P2 file=vinput2_point_test.txt increment="1 days" start="2013-01-10"
+t.register -i type=vect input=P3 file=vinput3_point_test.txt increment="3 days" start="2013-01-01"
+t.register -i type=vect input=P4 file=vinput4_point_test.txt increment="3 days" start="2013-01-10"
 
 # Test different options.
 t.vect.mapcalc expression='B1 = A1 & A2' basename="bmap1"

+ 1 - 1
temporal/t.vect.observe.strds/testsuite/test.t.vect.observe.strds.layer_bug.sh

@@ -37,4 +37,4 @@ t.remove type=strds input=precip_abs1
 t.remove type=stvds input=prec_observer
 
 #g.remove vect=prec_observer
-g.mremove -f type=rast pattern=test_prec_*
+#g.mremove -f type=rast pattern=test_prec_*

+ 2 - 2
temporal/t.vect.observe.strds/testsuite/test.t.vect.observe.strds.relative.sh

@@ -31,5 +31,5 @@ t.remove type=strds input=precip_abs1
 t.remove type=stvds input=prec_observer
 t.unregister type=vect maps=prec_observer:1,prec_observer:2,prec_observer:3,prec_observer:4,prec_observer:5,prec_observer:6
 
-g.remove vect=prec_observer,test_extract
-g.remove rast=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6
+#g.remove vect=prec_observer,test_extract
+#g.remove rast=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6

+ 2 - 2
temporal/t.vect.observe.strds/testsuite/test.t.vect.observe.strds.sh

@@ -45,5 +45,5 @@ t.vect.list input=test_1_observer
 t.vect.db.select input=test_1_observer columns=cat,test1,test2,test3
 
 # @postprocess
-t.remove -rf type=strds input=precip_abs1,precip_abs2
-t.remove -rf type=stvds input=prec_observer,test_1_observer
+#t.remove -rf type=strds input=precip_abs1,precip_abs2
+#t.remove -rf type=stvds input=prec_observer,test_1_observer