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

#include <unit_test.h>

Inheritance diagram for dart::compiler::ffi::TestCaseBase:
dart::compiler::ffi::RawTestCase

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 Public Attributes

static bool update_expectations = false
 

Detailed Description

Definition at line 49 of file unit_test.h.

Constructor & Destructor Documentation

◆ TestCaseBase()

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

Definition at line 35 of file run_ffi_unit_tests.cc.

36 : next_(nullptr), name_(name), expectation_(expectation) {
37 ASSERT(strlen(expectation) > 0);
38 if (first_ == nullptr) {
39 first_ = this;
40 } else {
41 tail_->next_ = this;
42 }
43 tail_ = this;
44}
const char * name() const
Definition: unit_test.h:54
const char * expectation() const
Definition: unit_test.h:55
#define ASSERT(E)

◆ ~TestCaseBase()

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

Definition at line 52 of file unit_test.h.

52{}

Member Function Documentation

◆ expectation()

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

Definition at line 55 of file unit_test.h.

55{ return expectation_; }

◆ name()

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

Definition at line 54 of file unit_test.h.

54{ return name_; }

◆ Run()

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

◆ RunAll()

void dart::compiler::ffi::TestCaseBase::RunAll ( )
static

Definition at line 46 of file run_ffi_unit_tests.cc.

46 {
47 TestCaseBase* test = first_;
48 while (test != nullptr) {
49 test->RunTest();
50 test = test->next_;
51 }
52}
TestCaseBase(const char *name, const char *expectation)

◆ RunAllRaw()

static void dart::compiler::ffi::TestCaseBase::RunAllRaw ( )
static

◆ RunTest()

void dart::compiler::ffi::TestCaseBase::RunTest ( )

Definition at line 54 of file run_ffi_unit_tests.cc.

54 {
55 if (run_filter == kList) {
56 Syslog::Print("%s %s\n", this->name(), this->expectation());
58 } else if (run_filter == kAll) {
59 this->Run();
61 } else if (strcmp(run_filter, this->name()) == 0) {
62 this->Run();
64 }
65}
static void Print(const char *format,...) PRINTF_ATTRIBUTE(1
static constexpr const char * kAll
static const char * run_filter
static constexpr const char * kList

Member Data Documentation

◆ update_expectations

bool dart::compiler::ffi::TestCaseBase::update_expectations = false
static

Definition at line 63 of file unit_test.h.


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