1398 Commits

Author SHA1 Message Date
Benedikt Heine
f9f5804b08 Remove notification_icon_get wrapper 2019-01-07 17:56:00 +01:00
Benedikt Heine
cd09d5a88e Cache GdkPixbuf in notification structure 2019-01-07 17:56:00 +01:00
Benedikt Heine
088907488c Rename icon field to iconname 2019-01-07 17:56:00 +01:00
Benedikt Heine
4043e1a18e Refactor pixbuf scaling into seperate method 2019-01-07 17:56:00 +01:00
Benedikt Heine
6a8f1c52c3
Merge pull request #576 from bebehei/settings-p1
Settings (part 1/x)
2019-01-07 17:17:16 +01:00
Nikos Tsipinakis
ebaa4a97d2
Merge pull request #585 from bebehei/cairo-conversion
Manually convert GdkPixbuf to cairo surfaces
2019-01-07 18:13:12 +02:00
Benedikt Heine
41ce7cce4a Add string_parse_* functions
Changes all string parsers to have a the almost same interface while
also having a proper return value, which indicates success of the
parsing process.
2019-01-07 15:32:28 +01:00
Benedikt Heine
8579b3ed6b Add assertion macro to return values
Just recently, I started using g_return_val_if_fail as a brief assertion
checker. It'll also exit the function with a specified return value.

But actually this introduces some weird behavior. It's configurable by
environment variables and it'll print out a log message, if the
expression didn't validate properly. But some of these assertions are
actually ment to be silent.

Using a simple macro makes it simple to structure the assertions and its
return values in a block at the start of a function or anywhere else.
2019-01-07 15:30:42 +01:00
Benedikt Heine
56f2adb106 Manually convert GdkPixbuf to cairo surfaces
As already noted in the code comment, we all knew that the in memory
conversion to a PNG stream is a cumbersome technique. But it was worth
to remove the GTK dependency.

After finding out, that gdk_pixbuf_new_from_data can actually use a
GVariant and share its memory without allocating new memory, I poked
the cairo docs for a similar technique.

There is cairo_image_surface_create_for_data, which would achieve the
same, but cairo uses another color byte order. So we have to manually
copy and reassemble the bytes.

It may look like a big rise in complexity, but actually, it's straight
forward copying pixel by pixel and changing the byte's order.

And the gdk_pixbuf_to_cairo_surface is 33x faster.
2019-01-07 00:45:34 +01:00
Benedikt Heine
595ffc294a
Merge pull request #584 from bebehei/test-printlog
Control to print log messages during test
2019-01-05 20:51:27 +01:00
Benedikt Heine
319e18e449 Use master branch for coveralls badge image 2019-01-05 15:56:27 +01:00
Benedikt Heine
0e0af0d8ec
Merge pull request #582 from bebehei/dbus-test2
Test raw icon assembly in DBus
2019-01-05 15:43:40 +01:00
Benedikt Heine
4fe0ee95d7
Merge pull request #581 from bebehei/notification-tests
Improve notification tests
2019-01-05 15:39:09 +01:00
Benedikt Heine
7092e54840 Control to print log messages during test
The log messages are useless during general and automated testing. But
while developing tests, the warning messages might be an easy debugging
option to check why one's own test currently fails.
2019-01-04 22:35:30 +01:00
Benedikt Heine
d1700dc3eb Test raw icon assembly in DBus 2019-01-03 18:39:22 +01:00
Benedikt Heine
c37326c9a0 Move memory allocation into test methods
This implies, that memory will only get freed, if the whole test method
is gone through. In case of failure, memory leaks aren't important. But
it's crucial not to fail with a segfault just for an assertion.

Fixes #580
2019-01-03 12:21:05 +01:00
Benedikt Heine
84e5a0bf26 Make notification_is_duplicate test icons
Before, it only did test for `ASSERT_FALSE` both times. So a raw_image
wasn't guaranteed to be a condition to falsify the return.

