Skip to content

Commit 109fb06

Browse files
alan-maguireshuahkh
authored andcommitted
kunit: move string-stream.h to lib/kunit
string-stream interfaces are not intended for external use; move them from include/kunit to lib/kunit accordingly. Co-developed-by: Knut Omang <[email protected]> Signed-off-by: Knut Omang <[email protected]> Signed-off-by: Alan Maguire <[email protected]> Reviewed-by: Brendan Higgins <[email protected]> Tested-by: Brendan Higgins <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 4d944bc commit 109fb06

File tree

6 files changed

+10
-3
lines changed

6 files changed

+10
-3
lines changed

include/kunit/assert.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
#ifndef _KUNIT_ASSERT_H
1010
#define _KUNIT_ASSERT_H
1111

12-
#include <kunit/string-stream.h>
1312
#include <linux/err.h>
13+
#include <linux/kernel.h>
1414

1515
struct kunit;
16+
struct string_stream;
1617

1718
/**
1819
* enum kunit_assert_type - Type of expectation/assertion.

lib/kunit/assert.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*/
88
#include <kunit/assert.h>
99

10+
#include "string-stream.h"
11+
1012
void kunit_base_assert_format(const struct kunit_assert *assert,
1113
struct string_stream *stream)
1214
{

lib/kunit/string-stream-test.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
* Author: Brendan Higgins <[email protected]>
77
*/
88

9-
#include <kunit/string-stream.h>
109
#include <kunit/test.h>
1110
#include <linux/slab.h>
1211

12+
#include "string-stream.h"
13+
1314
static void string_stream_test_empty_on_creation(struct kunit *test)
1415
{
1516
struct string_stream *stream = alloc_string_stream(test, GFP_KERNEL);

lib/kunit/string-stream.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
* Author: Brendan Higgins <[email protected]>
77
*/
88

9-
#include <kunit/string-stream.h>
109
#include <kunit/test.h>
1110
#include <linux/list.h>
1211
#include <linux/slab.h>
1312

13+
#include "string-stream.h"
14+
1415
struct string_stream_fragment_alloc_context {
1516
struct kunit *test;
1617
int len;
File renamed without changes.

lib/kunit/test.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <linux/kernel.h>
1212
#include <linux/sched/debug.h>
1313

14+
#include "string-stream.h"
15+
1416
static void kunit_set_failure(struct kunit *test)
1517
{
1618
WRITE_ONCE(test->success, false);

0 commit comments

Comments
 (0)