Commit 786a8176 authored by Roland Levillain's avatar Roland Levillain
Browse files

Fix access to images in tests.

	* tests/data.hh: New file.
	* tests/io_pnm: Include it.
	(main): Use rdata to compute the path to loaded images.
	* tests/window2d.cc: Likewise.
	Add copyright header.
	* tests/Makefile.am (AM_CPPFLAGS): Add -I$(srcdir)/check and
	-DOLN_IMG_DIR=\"$(top_srcdir)/olena/img\".
	(noinst_HEADERS): New.
	Add data.hh
	* tests/check/Makefile.am (EXTRA_DIST): Add Makefile.flags.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@631 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 63a3fc78
2006-10-12 Roland Levillain <roland@lrde.epita.fr>
Fix access to images in tests.
* tests/data.hh: New file.
* tests/io_pnm: Include it.
(main): Use rdata to compute the path to loaded images.
* tests/window2d.cc: Likewise.
Add copyright header.
* tests/Makefile.am (AM_CPPFLAGS): Add -I$(srcdir)/check and
-DOLN_IMG_DIR=\"$(top_srcdir)/olena/img\".
(noinst_HEADERS): New.
Add data.hh
* tests/check/Makefile.am (EXTRA_DIST): Add Makefile.flags.
2006-10-12 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr>
Add image accessors with indices.
......
......@@ -2,9 +2,13 @@
SUBDIRS = check sanity
# FIXME: Revamp (see Olena 0.10's test suite).
AM_CPPFLAGS = \
-I$(srcdir)/check \
-I$(top_srcdir)/olena -I$(top_srcdir)/extended \
-I$(top_srcdir)/static -I$(top_srcdir)/metalic
-I$(top_srcdir)/static -I$(top_srcdir)/metalic \
-DOLN_IMG_DIR=\"$(top_srcdir)/olena/img\"
# FIXME: Add
#
......@@ -16,6 +20,7 @@ AM_CPPFLAGS = \
TESTS_CXXFLAGS = @TESTS_CXXFLAGS@
CXXFLAGS += $(TESTS_CXXFLAGS)
noinst_HEADERS = data.hh
check_PROGRAMS = \
dpoint2d \
......
## Process this file through Automake to create Makefile.in -*- Makefile -*-
# FIXME: To be enabled when the test suite mechanism is available.
## FIXME: To be (fully) enabled when the test suite mechanism is available.
# include Makefile.flags
# AM_CPPFLAGS += -DCXX=\""$(CXX)"\" \
# AM_CPPFLAGS +=
# -DCXX=\""$(CXX)"\" \
# -DCPPFLAGS=\""$(CPPFLAGS)"\" \
# -DCXXFLAGS=\""$(CXXFLAGS)"\" \
# -DOLN_EXTRA_CPPFLAGS=\""$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS)"\" \
......@@ -30,5 +31,4 @@
# data.cc \
# $(COMMON_CHECK_SOURCES)
# EXTRA_DIST = Makefile.flags Makefile.check Makefile.runtests
EXTRA_DIST = Makefile.flags # Makefile.check Makefile.runtests
// FIXME: Should be compiled in libolncheck, as in Olena 0.10.
// (This is temporary.)
#ifndef OLN_TESTS_DATA_HH
# define OLN_TESTS_DATA_HH
#include <iostream>
std::string
rdata(const std::string& file)
{
return OLN_IMG_DIR "/" + file;
}
#endif // ! OLN_TESTS_DATA_HH
......@@ -28,12 +28,15 @@
/// Test oln::io_pnm.cc.
#include <cassert>
#include <oln/basics2d.hh>
#include <oln/io/pnm.hh>
#include "data.hh"
int
main()
{
oln::image2d<bool> ima = oln::io::load_pbm("../img/chien.pbm");
oln::image2d<unsigned char> ima2 = oln::io::load_pgm("../img/lena32.pgm");
oln::image2d<bool> ima = oln::io::load_pbm(rdata("chien.pbm"));
oln::image2d<unsigned char> ima2 = oln::io::load_pgm(rdata("lena32.pgm"));
}
// Copyright (C) 2006 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License version 2 as published by the
// Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING. If not, write to
// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
// Boston, MA 02111-1307, USA.
//
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
/// Test oln::window2d.
#include <oln/basics2d.hh>
#include <oln/debug/print.hh>
#include <oln/io/pnm.hh>
#include <oln/morpher/add_neighborhood.hh>
#include "data.hh"
namespace test
{
......@@ -29,7 +59,7 @@ int main()
{
using namespace oln;
image2d<unsigned char> ima = io::load_pgm("../img/lena32.pgm");
image2d<unsigned char> ima = io::load_pgm(rdata("lena32.pgm"));
debug::println(ima);
window2d win;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment