MCPcopy Create free account
hub / github.com/ArashPartow/exprtk / run_test18

Function run_test18

exprtk_test.cpp:6485–8476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6483
6484template <typename T>
6485bool run_test18()
6486{
6487 {
6488 exprtk::symbol_table<T> symbol_table;
6489 symbol_table.remove_variable("x",true);
6490 symbol_table.remove_variable("x",false);
6491 symbol_table.remove_stringvar("x");
6492 symbol_table.remove_function("x");
6493 symbol_table.remove_vararg_function("x");
6494 symbol_table.remove_vector("x");
6495 }
6496
6497 {
6498 exprtk::symbol_table<T> symbol_table;
6499
6500 {
6501 T x;
6502 const bool result1 = symbol_table.add_variable("x", x);
6503 const bool result2 = symbol_table.remove_variable("x");
6504 const bool result3 = symbol_table.remove_variable("x");
6505
6506 if (!result1 || !result2 || result3)
6507 {
6508 printf("run_test18() - Failed sym_tab add/remove [1]\n");
6509 }
6510 }
6511
6512 {
6513 std::string x;
6514 const bool result1 = symbol_table.add_stringvar("x", x);
6515 const bool result2 = symbol_table.remove_stringvar("x");
6516 const bool result3 = symbol_table.remove_stringvar("x");
6517
6518 if (!result1 || !result2 || result3)
6519 {
6520 printf("run_test18() - Failed sym_tab add/remove [2]\n");
6521 }
6522 }
6523
6524 {
6525 std::vector<T> x(10,T(0));
6526 const bool result1 = symbol_table.add_vector("x", x);
6527 const bool result2 = symbol_table.remove_vector("x");
6528 const bool result3 = symbol_table.remove_vector("x");
6529
6530 if (!result1 || !result2 || result3)
6531 {
6532 printf("run_test18() - Failed sym_tab add/remove [3]\n");
6533 }
6534 }
6535
6536 {
6537 myfunc<T> x;
6538 const bool result1 = symbol_table.add_function("x", x);
6539 const bool result2 = symbol_table.remove_function("x");
6540 const bool result3 = symbol_table.remove_function("x");
6541
6542 if (!result1 || !result2 || result3)

Callers

nothing calls this directly

Calls 3

not_equalFunction · 0.85
test_result_tClass · 0.85
valueMethod · 0.45

Tested by

no test coverage detected