LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
TestCaseError.hpp
Go to the documentation of this file.
1// Copyright 2002-2013 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6/***************************************************************************
7 * Copyright (C) 2004 by Benoit Mathieu *
8 * mathieub@zoe.cea.fr *
9 * *
10 ***************************************************************************/
11#ifndef LIMA_COMMON_TGV_TESTCASEERROR_HPP
12#define LIMA_COMMON_TGV_TESTCASEERROR_HPP
13
14#include "TestCase.h"
15
16#include <string>
17#include <map>
18#include <list>
19#include <stdexcept>
20#include "common/LimaCommon.h"
21
22namespace Lima
23{
24namespace Common
25{
26namespace TGV
27{
28
30{
31public:
33 {
37 TestCaseFailed
38 };
39 TestCaseError() : m_type(NoError), m_reason(""), m_conditional(false) {}
40
41 TestCaseError(const TestCase& tc,
42 const std::string& reason,
43 const std::string& pipeline);
44
45 TestCaseError(const TestCase& tc, ErrorTypes type,
46 const std::string& reason,
47 const std::string& pipeline,
48 const TestCase::TestUnit& tu);
49
51 m_type(error.m_type) ,m_reason(error.m_reason), m_conditional(error.m_conditional) {}
52
54 {
55 m_type = error.m_type;
56 m_reason = error.m_reason;
57 m_conditional = error.m_conditional;
58 return *this;
59 }
60
61 virtual ~TestCaseError() = default;
62
63 const std::string& what() const {return m_reason;}
64 ErrorTypes operator()() {return m_type;}
65 bool isConditional() const {return m_conditional;}
66
67protected:
69 std::string m_reason;
71};
72
73
74
75} // TGV
76} // Common
77} // Lima
78
79#endif
#define LIMA_TGV_EXPORT
TestCaseError(const TestCaseError &error)
TestCaseError & operator=(const TestCaseError &error)
const std::string & what() const
virtual ~TestCaseError()=default
NAUTITIA.