~ubuntu-branches/ubuntu/utopic/xf86-input-wacom/utopic

« back to all changes in this revision

Viewing changes to test/wacom-tests.c

  • Committer: Package Import Robot
  • Author(s): Maarten Lankhorst
  • Date: 2014-09-10 16:34:04 UTC
  • mfrom: (1.1.16)
  • Revision ID: package-import@ubuntu.com-20140910163404-0334r2g4juh1r1j2
Tags: 1:0.25.0-0ubuntu1
* New upstream release.
* Drop the udev script and use the upstream provided one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
        ds.pressure = 10;
153
153
 
154
154
        /* Pressure in out-of-proximity means get new preloaded pressure */
155
 
        priv.oldProximity = 0;
 
155
        priv.oldState.proximity = 0;
156
156
 
157
157
        /* make sure we don't touch priv, not really needed, the compiler should
158
158
         * honor the consts but... */
164
164
        assert(memcmp(&priv, &base, sizeof(priv)) == 0);
165
165
 
166
166
        /* Pressure in-proximity means rebase to new minimum */
167
 
        priv.oldProximity = 1;
 
167
        priv.oldState.proximity = 1;
168
168
 
169
169
        base = priv;
170
170
 
179
179
        InputInfoRec pInfo = {0};
180
180
        WacomDeviceRec priv = {0};
181
181
        WacomCommonRec common = {0};
182
 
        WacomDeviceState ds = {0};
183
182
        int pressure, prev_pressure = -1;
184
183
        int i, j;
185
184
 
186
185
        priv.common = &common;
187
186
        priv.pInfo = &pInfo;
188
 
        pInfo.name = "Wacom test device";
 
187
        pInfo.name = strdupa("Wacom test device");
 
188
        common.wcmPressureRecalibration = 1;
189
189
 
190
190
        priv.minPressure = 0;
191
191
 
198
198
 
199
199
                for (i = 0; i <= common.wcmMaxZ; i++)
200
200
                {
201
 
                        ds.pressure = i;
 
201
                        pressure = i;
202
202
 
203
 
                        pressure = normalizePressure(&priv, &ds);
 
203
                        pressure = normalizePressure(&priv, pressure);
204
204
                        assert(pressure >= 0);
205
205
                        assert(pressure <= FILTER_PRESSURE_RES);
206
206
 
216
216
         * minPressure and ignores actual pressure. This would be a bug in the
217
217
         * driver code, but we might as well test for it. */
218
218
        priv.minPressure = 10;
219
 
        ds.pressure = 0;
220
219
 
221
 
        prev_pressure = normalizePressure(&priv, &ds);
 
220
        prev_pressure = normalizePressure(&priv, 0);
222
221
        for (i = 0; i < priv.minPressure; i++)
223
222
        {
224
 
                ds.pressure = i;
225
223
 
226
 
                pressure = normalizePressure(&priv, &ds);
 
224
                pressure = normalizePressure(&priv, i);
227
225
 
228
226
                assert(pressure >= 0);
229
227
                assert(pressure < FILTER_PRESSURE_RES);
247
245
        WacomDeviceRec priv = {0};
248
246
        WacomCommonRec common = {0};
249
247
 
250
 
        int minx, maxx, miny, maxy, xres, yres;
 
248
        /* pin to some numbers */
 
249
        int xres = 1920, yres = 1600;
 
250
        int minx, maxx = 2 * xres, miny, maxy = 2 * yres;
251
251
 
252
252
        info.private = &priv;
253
253
        priv.common = &common;