98 Commits

Author SHA1 Message Date
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
330faa3e5a Add ability to test ActionInvoked signal 2018-12-30 17:07:27 +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
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