IODA Bundle
TestSelectStarAt.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 #include "odc/Select.h"
17 
18 #include "TestCase.h"
19 
20 using namespace std;
21 using namespace eckit;
22 using namespace odc;
23 
24 /// UnitTest expansion of '*@hdr' into a list of columns of the hdr ODB table.
25 ///
26 static void test()
27 {
28  // TODO: make sure a 'select ... into ... from ...', e.g.:
29  //
30  // const string SELECT = "select *@hdr into \"out.odb\" from \"2000010106.odb\";";
31  // is not returning a result set (iterator). Or perhaps it is returning an empty result set.
32 
33  const string SELECT = "select *@hdr from \"2000010106.odb\";";
34 
35  odc::Select oda(SELECT);
36 
37  Log::info() << "Executing: '" << SELECT << "'" << std::endl;
38  odc::Select::iterator it = oda.begin();
39 
40  Log::info() << "it->columns().size() => " << it->columns().size() << std::endl;
41  ASSERT(it->columns().size() == 27);
42 
43 #if 0
44  unsigned long long i = 0;
45  for ( ; it != oda.end(); ++it)
46  ++i;
47 
48  Log::info() << "i == " << i << std::endl;
49  ASSERT(i == 3321753);
50 #endif
51 }
52 
53 
54 
55 static void setUp(){}
56 static void tearDown(){}
57 
58 SIMPLE_TEST(SelectStarAt)
void oda
#define SIMPLE_TEST(name)
Definition: TestCase.h:66
static void tearDown()
static void test()
static void setUp()
const core::MetaData & columns() const
Definition: IteratorProxy.h:94
Definition: ColumnInfo.h:23
Definition: encode.cc:30