[systemd-devel] [PATCH] Added test for unit file state returned by unit_file_get_state and unit_file_get_list.
Ken Sedgwick
ksedgwic at bonsai.com
Sun Oct 5 15:49:31 PDT 2014
Will do.
Ken
On Sun, Oct 5, 2014 at 2:27 PM, Zbigniew Jędrzejewski-Szmek <
zbyszek at in.waw.pl> wrote:
> On Fri, Oct 03, 2014 at 04:03:14PM -0700, Ken Sedgwick wrote:
> > +const char *subdir = "/test-enabled-root";
> > +char root_dir[UNIT_NAME_MAX + 2 + 1] = TEST_DIR;
> > +
> > +#define confirm_unit_state(unit, expected)
> \
> > + assert_se(unit_file_get_state(UNIT_FILE_SYSTEM, root_dir,
> > unit) == expected)
> > +
> > +static void test_enabled(int argc, char* argv[]) {
> > + Hashmap *h;
> > + UnitFileList *p;
> > + Iterator i;
> > + int r;
> > +
> > + strncat(root_dir, subdir, strlen(subdir));
>
> This is safe, but ungainly. Why not just:
>
> const char *root_dir;
>
> root_dir = strappenda(TEST_DIR, "/test-enabled-root");
>
> Test looks useful, but like David wrote, can you please remove the
> non-essential
> bits from the service files?
>
> Zbyszek
>
--
Ken Sedgwick
Bonsai Software, Inc.
http://www.bonsai.com/ken/
(510) 269-7334
ken at bonsai.com
Public Key: http://www.bonsai.com/ken/ken.asc
GPG Fingerprint: 851E 3B07 E586 0843 9434 5CC7 4033 3B9B 3F3F 9640
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20141005/9e3276bf/attachment.html>
More information about the systemd-devel
mailing list