Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
dart::TestCaseBase Class Referenceabstract

#include <unit_test.h>

Inheritance diagram for dart::TestCaseBase:
dart::RawTestCase dart::TestCase

Public Member Functions

 TestCaseBase (const char *name, const char *expectation)
 
virtual ~TestCaseBase ()
 
const char * name () const
 
const char * expectation () const
 
virtual void Run ()=0
 
void RunTest ()
 

Static Public Member Functions

static void RunAll ()
 
static void RunAllRaw ()
 
static void CleanupState ()
 
static void AddToKernelBuffers (const uint8_t *kernel_buffer)
 

Protected Attributes

bool raw_test_
 

Static Protected Attributes

static KernelBufferListcurrent_kernel_buffers_ = nullptr
 

Detailed Description

Definition at line 285 of file unit_test.h.

Constructor & Destructor Documentation

◆ TestCaseBase()

dart::TestCaseBase::TestCaseBase ( const char *  name,
const char *  expectation 
)
explicit

Definition at line 59 of file unit_test.cc.

60 : raw_test_(false),
61 next_(nullptr),
62 name_(name),
63 expectation_(strlen(expectation) > 0 ? expectation : "Pass") {
64 if (first_ == nullptr) {
65 first_ = this;
66 } else {
67 tail_->next_ = this;
68 }
69 tail_ = this;
70}
const char * expectation() const
Definition: unit_test.h:291
const char * name() const
Definition: unit_test.h:290

◆ ~TestCaseBase()

virtual dart::TestCaseBase::~TestCaseBase ( )
inlinevirtual

Definition at line 288 of file unit_test.h.

288{}

Member Function Documentation

◆ AddToKernelBuffers()

void dart::TestCaseBase::AddToKernelBuffers ( const uint8_t *  kernel_buffer)
static

Definition at line 101 of file unit_test.cc.

101 {
102 ASSERT(kernel_buffer != nullptr);
103 if (current_kernel_buffers_ == nullptr) {
104 current_kernel_buffers_ = new KernelBufferList(kernel_buffer);
105 } else {
107 }
108}
void AddBufferToList(const uint8_t *kernel_buffer)
Definition: unit_test.cc:50
static KernelBufferList * current_kernel_buffers_
Definition: unit_test.h:302
#define ASSERT(E)

◆ CleanupState()

void dart::TestCaseBase::CleanupState ( )
static

Definition at line 94 of file unit_test.cc.

94 {
95 if (current_kernel_buffers_ != nullptr) {
98 }
99}

◆ expectation()

const char * dart::TestCaseBase::expectation ( ) const
inline

Definition at line 291 of file unit_test.h.

291{ return expectation_; }

◆ name()

const char * dart::TestCaseBase::name ( ) const
inline

Definition at line 290 of file unit_test.h.

290{ return name_; }

◆ Run()

virtual void dart::TestCaseBase::Run ( )
pure virtual

Implemented in dart::TestCase, and dart::RawTestCase.

◆ RunAll()

void dart::TestCaseBase::RunAll ( )
static

Definition at line 83 of file unit_test.cc.

83 {
84 TestCaseBase* test = first_;
85 while (test != nullptr) {
86 if (!test->raw_test_) {
87 test->RunTest();
89 }
90 test = test->next_;
91 }
92}
static void CleanupState()
Definition: unit_test.cc:94
TestCaseBase(const char *name, const char *expectation)
Definition: unit_test.cc:59

◆ RunAllRaw()

void dart::TestCaseBase::RunAllRaw ( )
static

Definition at line 72 of file unit_test.cc.

72 {
73 TestCaseBase* test = first_;
74 while (test != nullptr) {
75 if (test->raw_test_) {
76 test->RunTest();
78 }
79 test = test->next_;
80 }
81}

◆ RunTest()

void dart::TestCaseBase::RunTest ( )

Definition at line 63 of file run_vm_tests.cc.

63 {
64 if (strcmp(run_filter, this->name()) == 0) {
65 this->Run();
67 } else if (run_filter == kList) {
68 Syslog::Print("%s %s\n", this->name(), this->expectation());
70 }
71}
static void Print(const char *format,...) PRINTF_ATTRIBUTE(1
virtual void Run()=0
static int run_matches
Definition: run_vm_tests.cc:49
static const char * run_filter
Definition: run_vm_tests.cc:46
static constexpr const char * kList
Definition: run_vm_tests.cc:44

Member Data Documentation

◆ current_kernel_buffers_

KernelBufferList * dart::TestCaseBase::current_kernel_buffers_ = nullptr
staticprotected

Definition at line 302 of file unit_test.h.

◆ raw_test_

bool dart::TestCaseBase::raw_test_
protected

Definition at line 303 of file unit_test.h.


The documentation for this class was generated from the following files: