IODA Bundle
TestMetaData.cc
Go to the documentation of this file.
1 /*
2  * (C) Copyright 1996-2012 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
11 /// \file UnitTest.h
12 ///
13 /// @author Piotr Kuchta, ECMWF, Feb 2009
14 
15 #include "odc/core/MetaData.h"
16 
17 #include "TestCase.h"
18 
19 using namespace std;
20 using namespace eckit;
21 using namespace odc;
22 using namespace odc::core;
23 
24 static void test()
25 {
26  MetaData md1(0);
27  md1.addColumn /*<DS>*/("A", "REAL");//, false, 0.);
28  md1.addColumn /*<DS>*/("B", "INTEGER");//, false, 0.);
29 
30  Log::info() << "md1: " << std::endl << md1 << std::endl;
31 
32  MetaData md2(0);
33  md2.addColumn /*<DS> */("C", "STRING");//, false, 0.);
34 
35  Log::info() << "md2:" << std::endl << md2 << std::endl;
36 
37  MetaData sum = md1 + md2;
38  Log::info() << "md1 + md2: " << std::endl << sum << std::endl;
39 
40  ASSERT(sum.size() == md1.size() + md2.size());
41  ASSERT(sum == md1 + md2);
42 
43  MetaData sum2 = md1;
44  sum2 += md2;
45 
46  ASSERT(sum2.size() == md1.size() + md2.size());
47  ASSERT(sum == sum2);
48 }
49 
50 
51 static void setUp(){}
52 static void tearDown(){}
53 
#define SIMPLE_TEST(name)
Definition: TestCase.h:66
static void tearDown()
Definition: TestMetaData.cc:52
static void test()
Definition: TestMetaData.cc:24
static void setUp()
Definition: TestMetaData.cc:51
MetaData & addColumn(const std::string &name, const std::string &type)
Definition: MetaData.cc:279
Definition: ColumnInfo.h:23
Definition: encode.cc:30