]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
tests: Add unit tests for cgroup_parse_rules_options()
authorTom Hromatka <tom.hromatka@oracle.com>
Mon, 4 Nov 2019 23:15:32 +0000 (23:15 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 12 Dec 2019 22:10:28 +0000 (15:10 -0700)
commitf723a4b0d99868b5193202c34f5397dee84c3df6
tree44af40914f4b704b2600ddca46e43352d7827d51
parentfbb0489a4780258aa577b9d08274eb0772292d70
tests: Add unit tests for cgroup_parse_rules_options()

The following tests are in this commit:

RulesOptions_Ignore() - The valid option "ignore" is tested

RulesOptions_IgnoreWithComma() - The valid (but syntactically
    strange) option "ignore," is tested

RulesOptions_InvalidOption() - An invalid option is tested

RulesOptions_InvalidOption2() - An invalid option along with
    a valid option is tested

RulesOptions_EmptyOptions() - An empty string is tested

RulesOptions_NullOptions() - A null-pointer option string is
    tested

The results from googletest are reported below:

[----------] 6 tests from ParseRulesOptionsTest
[ RUN      ] ParseRulesOptionsTest.RulesOptions_Ignore
[       OK ] ParseRulesOptionsTest.RulesOptions_Ignore (0 ms)
[ RUN      ] ParseRulesOptionsTest.RulesOptions_IgnoreWithComma
[       OK ] ParseRulesOptionsTest.RulesOptions_IgnoreWithComma (0 ms)
[ RUN      ] ParseRulesOptionsTest.RulesOptions_InvalidOption
[       OK ] ParseRulesOptionsTest.RulesOptions_InvalidOption (0 ms)
[ RUN      ] ParseRulesOptionsTest.RulesOptions_InvalidOption2
[       OK ] ParseRulesOptionsTest.RulesOptions_InvalidOption2 (0 ms)
[ RUN      ] ParseRulesOptionsTest.RulesOptions_EmptyOptions
[       OK ] ParseRulesOptionsTest.RulesOptions_EmptyOptions (0 ms)
[ RUN      ] ParseRulesOptionsTest.RulesOptions_NullOptions
[       OK ] ParseRulesOptionsTest.RulesOptions_NullOptions (0 ms)
[----------] 6 tests from ParseRulesOptionsTest (0 ms total)

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/api.c
src/libcgroup-internal.h
tests/gunit/002-cgroup_parse_rules_options.cpp [new file with mode: 0644]
tests/gunit/Makefile.am