kunit: string-stream: Add tests for freeing resource-managed string_stream
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Mon, 28 Aug 2023 10:41:09 +0000 (11:41 +0100)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 18 Sep 2023 16:45:46 +0000 (10:45 -0600)
commitd1a0d699bfc00ae5b5e74bb640d791a93e825b68
treeb6ca201f1eead78e9eb73a7ce00c5ce1061c0c44
parenta3fdf784780ccb0008d630e8722d1389c49c7499
kunit: string-stream: Add tests for freeing resource-managed string_stream

string_stream_managed_free_test() allocates a resource-managed
string_stream and tests that kunit_free_string_stream() calls
string_stream_destroy().

string_stream_resource_free_test() allocates a resource-managed
string_stream and tests that string_stream_destroy() is called
when the test resources are cleaned up.

The old string_stream_init_test() has been split into two tests,
one for kunit_alloc_string_stream() and the other for
alloc_string_stream().

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
lib/kunit/string-stream-test.c
lib/kunit/string-stream.c