Changeset 62299


Ignore:
Timestamp:
Oct 19, 2014, 7:39:37 PM (10 years ago)
Author:
annakrat
Message:

r.profile: fixed failing tests on 64bit - using double instead of float, add additional test

Location:
grass/trunk/raster/r.profile
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • grass/trunk/raster/r.profile/main.c

    r62046 r62299  
    273273               char *null_string, const char *unit, double factor)
    274274{
    275     float rows, cols, LEN;
     275    double rows, cols, LEN;
    276276    double Y, X, AZI;
    277277
  • grass/trunk/raster/r.profile/testsuite/test_profile_ncspm.py

    r62046 r62299  
    7373"""
    7474
     75output5 = """
     76635747.000000 222664.000000 0.000000 117.672462
     77635738.870095 222669.822770 10.000000 116.417213
     78635730.740190 222675.645539 20.000000 115.639481
     79635722.610285 222681.468309 30.000000 112.835342
     80635714.480381 222687.291079 40.000000 111.324890
     81635706.350476 222693.113848 50.000000 108.612282
     82635698.220571 222698.936618 60.000000 106.313347
     83635690.090666 222704.759388 70.000000 104.915665
     84635681.960761 222710.582158 80.000000 102.878601
     85635673.830856 222716.404927 90.000000 102.935074
     86635673.000000 222717.000000 91.021975 102.935074
     87635665.017450 222710.976803 101.021975 102.932213
     88635657.034900 222704.953607 111.021975 102.931152
     89635649.052351 222698.930410 121.021975 102.932213
     90635641.069801 222692.907213 131.021975 102.932213
     91635633.087251 222686.884017 141.021975 102.931648
     92635625.104701 222680.860820 151.021975 102.936768
     93635617.122151 222674.837623 161.021975 102.903358
     94635609.139601 222668.814427 171.021975 105.447823
     95635601.157052 222662.791230 181.021975 105.447823
     96635593.174502 222656.768033 191.021975 108.423523
     97635585.191952 222650.744836 201.021975 109.192360
     98635577.209402 222644.721640 211.021975 112.042763
     99635569.226852 222638.698443 221.021975 114.321136
     100635563.000000 222634.000000 228.822556 114.321136
     101635569.507914 222626.407434 238.822556 115.357292
     102635576.015827 222618.814868 248.822556 114.609100
     103635582.523741 222611.222302 258.822556 111.636292
     104635589.031655 222603.629736 268.822556 112.355431
     105635595.539569 222596.037170 278.822556 110.162842
     106635602.047482 222588.444604 288.822556 109.172668
     107635608.555396 222580.852038 298.822556 109.172668
     108635615.063310 222573.259472 308.822556 108.030540
     109635621.571224 222565.666906 318.822556 105.670113
     110635628.079137 222558.074340 328.822556 105.770287
     111635634.587051 222550.481774 338.822556 105.169937
     112635641.000000 222543.000000 348.676634 105.416862
     113635647.589446 222550.521915 358.676634 105.011185
     114635654.178892 222558.043830 368.676634 104.854263
     115635660.768338 222565.565744 378.676634 104.573921
     116635667.357784 222573.087659 388.676634 103.413361
     117635673.947230 222580.609574 398.676634 105.485588
     118635680.536676 222588.131489 408.676634 109.791016
     119635687.126122 222595.653403 418.676634 109.701485
     120635693.715568 222603.175318 428.676634 112.104370
     121635700.305014 222610.697233 438.676634 113.684036
     122635706.894460 222618.219148 448.676634 113.684036
     123635713.483906 222625.741062 458.676634 114.252579
     124635720.073352 222633.262977 468.676634 114.115379
     125635726.662798 222640.784892 478.676634 114.123955
     126635733.252244 222648.306807 488.676634 115.766998
     127635739.841690 222655.828721 498.676634 116.547440
     128635746.431136 222663.350636 508.676634 117.672462
     129"""
     130
    75131
    76132class TestProfileNCSPM(TestCase):
     
    90146        self.assertModule(rprofile)
    91147        self.assertMultiLineEqual(rprofile.outputs.stdout.strip(), output1.strip())
    92         self.assertIn('128.798294 [meters]', rprofile.outputs.stderr)  # distance
     148        self.assertIn('128.798292 [meters]', rprofile.outputs.stderr)  # distance
    93149        self.assertIn('10 [meters]', rprofile.outputs.stderr)  # resolution
    94150
     
    97153                                coordinates=[637656, 224222, 637766, 224289])
    98154        self.assertModule(rprofile)
    99         self.assertIn('128.798294 [meters]', rprofile.outputs.stderr)  # distance
     155        self.assertIn('128.798292 [meters]', rprofile.outputs.stderr)  # distance
    100156        self.assertIn('10 [meters]', rprofile.outputs.stderr)  # resolution
    101157
     
    105161        self.assertModule(rprofile)
    106162        self.assertMultiLineEqual(rprofile.outputs.stdout.strip(), output4.strip())
    107         self.assertIn('128.798294 [meters]', rprofile.outputs.stderr)  # distance
     163        self.assertIn('128.798292 [meters]', rprofile.outputs.stderr)  # distance
    108164        self.assertIn('25 [meters]', rprofile.outputs.stderr)  # resolution
    109165
     
    121177        self.assertMultiLineEqual(rprofile.outputs.stdout.strip(), output3.strip())
    122178        self.assertIn("WARNING: Endpoint coordinates are outside of current region settings",
    123                       rprofile.outputs.stderr,)
     179                      rprofile.outputs.stderr)
     180
     181    def test_profile_directions(self):
     182        rprofile = SimpleModule('r.profile', input='elevation', flags='g',
     183                                coordinates=[635747, 222664, 635673, 222717, 635563,
     184                                             222634, 635641, 222543, 635747, 222664])
     185        self.assertModule(rprofile)
     186        self.assertMultiLineEqual(rprofile.outputs.stdout.strip(), output5.strip())
    124187
    125188
Note: See TracChangeset for help on using the changeset viewer.