testElementFormula.hh

Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include "basics/testcase.hh"
11 #include "space/element.hh"
12 
13 namespace concepts {
14 
15  // forward declarations
16  template<class F, uint dim>
17  class Point;
18 }
19 
20 namespace test {
21 
22  // ************************************************************** Container **
23 
24  template<class F = concepts::Real>
26  public:
28  : i_(i) {}
29 
31  return i_;
32  }
33  protected:
34  virtual std::ostream& info(std::ostream& os) const {
35  os << "Container(";
36  if (!i_.empty())
37  os << i_;
38  else os << "0";
39  return os << ")";
40  }
41  private:
43  };
44 
45 
46  // ***************************************************** ElementFormulaTest **
47 
52  class ElementFormulaTest : public TestCase {
53  public:
54  virtual ~ElementFormulaTest() {}
55  virtual void run();
56 
58 
61 
64 
67 
70 
72 
73  template<class F>
74  void testContainer(const char* s,
75  const concepts::RCP<Container<F> > cnt, F ref);
76 
77  template<class F>
78  void testContainer(const char* s,
80  const concepts::Point<F,2> ref);
81  };
82 
83 } // namespace test
84 
85 
const concepts::ElementFormula< F > & frm() const
Base class for tests.
Definition: testcase.hh:92
virtual void run()
Runs the tests. Must be overwritten by the specialization.
Test for element formulas.
const concepts::ElementFormulaContainer< F > i_
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Container(const concepts::ElementFormulaContainer< F > i)
Unit tests.
Definition: testcase.hh:66
bool empty() const
Returns true if no formula is stored.
void testVectorSumElementFormula()
test for SumElementFormula for vector element formulas
void testSumElementFormula()
test for SumElementFormula
void testContainer(const char *s, const concepts::RCP< Container< F > > cnt, F ref)
test for VectorElementFormula
void testProductElementFormula()
test for ProductElementFormula
void testVectorElementFormula()
test for VectorElementFormula
Reference-counting pointer.
Definition: bf_iddiv.hh:15
void testContainer(const char *s, const concepts::RCP< Container< concepts::Point< F, 2 > > > cnt, const concepts::Point< F, 2 > ref)
test for VectorElementFormula
Class providing an output operator.
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich