sbus_tests.c revision f5e47e1d65f80ffdb1893feab18583a74d661214
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder/*
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly SSSD
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens Elkner
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly sbus_codegen tests.
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu Prodescu Authors:
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly Stef Walter <stefw@redhat.com>
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly Copyright (C) Red Hat, Inc 2014
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly This program is free software; you can redistribute it and/or modify
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly it under the terms of the GNU General Public License as published by
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly the Free Software Foundation; either version 3 of the License, or
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly (at your option) any later version.
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly
9aeda2b3ae8ce0b018955521e4ca835a8ba8a27bLiam O'Reilly This program is distributed in the hope that it will be useful,
57221209d11b05aa0373cc3892d5df89ba96ebf9Christian Maeder but WITHOUT ANY WARRANTY; without even the implied warranty of
66bc8d6e69cde43f1ccbeb76104cf7b8038acd6cChristian Maeder MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66bc8d6e69cde43f1ccbeb76104cf7b8038acd6cChristian Maeder GNU General Public License for more details.
e90dc723887d541f809007ae81c9bb73ced9592eChristian Maeder
d5833d2ee7bafcbf2fdd2bdfd9a728c769b100c7Christian Maeder You should have received a copy of the GNU General Public License
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly along with this program. If not, see <http://www.gnu.org/licenses/>.
56899f6457976a2ee20f6a23f088cb5655b15715Liam O'Reilly*/
66bc8d6e69cde43f1ccbeb76104cf7b8038acd6cChristian Maeder
a00461fcf7432205a79a0f12dbe6c1ebc58bc000Christian Maeder#include <stdlib.h>
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly#include <check.h>
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly#include <talloc.h>
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly#include <tevent.h>
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly#include <popt.h>
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly
7830e8fa7442fb7452af7ecdba102bc297ae367eChristian Maeder#include "common.h"
f21c7417bdd1c0282025cba0f5cb0ff5bc5c98eeLiam O'Reilly
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder#include "sbus/sssd_dbus.h"
50c62c8c45643f09bcb2f4a99b07bf1d072ecf40Christian Maeder#include "sbus/sssd_dbus_meta.h"
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly#include "util/util_errors.h"
c0833539c8cf577dd3f2497792fbdd818442744cChristian Maeder
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly/*
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly * Although one would normally rely on the codegen to generate these
7830e8fa7442fb7452af7ecdba102bc297ae367eChristian Maeder * structures, we want to test this functionality *before* we test
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly * the codegen in sbus_codegen_tests ... so these are hand rolled.
fa373bc327620e08861294716b4454be8d25669fChristian Maeder */
036ecbd8f721096321f47cf6a354a9d1bf3d032fChristian Maeder
aa4d26536fffe0153cd81d28925985892ac2f300Christian Maeder#define PILOT_IFACE "test.Pilot"
2a5b885d9350ec6dd8bc4992ee91d2f68aa592f4Christian Maeder#define PILOT_BLINK "Blink"
f21c7417bdd1c0282025cba0f5cb0ff5bc5c98eeLiam O'Reilly
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly/* our vtable */
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maederstruct pilot_vtable {
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder struct sbus_vtable vtable;
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder sbus_msg_handler_fn Blink;
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly};
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reillyconst struct sbus_method_meta pilot_methods[] = {
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly {
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly PILOT_BLINK, /* method name */
9e5f4073e948104307d43c3962d624b8416f191fLiam O'Reilly NULL, /* in args: manually parsed */
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder NULL, /* out args: manually parsed */
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder offsetof(struct pilot_vtable, Blink),
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder },
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder { NULL, }
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder};
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder
648fe1220044aac847acbdfbc4155af5556063ebChristian Maederconst struct sbus_interface_meta pilot_meta = {
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder PILOT_IFACE, /* name */
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder pilot_methods,
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder NULL, /* no signals */
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder NULL, /* no properties */
ebd23ec61635b0bebf7969d14f65b9d1e39f2b26Liam O'Reilly};
d5833d2ee7bafcbf2fdd2bdfd9a728c769b100c7Christian Maeder
d5833d2ee7bafcbf2fdd2bdfd9a728c769b100c7Christian Maederstatic int blink_handler(struct sbus_request *req, void *data)
9aeda2b3ae8ce0b018955521e4ca835a8ba8a27bLiam O'Reilly{
9aeda2b3ae8ce0b018955521e4ca835a8ba8a27bLiam O'Reilly DBusError error = DBUS_ERROR_INIT;
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly const char *path;
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder dbus_int32_t duration = 0;
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder dbus_bool_t crashed;
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder ck_assert(req->intf->vtable->meta == &pilot_meta);
d5833d2ee7bafcbf2fdd2bdfd9a728c769b100c7Christian Maeder ck_assert(data != NULL);
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder ck_assert(data == req->intf->instance_data);
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly path = dbus_message_get_path(req->message);
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly ck_assert_str_eq(req->intf->path, path);
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly
fa373bc327620e08861294716b4454be8d25669fChristian Maeder if (strcmp(path, "/test/fry") == 0) {
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder ck_assert_str_eq(data, "Don't crash");
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder } else if (strcmp(path, "/test/leela") == 0) {
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder ck_assert_str_eq(data, "Crash into the billboard");
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder } else {
fa373bc327620e08861294716b4454be8d25669fChristian Maeder ck_abort();
fa373bc327620e08861294716b4454be8d25669fChristian Maeder }
fa373bc327620e08861294716b4454be8d25669fChristian Maeder
fa373bc327620e08861294716b4454be8d25669fChristian Maeder if (!dbus_message_get_args (req->message, &error,
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder DBUS_TYPE_INT32, &duration,
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder DBUS_TYPE_INVALID)) {
d5833d2ee7bafcbf2fdd2bdfd9a728c769b100c7Christian Maeder sbus_request_fail_and_finish(req, &error);
e8d99f05c231b379be702a1aa8c7dd0b3c666928Liam O'Reilly dbus_error_free(&error);
e8d99f05c231b379be702a1aa8c7dd0b3c666928Liam O'Reilly return EOK;
7857a35e3af533dfbd0f0e18638ebd211e6358a0Christian Maeder }
7857a35e3af533dfbd0f0e18638ebd211e6358a0Christian Maeder
9aeda2b3ae8ce0b018955521e4ca835a8ba8a27bLiam O'Reilly /* Pilot crashes when eyes closed too long */
e8d99f05c231b379be702a1aa8c7dd0b3c666928Liam O'Reilly crashed = (duration > 5);
e7cd36335f0f7be9ed5005e71d94c2856b588d62Christian Maeder
e7cd36335f0f7be9ed5005e71d94c2856b588d62Christian Maeder return sbus_request_return_and_finish(req,
e7cd36335f0f7be9ed5005e71d94c2856b588d62Christian Maeder DBUS_TYPE_BOOLEAN, &crashed,
e7cd36335f0f7be9ed5005e71d94c2856b588d62Christian Maeder DBUS_TYPE_INVALID);
e8d99f05c231b379be702a1aa8c7dd0b3c666928Liam O'Reilly}
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder
648fe1220044aac847acbdfbc4155af5556063ebChristian Maederstruct pilot_vtable pilot_impl = {
7857a35e3af533dfbd0f0e18638ebd211e6358a0Christian Maeder { &pilot_meta, 0 },
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly .Blink = blink_handler,
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly};
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder
648fe1220044aac847acbdfbc4155af5556063ebChristian Maederstatic int pilot_test_server_init(struct sbus_connection *server, void *unused)
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder{
c0833539c8cf577dd3f2497792fbdd818442744cChristian Maeder int ret;
d5833d2ee7bafcbf2fdd2bdfd9a728c769b100c7Christian Maeder
c0833539c8cf577dd3f2497792fbdd818442744cChristian Maeder ret = sbus_conn_add_interface(server,
c0833539c8cf577dd3f2497792fbdd818442744cChristian Maeder sbus_new_interface(server, "/test/leela",
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder &pilot_impl.vtable,
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder "Crash into the billboard"));
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder ck_assert_int_eq(ret, EOK);
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly
eb48217dfa67ddb87b8fbd846de293d0636bd578Christian Maeder
c0833539c8cf577dd3f2497792fbdd818442744cChristian Maeder ret = sbus_conn_add_interface(server,
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly sbus_new_interface(server, "/test/fry",
7830e8fa7442fb7452af7ecdba102bc297ae367eChristian Maeder &pilot_impl.vtable,
eb48217dfa67ddb87b8fbd846de293d0636bd578Christian Maeder "Don't crash"));
7830e8fa7442fb7452af7ecdba102bc297ae367eChristian Maeder ck_assert_int_eq(ret, EOK);
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly
eb48217dfa67ddb87b8fbd846de293d0636bd578Christian Maeder return EOK;
eb48217dfa67ddb87b8fbd846de293d0636bd578Christian Maeder}
7830e8fa7442fb7452af7ecdba102bc297ae367eChristian Maeder
648fe1220044aac847acbdfbc4155af5556063ebChristian MaederSTART_TEST(test_raw_handler)
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder{
7830e8fa7442fb7452af7ecdba102bc297ae367eChristian Maeder TALLOC_CTX *ctx;
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder DBusConnection *client;
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder DBusError error = DBUS_ERROR_INIT;
4314e26a12954cb1c9be4dea10aa8103edac5bbbChristian Maeder DBusMessage *reply;
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder dbus_bool_t crashed;
ebd23ec61635b0bebf7969d14f65b9d1e39f2b26Liam O'Reilly dbus_int32_t duration;
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder ctx = talloc_new(NULL);
ebd23ec61635b0bebf7969d14f65b9d1e39f2b26Liam O'Reilly client = test_dbus_setup_mock(ctx, NULL, pilot_test_server_init, NULL);
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder /* Leela crashes with a duration higher than 5 */
4314e26a12954cb1c9be4dea10aa8103edac5bbbChristian Maeder duration = 10;
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder reply = test_dbus_call_sync(client,
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder "/test/leela",
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder PILOT_IFACE,
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly PILOT_BLINK,
d5833d2ee7bafcbf2fdd2bdfd9a728c769b100c7Christian Maeder &error,
d5833d2ee7bafcbf2fdd2bdfd9a728c769b100c7Christian Maeder DBUS_TYPE_INT32, &duration,
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder DBUS_TYPE_INVALID);
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder ck_assert(reply != NULL);
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder ck_assert(!dbus_error_is_set(&error));
e0f1794e365dd347e97b37d7d22b2fce27296fa1Christian Maeder ck_assert(dbus_message_get_args(reply, NULL,
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder DBUS_TYPE_BOOLEAN, &crashed,
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder DBUS_TYPE_INVALID));
2a5b885d9350ec6dd8bc4992ee91d2f68aa592f4Christian Maeder dbus_message_unref (reply);
7857a35e3af533dfbd0f0e18638ebd211e6358a0Christian Maeder ck_assert(crashed == true);
7857a35e3af533dfbd0f0e18638ebd211e6358a0Christian Maeder
2a5b885d9350ec6dd8bc4992ee91d2f68aa592f4Christian Maeder /* Fry daesn't crash with a duration lower than 5 */
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder duration = 1;
2a5b885d9350ec6dd8bc4992ee91d2f68aa592f4Christian Maeder reply = test_dbus_call_sync(client,
7857a35e3af533dfbd0f0e18638ebd211e6358a0Christian Maeder "/test/fry",
7857a35e3af533dfbd0f0e18638ebd211e6358a0Christian Maeder PILOT_IFACE,
7857a35e3af533dfbd0f0e18638ebd211e6358a0Christian Maeder PILOT_BLINK,
7830e8fa7442fb7452af7ecdba102bc297ae367eChristian Maeder &error,
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder DBUS_TYPE_INT32, &duration,
aa4d26536fffe0153cd81d28925985892ac2f300Christian Maeder DBUS_TYPE_INVALID);
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder ck_assert(reply != NULL);
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder ck_assert(!dbus_error_is_set(&error));
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder ck_assert(dbus_message_get_args(reply, NULL,
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder DBUS_TYPE_BOOLEAN, &crashed,
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder DBUS_TYPE_INVALID));
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder dbus_message_unref (reply);
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder ck_assert(crashed == FALSE);
bcd914850de931848b86d7728192a149f9c0108bChristian Maeder
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly talloc_free(ctx);
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'Reilly}
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'ReillyEND_TEST
580f1724640a78be687e79d0ec95dd2665e77e91Liam O'Reilly
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian MaederTCase *create_sbus_tests(void)
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder{
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder TCase *tc = tcase_create("tests");
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder tcase_add_test(tc, test_raw_handler);
f19dc06364e8d6ea36f7c170e1f7a0677de63184Liam O'Reilly
f21c7417bdd1c0282025cba0f5cb0ff5bc5c98eeLiam O'Reilly return tc;
f21c7417bdd1c0282025cba0f5cb0ff5bc5c98eeLiam O'Reilly}
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von SchroederSuite *create_suite(void)
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder{
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder Suite *s = suite_create("sbus");
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder suite_add_tcase(s, create_sbus_tests());
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder return s;
ee48a7a67da604356b665e51aa7545536a09b737Christian Maeder}
ee48a7a67da604356b665e51aa7545536a09b737Christian Maeder
d381ab99d6e2e56e09030577d65d9a118f246d35Christian Maederint main(int argc, const char *argv[])
d381ab99d6e2e56e09030577d65d9a118f246d35Christian Maeder{
ee48a7a67da604356b665e51aa7545536a09b737Christian Maeder int opt;
ee48a7a67da604356b665e51aa7545536a09b737Christian Maeder poptContext pc;
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder int failure_count;
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder Suite *suite;
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder SRunner *sr;
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'Reilly
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'Reilly struct poptOption long_options[] = {
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'Reilly POPT_AUTOHELP
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'Reilly POPT_TABLEEND
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'Reilly };
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'Reilly
580f1724640a78be687e79d0ec95dd2665e77e91Liam O'Reilly pc = poptGetContext(argv[0], argc, argv, long_options, 0);
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder while ((opt = poptGetNextOpt(pc)) != -1) {
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder switch (opt) {
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder default:
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder fprintf(stderr, "\nInvalid option %s: %s\n\n",
b1f12c962a6fb28a298b36cf6a1dcf2ad788fb58Christian Maeder poptBadOption(pc, 0), poptStrerror(opt));
7d96b1ef2b8597330aedee6713615ec15508edcfLiam O'Reilly poptPrintUsage(pc, stderr, 0);
7d96b1ef2b8597330aedee6713615ec15508edcfLiam O'Reilly return 1;
7d96b1ef2b8597330aedee6713615ec15508edcfLiam O'Reilly }
7d96b1ef2b8597330aedee6713615ec15508edcfLiam O'Reilly }
7d96b1ef2b8597330aedee6713615ec15508edcfLiam O'Reilly poptFreeContext(pc);
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'Reilly
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'Reilly suite = create_suite();
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'Reilly sr = srunner_create(suite);
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'Reilly srunner_set_fork_status(sr, CK_NOFORK);
f19dc06364e8d6ea36f7c170e1f7a0677de63184Liam O'Reilly /* If CK_VERBOSITY is set, use that, otherwise it defaults to CK_NORMAL */
f19dc06364e8d6ea36f7c170e1f7a0677de63184Liam O'Reilly srunner_run_all(sr, CK_ENV);
f19dc06364e8d6ea36f7c170e1f7a0677de63184Liam O'Reilly failure_count = srunner_ntests_failed(sr);
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'Reilly srunner_free(sr);
f19dc06364e8d6ea36f7c170e1f7a0677de63184Liam O'Reilly return (failure_count == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
bc350328e6ac2d9074317e222b4207a6aa49afeaLiam O'Reilly}
f19dc06364e8d6ea36f7c170e1f7a0677de63184Liam O'Reilly