90 Commits

Author SHA1 Message Date
Benedikt Heine
5e616516df Test transient hints in DBus 2018-12-30 17:07:01 +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
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
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
5284ce01f4 Make notification tests easier 2018-11-26 12:19:17 +01:00
Benedikt Heine
193b1f7202 Test notification maximum length 2018-11-26 12:19:17 +01:00
Benedikt Heine
1b4ca786cd Test notification_format_message 2018-11-26 12:17:50 +01:00
Benedikt Heine
6988a6e04d Add tests for log.c 2018-11-26 12:08:18 +01:00
Benedikt Heine
ec3e47abb5 Skip tests requiring extended precision if not avail
Alpine is running with Musl libc and musl uses extended precision
doubles, while valgrind can't handle extended precision,
2.3 == atof("2.3") won't be true under valgrind.

And therefore the option retrieval methods *_get_double would fail.

Also we have to increase the test verbosity, as `SKIPm` doesn't print
the message when skipping the tests.
See: silentbicycle/greatest#85
2018-11-26 12:07:50 +01:00
Benedikt Heine
22cc3f190d Update greatest.h (1.2.1 -> 1.4.0)
Enables the feature -x to exclude some specific tests.
2018-11-26 10:52:57 +01:00
Benedikt Heine
711b11c92f Merge queue_update and queue_check_timeouts 2018-11-24 15:22:18 +01:00
Benedikt Heine
0b7a31b477 Add faulty notification seep test 2018-11-24 15:22:18 +01:00
Benedikt Heine
3e0daf40bf Add tests for xmore layout behavior 2018-11-24 15:22:18 +01:00
Benedikt Heine
24e0e25ec2 Add tests for seeping important notifications 2018-11-24 15:22:18 +01:00
Benedikt Heine
acee260624 Add test for pausing behavior 2018-11-24 15:22:18 +01:00
Benedikt Heine
3fbd1fc589 Add tests for fullscreen behavior 2018-11-24 15:22:18 +01:00
Benedikt Heine
2c1de2dc22 Add tests for checking notifications timing out 2018-11-24 15:22:18 +01:00
Benedikt Heine
e6e0d881eb Test stacking 2018-11-24 15:22:18 +01:00
Benedikt Heine
f1e391673a Add queue history tests 2018-11-24 15:22:18 +01:00
Benedikt Heine
5cf9e51ada Test queue length reporting functions 2018-11-24 15:22:18 +01:00
Benedikt Heine
662b22e5de Test sleep times for get_next_datachange 2018-11-24 15:22:18 +01:00
Benedikt Heine
140278a36f Introduce a status structure 2018-11-24 15:22:18 +01:00
Benedikt Heine
ef08f6aa66 Test notification closing in queues 2018-11-24 15:22:18 +01:00
Benedikt Heine
294cfdfa47 Test insertion mechanisms 2018-11-24 15:22:18 +01:00
Benedikt Heine
fb5926b6fa Add tests for queue teardown 2018-11-24 15:22:18 +01:00
Benedikt Heine
e04003e291 Add Framework for queues tests 2018-11-24 15:22:18 +01:00
Benedikt Heine
9b45a111f1 Sort includes alphabetically 2018-11-15 15:17:48 +01:00
Benedikt Heine
a6abfdf7c5 Include all local files relatively 2018-11-15 15:17:48 +01:00
Benedikt Heine
8c192f3c28 Make tests runnable from everywhere 2018-11-15 15:17:46 +01:00
Benedikt Heine
2e9d8300de Include full c source to assert static objects
To assert static objects, we either have to add a method into the
object under test itself and recompile on a test run with the activated test
method (but also recompile after tests, so that method is gone on
release builds).

Alternatively we can include the whole .c file in our test
infrastructure and save the object in the test directory. So there's no
necessity to clean it up prior to a release build and it's contained
away.

This requires, that the test folder isn't excluded in coveralls.
2018-11-15 15:17:21 +01:00
Benedikt Heine
eba6913faa Test version number in unittests
Enforces a version number as intended in the Makefile. This check is
necessary, as there is no ability to check via Macros for an empty
string.
2018-11-12 15:32:58 +01:00
Benedikt Heine
90b04a22dd Use g_malloc instead of malloc
g_malloc won't return NULL, but abort the program. As we don't check for
NULl, this is the better solution.
2018-11-11 15:18:56 +01:00
Benedikt Heine
d8d457f500 Remove string_replace()
string_replace_at does almost the same and string_replace is only used
once, where additionally string_replace_at would be the better choice.
2018-11-11 15:18:56 +01:00
Nikos Tsipinakis
2c6cb8ebf3 Implement smarter markup escaping
Automatically detect and escape invalid and unsupported & entities.

Fixes #546
2018-11-06 20:49:47 +02:00
Benedikt Heine
52c47524f2 Test notification referencing 2018-10-08 18:27:11 +02:00
Benedikt Heine
778a6857d8 Move clean_value function to utils.c
This is a typical string manipulation function an has no necessity to
stay in option_parser.
2018-10-08 18:27:11 +02:00
Benedikt Heine
6cc7ca361a Allow half quoted values
Previously config lines like

[rule]
script = mail -s "New notif"

were only possible to get written with additional full quotes,
which makes no sense in command line expressions.
2018-10-08 18:27:11 +02:00
Benedikt Heine
837b4fe125 Implement refcounting for notifications 2018-10-06 13:43:49 +02:00
Benedikt Heine
c5c4b2cafb Use native notification functions in test
Since we'll allocate also some recursive elements with
notification_create, we have to free the notification properly.
2018-10-01 13:11:21 +02:00
Benedikt Heine
c5d552856f Reformat icon_position enum 2018-09-16 02:58:35 +02:00