~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to lib/gpde/test/test_geom.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include <stdio.h>
19
19
#include <stdlib.h>
20
20
#include <string.h>
21
 
#include <grass/glocale.h>
22
21
#include <grass/N_pde.h>
23
 
#include <grass/G3d.h>
 
22
#include <grass/raster3d.h>
24
23
#include "test_gpde_lib.h"
25
24
 
26
25
/* prototypes */
33
32
{
34
33
    int sum = 0;
35
34
 
36
 
    G_message(_("\n++ Running geom_data unit tests ++"));
 
35
    G_message("\n++ Running geom_data unit tests ++");
37
36
 
38
37
    sum += test_geom_data();
39
38
 
40
39
    if (sum > 0)
41
 
        G_warning(_("\n-- geom_data unit tests failure --"));
 
40
        G_warning("\n-- geom_data unit tests failure --");
42
41
    else
43
 
        G_message(_("\n-- geom_data unit tests finished successfully --"));
 
42
        G_message("\n-- geom_data unit tests finished successfully --");
44
43
 
45
44
    return sum;
46
45
}
52
51
int test_geom_data(void)
53
52
{
54
53
    struct Cell_head region2d;
55
 
    G3D_Region region3d;
 
54
    RASTER3D_Region region3d;
56
55
    N_geom_data *geom = NULL;
57
56
    int sum = 0, i;
58
57
    double area = 0;
60
59
    G_get_set_window(&region2d);
61
60
 
62
61
    /*Set the defaults */
63
 
    G3d_initDefaults();
 
62
    Rast3d_init_defaults();
64
63
 
65
64
    /*get the current region */
66
 
    G3d_getWindow(&region3d);
 
65
    Rast3d_get_window(&region3d);
67
66
 
68
67
    geom = N_alloc_geom_data();
69
68
    if (!geom) {
111
110
            area += N_get_geom_data_area_of_cell(geom, i);
112
111
 
113
112
        if (area == 0) {
114
 
            G_warning
115
 
                ("Wrong area calculation in N_get_geom_data_area_of_cell");
 
113
            G_warning("Wrong area calculation in N_get_geom_data_area_of_cell");
116
114
            sum++;
117
115
        }
118
116
    }
149
147
            area += N_get_geom_data_area_of_cell(geom, i);
150
148
 
151
149
        if (area == 0) {
152
 
            G_warning
153
 
                ("Wrong area calculation in N_get_geom_data_area_of_cell");
 
150
            G_warning("Wrong area calculation in N_get_geom_data_area_of_cell");
154
151
            sum++;
155
152
        }
156
153
    }
161
158
            area += N_get_geom_data_area_of_cell(geom, i);
162
159
 
163
160
        if (area == 0) {
164
 
            G_warning
165
 
                ("Wrong area calculation in N_get_geom_data_area_of_cell");
 
161
            G_warning("Wrong area calculation in N_get_geom_data_area_of_cell");
166
162
            sum++;
167
163
        }
168
164
    }