Commit graph

59 commits

Author SHA1 Message Date
Peter Hutterer
5cecefeea0 test: fix compiler warnings for comparison int vs unsigned int
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-07-03 11:17:49 +10:00
Peter Hutterer
6b6f24ee1c Add functions to get the device name, PID and VID
Those three are the ones that matter for logging or device identification in
callers, so let's provide them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2014-07-02 08:52:33 +10:00
Peter Hutterer
8302b0b7e3 Merge branch 'master' into tablet-support
Conflicts:
	src/libinput-util.h
	test/misc.c
2014-06-25 14:43:45 +10:00
Jonas Ådahl
89aa3ca176 test: Add context reference counting test
This test relies on valgrind detecting the leak and use-after-free.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-25 10:27:03 +10:00
Jonas Ådahl
faab25c25c Make context reference counted
Instead of only allowing one owner keeping a libinput context alive,
make context reference counted, replacing libinput_destroy() with
libinput_unref() while adding another function libinput_ref().

Even though there might not be any current use cases, it doesn't mean we
should hard code this usage model in the API. The old behaviour can be
emulated by never calling libinput_ref() while replacing
libinput_destroy() with libinput_unref().

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-25 10:27:03 +10:00
Stephen Chandler Paul
812ea542e7 Add bitfield helper functions from libdevdev-util.h and some tests
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-16 20:31:03 -04:00
Peter Hutterer
0d31f9e8b1 test: compiler warning fixes
misc.c: In function ‘create_simple_test_device’:
misc.c:71:54: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  while ((type = va_arg(args, unsigned int)) != -1 &&
                                                      ^
misc.c:72:54: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         (code = va_arg(args, unsigned int)) != -1) {
2014-06-03 11:01:04 +10:00
Jonas Ådahl
d4b66061b3 test: Queue two motion events in pointer event conversion test
Pointer acceleration filters may absorb the first event, so queue two,
just in case.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-05-29 13:06:26 +02:00
Peter Hutterer
daafe46cb3 test: add tests for event conversion and back
Looks a bit excessive given how simple the base is but hey, we don't want to
ever break that bit. That'd be embarrassing.

And while we're at it make sure that the 'wrong' event getters return NULL for
each event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2014-04-10 11:11:56 +10:00