Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 58 of file unit_test.cc.

59 : raw_test_(false),
60 next_(nullptr),
61 name_(name),
62 expectation_(strlen(expectation) > 0 ? expectation : "Pass") {
63 if (first_ == nullptr) {
64 first_ = this;
65 } else {
66 tail_->next_ = this;
67 }
68 tail_ = this;
69}
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 100 of file unit_test.cc.

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

◆ CleanupState()

void dart::TestCaseBase::CleanupState ( )
static

Definition at line 93 of file unit_test.cc.

93 {
94 if (current_kernel_buffers_ != nullptr) {
97 }
98}

◆ 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 82 of file unit_test.cc.

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

◆ RunAllRaw()

void dart::TestCaseBase::RunAllRaw ( )
static

Definition at line 71 of file unit_test.cc.

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

◆ 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
static const char * run_filter
static constexpr const char * kList

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: