Skip to content

Commit 1a1926a

Browse files
committed
libutil/test: update formatting in stdlog tests
Problem: The stdlog unit tests predate many Flux code formatting conventions. Many lines exceed 80 characters and/or are inconsistently split across lines. Update formatting of this unit test for consistency and readability.
1 parent 0fe4de3 commit 1a1926a

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

src/common/libutil/test/stdlog.c

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,28 +127,41 @@ int main(int argc, char** argv)
127127
"stdlog_decode decoded procid") ;
128128
ok (streq (hdr.msgid, cln.msgid),
129129
"stdlog_decode decoded msgid") ;
130-
ok (sdlen == strlen (STDLOG_NILVALUE) && strncmp (sd, STDLOG_NILVALUE, sdlen) == 0,
130+
ok (sdlen == strlen (STDLOG_NILVALUE)
131+
&& strncmp (sd, STDLOG_NILVALUE, sdlen) == 0,
131132
"stdlog_decode decoded structured data");
132-
ok (msglen == strlen (STDLOG_NILVALUE) && strncmp (msg, STDLOG_NILVALUE, msglen) == 0,
133+
ok (msglen == strlen (STDLOG_NILVALUE)
134+
&& strncmp (msg, STDLOG_NILVALUE, msglen) == 0,
133135
"stdlog_decode decoded message");
134136

135137
/* Check that trailing \n or \r in message are dropped
136138
*/
137139
stdlog_init (&hdr);
138-
len = stdlog_encode (buf, sizeof (buf), &hdr,
140+
len = stdlog_encode (buf,
141+
sizeof (buf),
142+
&hdr,
139143
STDLOG_NILVALUE,
140144
"Hello whorl\n\r\n");
141145
ok (len >= 0,
142146
"stdlog_encode worked with message");
143147
diag ("%.*s", len, buf);
144148
n = stdlog_decode (buf, len, &hdr, &sd, &sdlen, &msg, &msglen);
145-
ok (n == 0 && strncmp (msg, "Hello whorl", msglen) == 0,
149+
ok (n == 0
150+
&& strncmp (msg, "Hello whorl", msglen) == 0,
146151
"trailing cr/lf chars were truncated");
147152

148153
int i = 0;
149154
while (valid[i] != NULL) {
150-
n = stdlog_decode (valid[i], strlen (valid[i]), &hdr, &sd, &sdlen, &msg, &msglen);
151-
ok (n == 0 && msglen == strlen ("message") && strncmp (msg, "message", msglen) == 0,
155+
n = stdlog_decode (valid[i],
156+
strlen (valid[i]),
157+
&hdr,
158+
&sd,
159+
&sdlen,
160+
&msg,
161+
&msglen);
162+
ok (n == 0
163+
&& msglen == strlen ("message")
164+
&& strncmp (msg, "message", msglen) == 0,
152165
"successfully decoded %s", valid[i]);
153166
i++;
154167
}

0 commit comments

Comments
 (0)