Skip to content
Permalink
Browse files
Revert "kunit: move string-stream.h to lib/kunit"
This reverts commit 109fb06.

string-stream will be used by kunit mocking code to print messages about
mock expectations.
It makes the code signifcantly simpler if string-stream objects can be
part of structs declared in mocking headers.

Signed-off-by: Daniel Latypov <dlatypov@google.com>
  • Loading branch information
dlatypov authored and intel-lab-lkp committed Oct 12, 2020
1 parent 10b82d5 commit d69578f4d0c866b86936aace570ecc5cc7f4c505
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 9 deletions.
@@ -9,11 +9,10 @@
#ifndef _KUNIT_ASSERT_H
#define _KUNIT_ASSERT_H

#include <kunit/string-stream.h>
#include <linux/err.h>
#include <linux/kernel.h>

struct kunit;
struct string_stream;

/**
* enum kunit_assert_type - Type of expectation/assertion.
File renamed without changes.
@@ -8,8 +8,6 @@
#include <kunit/assert.h>
#include <kunit/test.h>

#include "string-stream.h"

void kunit_base_assert_format(const struct kunit_assert *assert,
struct string_stream *stream)
{
@@ -6,11 +6,10 @@
* Author: Brendan Higgins <brendanhiggins@google.com>
*/

#include <kunit/string-stream.h>
#include <kunit/test.h>
#include <linux/slab.h>

#include "string-stream.h"

static void string_stream_test_empty_on_creation(struct kunit *test)
{
struct string_stream *stream = alloc_string_stream(test, GFP_KERNEL);
@@ -6,12 +6,11 @@
* Author: Brendan Higgins <brendanhiggins@google.com>
*/

#include <kunit/string-stream.h>
#include <kunit/test.h>
#include <linux/list.h>
#include <linux/slab.h>

#include "string-stream.h"

struct string_stream_fragment_alloc_context {
struct kunit *test;
int len;
@@ -7,12 +7,12 @@
*/

#include <kunit/test.h>
#include <kunit/string-stream.h>
#include <linux/kernel.h>
#include <linux/kref.h>
#include <linux/sched/debug.h>

#include "debugfs.h"
#include "string-stream.h"
#include "try-catch-impl.h"

static void kunit_set_failure(struct kunit *test)

0 comments on commit d69578f

Please sign in to comment.