KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_numeric_evaluator.cpp File Reference

Test suite for NUMERIC_EVALUATOR. More...

Go to the source code of this file.

Classes

struct  NUM_EVAL_FIXTURE
 
struct  EVAL_CASE
 Declares the struct as the Boost test fixture. More...
 
struct  EVAL_INVALID_CASE
 

Functions

 BOOST_AUTO_TEST_CASE (Basic)
 Basic class ops: set one up, trivial input, tear it down.
 
 BOOST_AUTO_TEST_CASE (SetVar)
 Check that getting/setting vars works.
 
 BOOST_AUTO_TEST_CASE (Results)
 Run through a set of test strings, clearing in between.
 
 BOOST_AUTO_TEST_CASE (UnicodeDegree)
 Test unicode parsing of the degree symbol.
 
 BOOST_AUTO_TEST_CASE (ResultsInvalid)
 Run through a set of invalid test strings, clearing in between.
 

Variables

static const std::vector< EVAL_CASEeval_cases_valid
 A list of valid test strings and the expected results.
 
static const std::vector< EVAL_INVALID_CASEeval_cases_invalid
 A list of invalid test strings.
 

Detailed Description

Test suite for NUMERIC_EVALUATOR.

Definition in file test_numeric_evaluator.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/5]

BOOST_AUTO_TEST_CASE ( Basic  )

Basic class ops: set one up, trivial input, tear it down.

Definition at line 62 of file test_numeric_evaluator.cpp.

◆ BOOST_AUTO_TEST_CASE() [2/5]

BOOST_AUTO_TEST_CASE ( Results  )

Run through a set of test strings, clearing in between.

Definition at line 164 of file test_numeric_evaluator.cpp.

References BOOST_TEST_CONTEXT, and eval_cases_valid.

◆ BOOST_AUTO_TEST_CASE() [3/5]

BOOST_AUTO_TEST_CASE ( ResultsInvalid  )

Run through a set of invalid test strings, clearing in between.

Definition at line 246 of file test_numeric_evaluator.cpp.

References BOOST_TEST_CONTEXT, and eval_cases_invalid.

◆ BOOST_AUTO_TEST_CASE() [4/5]

BOOST_AUTO_TEST_CASE ( SetVar  )

Check that getting/setting vars works.

Definition at line 71 of file test_numeric_evaluator.cpp.

◆ BOOST_AUTO_TEST_CASE() [5/5]

BOOST_AUTO_TEST_CASE ( UnicodeDegree  )

Test unicode parsing of the degree symbol.

Definition at line 189 of file test_numeric_evaluator.cpp.

References DEGREES.

Variable Documentation

◆ eval_cases_invalid

const std::vector<EVAL_INVALID_CASE> eval_cases_invalid
static
Initial value:
= {
{ "1+" },
{ "*2 + 1" },
{ "1 2" },
{ "(1)(2)" },
{ "1 $ 2" },
{ "(1 + 2" },
{ "1 + 2)" },
{ "sdfsdf sdfsd" },
{ "1 / 0" },
{ "1 + unknown" },
{ ";" },
{ ";1" },
{ ";1;" },
}

A list of invalid test strings.

Definition at line 218 of file test_numeric_evaluator.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ eval_cases_valid

const std::vector<EVAL_CASE> eval_cases_valid
static

A list of valid test strings and the expected results.

Definition at line 111 of file test_numeric_evaluator.cpp.

Referenced by BOOST_AUTO_TEST_CASE().