Using the single field function, will test for both cases.
2019-01-03 12:19:53 +01:00
Benedikt Heine
c1090ad7dc
Merge pull request #568 from bebehei/dbus-test
Dbus test
2018-12-31 05:58:14 +01:00
Benedikt Heine
330faa3e5a Add ability to test ActionInvoked signal 2018-12-30 17:07:27 +01:00
Benedikt Heine
a66ef34546 Do not use clang for coverage
When using clang, this will create a race condition between
clang/gcc builds. Coveralls will take the first one. As GCC and clang
are counting line coverage differently, coveralls regularly fails.
2018-12-30 17:07:04 +01:00
Benedikt Heine
c236ef7751 Always use an odd number of actions during testing 2018-12-30 17:07:04 +01:00
Benedikt Heine
62a83e183e Test urgency hints in DBus 2018-12-30 17:07:04 +01:00
Benedikt Heine
3c5b15d630 Test category hint in DBus 2018-12-30 17:07:04 +01:00
Benedikt Heine
416da59e9e Test icon hints in DBus 2018-12-30 17:07:04 +01:00
Benedikt Heine
01784d5514 Test progress hints in DBus 2018-12-30 17:07:04 +01:00
Benedikt Heine
5e616516df Test transient hints in DBus 2018-12-30 17:07:01 +01:00
Benedikt Heine
5ebedab78b Fix maybe uninitialized variable 2018-12-29 14:38:59 +01:00
Benedikt Heine
63f455276f Print correct ID for foreign DBus service
By providing an additional layer of pointers, the printed PID was
actually the value at the PID's memory position. 🙈
2018-12-29 14:38:59 +01:00
Benedikt Heine
57a6baae85 Test FDN Daemon info 2018-12-29 14:38:59 +01:00
Benedikt Heine
fb483347ed Test close signals 2018-12-29 14:38:59 +01:00
Benedikt Heine
ae58207f9b Use binary search for functions 2018-12-29 14:38:58 +01:00
Benedikt Heine
c35801b3ab Use a macro for method callbacks 2018-12-29 14:36:50 +01:00
Benedikt Heine
4fbb8fa75b Prefix dbus callbacks with dbus_cb_ 2018-12-29 14:31:31 +01:00
Benedikt Heine
0d82b19987 Add test for empty notification 2018-12-29 14:31:31 +01:00
Benedikt Heine
caffb0b10c Add tests for notification color hints 2018-12-29 14:31:31 +01:00
Benedikt Heine
b10bb292c6 Simplify DBus notification assembly 2018-12-29 14:31:31 +01:00
Benedikt Heine
a8faea725d wait longer for DBus in tests
While running under valgrind, it may take over 30 cycles in the loop to
wait for a running GTestDBus instance. So we have to increase the
waiting time.

Waiting a whole second will change the signal/noise ratio and will only
fail, if there's really a problem with the GTestDBus usage.

And as we're sleeping 500us in every loop, we usually get a super fast
response, too.
2018-12-29 14:31:31 +01:00
Benedikt Heine
314d982bf4 Add capability tests for DBus 2018-12-29 14:31:31 +01:00
Benedikt Heine
3598aaf3e2 Add initial dbus tests 2018-12-29 14:31:29 +01:00
Benedikt Heine
52885ca6ad Use a hashtable for notification actions
As g_strv_contains is only available in GLib >= 2.44, we have to bump
the GLib requirements and the CI distros, too.
2018-12-29 14:30:55 +01:00
Benedikt Heine
a359b74901
Merge pull request #555 from anbenson/master
Add tests for extract_urls
2018-12-29 13:54:09 +01:00
Benedikt Heine
f4b8fff89d Simplify pointer test cases 2018-12-29 13:50:35 +01:00
Benedikt Heine
d40b42c77d Add additional tests for extract_urls 2018-12-27 20:59:48 +01:00
Benedikt Heine
db350883cc Improve extract_urls 2018-12-27 20:59:47 +01:00
Andrew Benson
65bcce652c Add tests for extract_urls 2018-12-27 20:59:19 +01:00
Benedikt Heine
c562c6441a Add CircleCI status badge 2018-12-10 04:21:46 +01:00
Benedikt Heine
ab56b47d97 Use official CI docker images 2018-12-10 04:19:25 +01:00
Nikos Tsipinakis
fd486d06d5
Merge pull request #567 from bebehei/circleci
CircleCI
2018-12-02 15:37:59 +02:00
Benedikt Heine
90813dde8e Update Fedora version to latest 2018-11-29 10:29:22 +02:00
Benedikt Heine
91adaa0da9 Use clang and GCC simultaneously 2018-11-28 21:22:36 +02:00