36 Commits

Author SHA1 Message Date
Benedikt Heine
3bfc77864f Refactor GdkPixbuf loading
Rename both functions to make clear, what the difference between the
previous functions _from_file and _from_path is. Also remove the
superfluous `== NULL` checks as these don't match dunst's current style.
2018-05-14 09:11:25 +03:00
Benedikt Heine
3f7de41732 Add tests for icon.c 2018-05-14 09:11:25 +03:00
Benedikt Heine
2c503c2984 Add option to suppress log output when testing 2018-02-02 17:29:04 +01:00
Benedikt Heine
acd8be51ab Remove a and img tags from msg
While the notification spec allows tags like <a href="...">...</a> and
<img src="..." alt="...">, pango cannot parse these tags and therefore
these tags should be removed before passed to pango.

Also the method notification_extract_markup_urls is not needed anymore,
as markup_strip_a can return URLs optionally.

This implies, that URL replacement is now indicated via show_indicators
for URLs and the dmenu string is in the format of
'[text between a tags] URL\n'. This is similarly handled for images,
too.
2017-12-15 00:16:31 +01:00
Benedikt Heine
5f51147263 Prefix urgency enum with URG_ 2017-11-16 17:12:30 +01:00
Nikos Tsipinakis
e8e4af9ea3 Temporarily remove invalid value test in string_to_time
As mentioned in #368 testing for invalid values with the current
implementation would result in misleading error messages being printed
to stdout. These tests should be disabled until a solution is found.
2017-10-07 19:05:49 +03:00
Benedikt Heine
5d46cd700c Add option_get_time functions 2017-10-07 17:46:24 +02:00
Nikos Tsipinakis
0a3298dde4 Merge pull request #387 from bebehei/tests-for-string-append
Tests for string append
2017-10-06 18:17:50 +03:00
Benedikt Heine
a6301ff464 Do not concatenate empty strings with separator 2017-10-06 13:13:47 +02:00
Benedikt Heine
a1781a451b Check for b value if null in string_append
This avoids "a", NULL, "sep" to come to "asep" instead of "a".
2017-09-25 03:55:19 +02:00
Benedikt Heine
8b11113be1 Implement test_string_append 2017-09-25 03:54:37 +02:00
Benedikt Heine
554c873808 Mark constant strings as const
It's hard to trace back, which methods in option parser require freeing
the result and which prohibit it. Marking all non-freeable values as
const lets this problem solve the compiler.
2017-09-25 02:26:11 +02:00
Benedikt Heine
e16117ca30 Use double pointers for haystack 2017-09-07 15:25:54 +02:00
Benedikt Heine
ab9bf55892 Prevent replacement of format strings in message
To replace all occuring format strings inside the msg, replace_all had
been used previously. This leads to buggy behavior, if a format string
occurs in the replaced text, as the format string will get replaced
again under certain conditions.

Introducing a pointer, which skips the already replaced parts, will
prevent doubly replacing format strings from content.

Fixes #322
2017-09-07 15:25:14 +02:00
Benedikt Heine
7eb99ea64d add tests for *_get_path functions 2017-08-15 23:51:14 +02:00
Nikos Tsipinakis
a08fba49d0 Remove bounce setting
Bounce was functionally removed in
b2883b213342c912a76329bb8f6c179ea3451ae5 during the transition from Xft
to Cairo without any mention. There is no use to keeping it in the example dunstrc
and storing the value in the code,

This commit will probably be reversed if and when bounce is
re-implemented.
2017-07-03 15:36:08 +03:00
Luke Shumaker
c645ba3106 Add tests for markup functions 2017-03-13 16:40:18 -04:00
Nikos Tsipinakis
d8d267e1f0 ASSERT_FALSE(expr == NULL) -> ASSERT(expr)
Simplify assert calls to improve code readability.
2017-02-23 20:45:09 +02:00
Nikos Tsipinakis
0c49b49254 Replace string_to_argv util function with g_shell_parse_argv
string_to_argv parsing was very simplistic and didn't properly handle
quotations. Since we are already using glib, g_shell_parse_argv serves
the same purpose with much better parsing and error handling.
2017-02-05 13:00:59 +02:00
Nikos Tsipinakis
38856bc705 Fix wrong config path in notification test suite 2017-02-05 13:00:59 +02:00
Nikos Tsipinakis
d445661031 Add simple test for notification_replace_format 2017-02-04 22:10:51 +02:00
Nikos Tsipinakis
0deff4412e Add initial notification test suite
The beginnings of the notification test suite, currently only includes
tests for `notification_is_duplicate`.
2017-01-29 15:32:36 +02:00
Nikos Tsipinakis
f34b846041 Fix memory leaks in the unit tests
Making valgrind complain less should help finding actual memory leaks in
the long run.
2017-01-29 15:32:36 +02:00
Nikos Tsipinakis
2614b4d06e Move functional tests to a different subdirectory 2017-01-04 11:13:21 +02:00
Nikos Tsipinakis
187d3f9ab9 Invalid boolean values should fall back to the default
Previously, an invalid value was always false
2016-12-15 19:13:08 +02:00
Nikos Tsipinakis
b9619a1460 Add option parser test suite 2016-12-03 19:33:40 +02:00
Nikos Tsipinakis
9333d68656 Use the suite_ prefix for test suites 2016-12-03 19:19:10 +02:00
Nikos Tsipinakis
256440b25a Implement tests for most of the util functions
Also improved the implementation of the test_string_replace_char test.
2016-11-22 18:47:38 +02:00
Nikos Tsipinakis
d441e950d8 Implement test target and add the first test
make test will now compile the tests to test/test.
The first test, testing string_replace_char from utils.c, was added.
2016-11-19 12:26:00 +02:00
Nikos Tsipinakis
7ba0fe03ae Add 'greatest' testing framework
Never used this framework before but it seems promising.
2016-11-19 12:17:23 +02:00
Josh Brown
d3ae6c5951 Remove trailing spaces from all other files 2014-08-03 15:47:59 +00:00
Sascha Kruse
3127bb9198 test.sh: echp what test is currently run 2013-03-08 04:20:55 +01:00
Sascha Kruse
c2a5b526e2 fix expanding window across the screen
test case included
2013-03-02 17:22:12 +01:00
Sascha Kruse
de4db5e559 test.sh fix typo 2013-02-25 22:12:46 +01:00
Sascha Kruse
71d95394fd replace notify.py with dunstify 2013-02-23 04:51:37 +00:00
Sascha Kruse
23f0230baa basic testing framework 2013-02-23 00:35:02 +00:00