//
// Automated Testing Framework (atf)
//
// Copyright (c) 2007 The NetBSD Foundation, Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
//
// THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
// CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
// IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
extern "C" {
#include <fcntl.h>
#include <unistd.h>
}
#include <fstream>
#include <sstream>
#include "macros.hpp"
#include "detail/parser.hpp"
#include "detail/test_helpers.hpp"
// ------------------------------------------------------------------------
// Tests for the "atf_tp_writer" class.
// ------------------------------------------------------------------------
static
void
{
}
// XXX Should this string handling and verbosity level be part of the
// ATF_REQUIRE_EQ macro? It may be hard to predict sometimes that a
// string can have newlines in it, and so the error message generated
// at the moment will be bogus if there are some.
static
void
{
"Adding >> and << to delimit the string boundaries below.\n";
}
}
{
}
{
#define RESET \
#define CHECK \
{
expss << "Content-Type: application/X-atf-tp; version=\"1\"\n\n";
}
{
expss << "Content-Type: application/X-atf-tp; version=\"1\"\n\n";
w.start_tc("test1");
expss << "ident: test1\n";
w.end_tc();
}
{
expss << "Content-Type: application/X-atf-tp; version=\"1\"\n\n";
w.start_tc("test1");
expss << "ident: test1\n";
w.end_tc();
w.start_tc("test2");
expss << "\nident: test2\n";
w.end_tc();
}
{
expss << "Content-Type: application/X-atf-tp; version=\"1\"\n\n";
w.start_tc("test1");
expss << "ident: test1\n";
expss << "descr: the description\n";
w.end_tc();
w.start_tc("test2");
expss << "\nident: test2\n";
expss << "descr: second test case\n";
expss << "X-custom: foo bar baz\n";
w.end_tc();
}
}
// ------------------------------------------------------------------------
// Tests cases for the header file.
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// Main.
// ------------------------------------------------------------------------
{
// Add tests for the "atf_tp_writer" class.
// Add the test cases for the header file.
ATF_ADD_TEST_CASE(tcs, include);
}