ifcfg-rh/tests: refactor and cleanup ifcfg-rh unit tests

"test-ifcfg-rh.c" is huge, with lots of repeated, verbose code.
Refactor the code by using some helper macros so that the line noise
is smaller and we can easier see what is happening.

- use nmtst_connection_assert_setting() instead of
  nm_connection_get_setting*(), followed by an assertion.

- use _nm_connection_new_setting() instead of multiple lines to
  create and add the setting.

- drop all explicit unref/free and use cleanup macro.

- unify some variable names.

- drop some useless comments. In particular, comments were used as
  visual separators because the code is verbose and hard to read. The
  solution to verbose and hard to read is not more code/comments, the
  solution is clearer, conciser code.
This commit is contained in:
Thomas Haller 2021-08-26 18:15:23 +02:00
parent f30def0e00
commit 556d76d570
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

File diff suppressed because it is too large Load diff