Blame tests/TestCommon.h

Packit a4aae4
Packit a4aae4
// -*- mode: c++; c-basic-offset:4 -*-
Packit a4aae4
Packit a4aae4
// This file is part of libdap, A C++ implementation of the OPeNDAP Data
Packit a4aae4
// Access Protocol.
Packit a4aae4
Packit a4aae4
// Copyright (c) 2005 OPeNDAP, Inc.
Packit a4aae4
// Author: James Gallagher <jgallagher@opendap.org>
Packit a4aae4
//
Packit a4aae4
// This library is free software; you can redistribute it and/or
Packit a4aae4
// modify it under the terms of the GNU Lesser General Public
Packit a4aae4
// License as published by the Free Software Foundation; either
Packit a4aae4
// version 2.1 of the License, or (at your option) any later version.
Packit a4aae4
//
Packit a4aae4
// This library is distributed in the hope that it will be useful,
Packit a4aae4
// but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit a4aae4
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit a4aae4
// Lesser General Public License for more details.
Packit a4aae4
//
Packit a4aae4
// You should have received a copy of the GNU Lesser General Public
Packit a4aae4
// License along with this library; if not, write to the Free Software
Packit a4aae4
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit a4aae4
//
Packit a4aae4
// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
Packit a4aae4
Packit a4aae4
// An interface to new common methods for the Test*.cc/h classes.
Packit a4aae4
Packit a4aae4
#ifndef _test_common_h
Packit a4aae4
#define _test_common_h 1
Packit a4aae4
Packit a4aae4
// #include <stdio.h>
Packit a4aae4
#include <iostream>
Packit a4aae4
Packit a4aae4
class TestCommon {
Packit a4aae4
public:
Packit a4aae4
    TestCommon() { }
Packit a4aae4
    virtual ~TestCommon() { }
Packit a4aae4
Packit a4aae4
    /** Write out values. Does not test the read_p property first.
Packit a4aae4
Packit a4aae4
        @note This method is used to test the result of calling
Packit a4aae4
        intern_data().
Packit a4aae4
Packit a4aae4
        @param out Where to write the values */
Packit a4aae4
    virtual void output_values(std::ostream &out) = 0;
Packit a4aae4
Packit a4aae4
    /**
Packit a4aae4
     * Set the series_value property.
Packit a4aae4
     * @see get_series_values
Packit a4aae4
     * @param state True if the values returned by read() should mimic the DTS,
Packit a4aae4
     * false if they should be static.
Packit a4aae4
     */
Packit a4aae4
    virtual void set_series_values(bool state) = 0;
Packit a4aae4
Packit a4aae4
    /** Get the value of the series_value property. If true, the TestByte, ...,
Packit a4aae4
        classes should produce values that vary in a fashion similar to the DTS.
Packit a4aae4
        If false, they should exhibit the old behavior where the values are static.
Packit a4aae4
        For arrays, grids and structures the 'series_value' doesn't mean much, but
Packit a4aae4
        for sequences it's a big deal since those are constrained by value in
Packit a4aae4
        addition to by position. */
Packit a4aae4
    virtual bool get_series_values() = 0;
Packit a4aae4
};
Packit a4aae4
Packit a4aae4
#endif // _test_common_h
Packit a4aae4