#include "check_suites.h"
#include "xcb.h"
-/* XCBParseDisplay tests {{{ */
+/* xcb_parse_display tests {{{ */
static void parse_display_pass(const char *name, const char *host, const int display, const int screen)
{
got_host = (char *) -1;
got_display = got_screen = -42;
mark_point();
- success = XCBParseDisplay(name, &got_host, &got_display, &got_screen);
+ success = xcb_parse_display(name, &got_host, &got_display, &got_screen);
fail_unless(success, "unexpected parse failure for '%s'", name);
fail_unless(strcmp(host, got_host) == 0, "parse produced unexpected hostname '%s' for '%s': expected '%s'", got_host, name, host);
fail_unless(display == got_display, "parse produced unexpected display '%d' for '%s': expected '%d'", got_display, name, display);
got_host = (char *) -1;
got_display = got_screen = -42;
mark_point();
- success = XCBParseDisplay(name, &got_host, &got_display, 0);
+ success = xcb_parse_display(name, &got_host, &got_display, 0);
fail_unless(success, "unexpected screenless parse failure for '%s'", name);
fail_unless(strcmp(host, got_host) == 0, "screenless parse produced unexpected hostname '%s' for '%s': expected '%s'", got_host, name, host);
fail_unless(display == got_display, "screenless parse produced unexpected display '%d' for '%s': expected '%d'", got_display, name, display);
got_host = (char *) -1;
got_display = got_screen = -42;
mark_point();
- success = XCBParseDisplay(name, &got_host, &got_display, &got_screen);
+ success = xcb_parse_display(name, &got_host, &got_display, &got_screen);
fail_unless(!success, "unexpected parse success for '%s'", name);
fail_unless(got_host == (char *) -1, "host changed on failure for '%s': got %p", got_host);
fail_unless(got_display == -42, "display changed on failure for '%s': got %d", got_display);
got_host = (char *) -1;
got_display = got_screen = -42;
mark_point();
- success = XCBParseDisplay(name, &got_host, &got_display, 0);
+ success = xcb_parse_display(name, &got_host, &got_display, 0);
fail_unless(!success, "unexpected screenless parse success for '%s'", name);
fail_unless(got_host == (char *) -1, "host changed on failure for '%s': got %p", got_host);
fail_unless(got_display == -42, "display changed on failure for '%s': got %d", got_display);
{
Suite *s = suite_create("Public API");
putenv("DISPLAY");
- suite_add_test(s, parse_display_unix, "XCBParseDisplay unix");
- suite_add_test(s, parse_display_ip, "XCBParseDisplay ip");
- suite_add_test(s, parse_display_ipv4, "XCBParseDisplay ipv4");
- suite_add_test(s, parse_display_ipv6, "XCBParseDisplay ipv6");
- suite_add_test(s, parse_display_decnet, "XCBParseDisplay decnet");
- suite_add_test(s, parse_display_negative, "XCBParseDisplay negative");
+ suite_add_test(s, parse_display_unix, "xcb_parse_display unix");
+ suite_add_test(s, parse_display_ip, "xcb_parse_display ip");
+ suite_add_test(s, parse_display_ipv4, "xcb_parse_display ipv4");
+ suite_add_test(s, parse_display_ipv6, "xcb_parse_display ipv6");
+ suite_add_test(s, parse_display_decnet, "xcb_parse_display decnet");
+ suite_add_test(s, parse_display_negative, "xcb_parse_display negative");
return s;
}