1.1 --- a/src/test/error_test.cc Sat May 21 21:04:57 2005 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,65 +0,0 @@
1.4 -/* -*- C++ -*-
1.5 - * src/test/error_test.cc - Part of LEMON, a generic C++ optimization library
1.6 - *
1.7 - * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
1.8 - * (Egervary Research Group on Combinatorial Optimization, EGRES).
1.9 - *
1.10 - * Permission to use, modify and distribute this software is granted
1.11 - * provided that this copyright notice appears in all copies. For
1.12 - * precise terms see the accompanying LICENSE file.
1.13 - *
1.14 - * This software is provided "AS IS" with no warranty of any kind,
1.15 - * express or implied, and with no claim as to its suitability for any
1.16 - * purpose.
1.17 - *
1.18 - */
1.19 -
1.20 -#include <iostream>
1.21 -
1.22 -#include <lemon/error.h>
1.23 -#include "test_tools.h"
1.24 -using namespace lemon;
1.25 -using std::cout;
1.26 -using std::endl;
1.27 -
1.28 -void faulty_fn() {
1.29 - fault("This is a fault message");
1.30 -}
1.31 -
1.32 -void exception_fn() {
1.33 - throw Exception("This is a fn throwing excpt with some args: ")
1.34 - << 5 << ", " << 18;
1.35 -}
1.36 -
1.37 -void unfinished_fn() {
1.38 - FIXME("unfinished_fn() is unfinished!");
1.39 -}
1.40 -
1.41 -
1.42 -int main() {
1.43 - try {
1.44 - faulty_fn();
1.45 - check(false, "A faulty function did not fail.");
1.46 - }
1.47 - catch(const Exception &e) {
1.48 - cout << "Exeption = \"" << e.what() << "\" (Right behaviour)" << endl;
1.49 - }
1.50 -
1.51 - try {
1.52 - exception_fn();
1.53 - check(false, "The function did not throw Exception.");
1.54 - }
1.55 - catch(const Exception &e) {
1.56 - cout << "Exeption = \"" << e.what() << "\" (Right behaviour)" << endl;
1.57 - }
1.58 -
1.59 - try {
1.60 - unfinished_fn();
1.61 - check(false, "FIXME macro does not work.");
1.62 - }
1.63 - catch(const Exception &e) {
1.64 - cout << "Exeption = \"" << e.what() << "\" (Right behaviour)" << endl;
1.65 - }
1.66 -
1.67 - return 0;
1.68 -}