├── ext ├── README ├── lib │ └── README └── include │ ├── README │ └── boost │ └── test │ ├── included │ ├── unit_test_framework.hpp │ ├── execution_monitor.hpp │ ├── prg_exec_monitor.hpp │ ├── unit_test.hpp │ └── test_exec_monitor.hpp │ ├── test_case_template.hpp │ ├── predicate_result.hpp │ ├── output_test_stream.hpp │ ├── floating_point_comparison.hpp │ ├── data │ ├── dataset.hpp │ ├── generators.hpp │ ├── monomorphic │ │ ├── generators.hpp │ │ ├── generators │ │ │ └── keywords.hpp │ │ ├── array.hpp │ │ ├── initializer_list.hpp │ │ ├── collection.hpp │ │ ├── generate.hpp │ │ ├── singleton.hpp │ │ └── sample_merge.hpp │ ├── monomorphic.hpp │ ├── config.hpp │ ├── index_sequence.hpp │ └── for_each_sample.hpp │ ├── auto_unit_test.hpp │ ├── debug_config.hpp │ ├── detail │ ├── fwd_decl.hpp │ ├── log_level.hpp │ ├── workaround.hpp │ ├── enable_warnings.hpp │ ├── suppress_warnings.hpp │ ├── pp_variadic.hpp │ ├── throw_exception.hpp │ ├── global_typedef.hpp │ └── config.hpp │ ├── utils │ ├── assign_op.hpp │ ├── basic_cstring │ │ ├── basic_cstring_fwd.hpp │ │ └── io.hpp │ ├── runtime │ │ ├── fwd.hpp │ │ ├── finalize.hpp │ │ ├── env │ │ │ └── fetch.hpp │ │ ├── cla │ │ │ └── argv_traverser.hpp │ │ └── modifier.hpp │ ├── is_cstring.hpp │ ├── rtti.hpp │ ├── custom_manip.hpp │ ├── string_cast.hpp │ ├── trivial_singleton.hpp │ ├── iterator │ │ └── input_iterator_facade.hpp │ └── nullstream.hpp │ ├── test_exec_monitor.hpp │ ├── tree │ ├── visitor.hpp │ ├── test_case_counter.hpp │ ├── auto_registration.hpp │ ├── global_fixture.hpp │ ├── traverse.hpp │ ├── observer.hpp │ └── fixture.hpp │ ├── output │ ├── xml_report_formatter.hpp │ ├── plain_report_formatter.hpp │ ├── xml_log_formatter.hpp │ └── compiler_log_formatter.hpp │ ├── unit_test_monitor.hpp │ ├── impl │ ├── test_main.ipp │ ├── unit_test_monitor.ipp │ └── xml_report_formatter.ipp │ ├── progress_monitor.hpp │ ├── tools │ ├── detail │ │ ├── expression_holder.hpp │ │ ├── it_pair.hpp │ │ ├── per_element_manip.hpp │ │ ├── lexicographic_manip.hpp │ │ ├── indirections.hpp │ │ └── fwd.hpp │ ├── context.hpp │ ├── assertion_result.hpp │ ├── fpc_tolerance.hpp │ ├── output_test_stream.hpp │ └── cstring_comparison_op.hpp │ ├── test_tools.hpp │ ├── unit_test.hpp │ └── prg_exec_monitor.hpp ├── int └── README ├── bin └── README ├── src ├── a429 │ ├── a429hyb.cpp │ ├── a429dis.hpp │ ├── a429dis.cpp │ ├── a429hyb.hpp │ ├── a429bcd.hpp │ ├── a429bnr.hpp │ ├── a429base.hpp │ └── a429bnr.cpp └── buffer │ ├── buf.hpp │ ├── bufbase.hpp │ ├── README │ └── circbuf.hpp ├── inc └── README ├── .gitignore ├── makefile ├── openarinc.sln ├── README.md └── test └── test.vcproj /ext/README: -------------------------------------------------------------------------------- 1 | This directory shall contain 3rd party include files and library files 2 | -------------------------------------------------------------------------------- /ext/lib/README: -------------------------------------------------------------------------------- 1 | This directory is intended for library files from 3rd party libraries. It will be linked in most compiler commands. 2 | -------------------------------------------------------------------------------- /int/README: -------------------------------------------------------------------------------- 1 | This directory is intended for intermediate binary files (.o). 2 | 3 | Files in this directory shall be git-ignored. 4 | -------------------------------------------------------------------------------- /ext/include/README: -------------------------------------------------------------------------------- 1 | This directory is intended for headerfiles from 3rd party libraries. It will be included in any compiler command. 2 | -------------------------------------------------------------------------------- /bin/README: -------------------------------------------------------------------------------- 1 | This directory is intended for output binary files from this library, intended for use by a 3rd party. 2 | This is the output directory of make file 3 | 4 | Files in this directory shall be git-ignored. 5 | -------------------------------------------------------------------------------- /src/a429/a429hyb.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "a429hyb.hpp" 3 | 4 | namespace a429 5 | { 6 | UINT a429hyb::operator= (UINT word) 7 | { 8 | *m_packed = word; 9 | return *m_packed; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /inc/README: -------------------------------------------------------------------------------- 1 | This directory is intended for include files from this library, intended for use by a 3rd party. 2 | Files here will be copies from their relevant locations in the project sources. 3 | 4 | Files in this directory shall be git-ignored. 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Auto-generated visual-studio files 2 | *.ncb 3 | *.suo 4 | *.user 5 | # 6 | # Output files, incremental files, and output include files, but save the READMEs! 7 | bin/* 8 | !bin/README 9 | int/* 10 | !int/README 11 | inc/* 12 | !inc/README 13 | -------------------------------------------------------------------------------- /ext/include/boost/test/included/unit_test_framework.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// @deprecated 10 | // *************************************************************************** 11 | 12 | #include 13 | -------------------------------------------------------------------------------- /ext/include/boost/test/test_case_template.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// @brief Deprecated header. 10 | /// @deprecated Use @c boost/test/unit_test.hpp instead 11 | // *************************************************************************** 12 | 13 | #include 14 | -------------------------------------------------------------------------------- /ext/include/boost/test/predicate_result.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// @brief Deprecated header 10 | /// @deprecated Use boost/test/tools/assertion_result.hpp instead 11 | // *************************************************************************** 12 | 13 | // Boost.Test 14 | #include 15 | -------------------------------------------------------------------------------- /ext/include/boost/test/output_test_stream.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief Deprecated header. 10 | //!@deprecated Use boost/test/tools/output_test_stream.hpp instead 11 | // *************************************************************************** 12 | 13 | // Boost.Test 14 | #include 15 | -------------------------------------------------------------------------------- /ext/include/boost/test/floating_point_comparison.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //! @file 9 | //! @brief Deprecated header 10 | //! @deprecated Use boost/test/tools/floating_point_comparison.hpp instead 11 | // *************************************************************************** 12 | 13 | // Boost.Test 14 | #include 15 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/dataset.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief dataset interfaces 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_DATASET_HPP_102211GER 13 | #define BOOST_TEST_DATA_DATASET_HPP_102211GER 14 | 15 | // Boost.Test 16 | #include 17 | 18 | #endif // BOOST_TEST_DATA_DATASET_HPP_102211GER 19 | 20 | -------------------------------------------------------------------------------- /ext/include/boost/test/auto_unit_test.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //! @file 9 | //! @brief Deprecated header. 10 | //! @deprecated Use @c boost/test/unit_test.hpp instead. 11 | // *************************************************************************** 12 | 13 | #ifndef BOOST_TEST_AUTO_UNIT_TEST_HPP_071894GER 14 | #define BOOST_TEST_AUTO_UNIT_TEST_HPP_071894GER 15 | 16 | #include 17 | 18 | #endif // BOOST_TEST_AUTO_UNIT_TEST_HPP_071894GER 19 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/generators.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief specific generators 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_MONOMORPHIC_GENERATORS_HPP_112011GER 13 | #define BOOST_TEST_DATA_MONOMORPHIC_GENERATORS_HPP_112011GER 14 | 15 | // Boost.Test 16 | #include 17 | 18 | #endif // BOOST_TEST_DATA_MONOMORPHIC_GENERATORS_HPP_112011GER 19 | 20 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | EXTINCDIR = ext/include 2 | EXTLIBDIR = ext/lib 3 | SRCDIR = src 4 | INTDIR = int 5 | BINDIR = bin 6 | INCDIR = inc 7 | 8 | CPPFILES = $(wildcard $(SRCDIR)/a429/*.cpp) 9 | OBJFILES = $(addprefix $(INTDIR)/,$(notdir $(CPPFILES:.cpp=.o))) 10 | 11 | CC_FLAGS = -I$(EXTINCDIR) -MMD 12 | 13 | all : $(OBJFILES) 14 | ar rvs $(BINDIR)/libopenarinc.a $(OBJFILES) && cp $(SRCDIR)/a429/*.hpp $(INCDIR)/a429 15 | 16 | $(INTDIR)/%.o : $(SRCDIR)/a429/%.cpp 17 | g++ -c -o $@ $< $(CC_FLAGS) 18 | 19 | test: bin/libopenarinc.a test/test.cpp 20 | g++ test/test.cpp bin/libopenarinc.a -o $(BINDIR)/test -I$(INCDIR) -I../boost -w 21 | ./bin/test --random=1 --report_level=short 22 | 23 | .PHONY: clean 24 | 25 | clean: 26 | rm -f $(INTDIR)/*.o $(INTDIR)/*.d $(BINDIR)/libopenarinc.a $(INCDIR)/a429/*.hpp 27 | 28 | -include $(OBJFILES:.o=.d) 29 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/monomorphic/generators.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | ///@file 9 | ///Defines specific generators 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_MONOMORPHIC_GENERATORS_HPP_112011GER 13 | #define BOOST_TEST_DATA_MONOMORPHIC_GENERATORS_HPP_112011GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | 19 | #endif // BOOST_TEST_DATA_MONOMORPHIC_GENERATORS_HPP_112011GER 20 | 21 | -------------------------------------------------------------------------------- /ext/include/boost/test/included/execution_monitor.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : included variant of Execution Monitor to be used independently 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_INCLUDED_EXECUTION_MONITOR_HPP_051410GER 16 | #define BOOST_INCLUDED_EXECUTION_MONITOR_HPP_051410GER 17 | 18 | #include 19 | #include 20 | 21 | #endif // BOOST_INCLUDED_EXECUTION_MONITOR_HPP_051410GER 22 | -------------------------------------------------------------------------------- /src/buffer/buf.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENARINC_BUF_HPP 2 | #define OPENARINC_BUF_HPP 3 | 4 | #iniclude "circbuf.hpp" 5 | 6 | namespace buf { 7 | 8 | template class buf_rx {}; 9 | 10 | template <> class buf_rx : public circbuf_rx 11 | { 12 | public: 13 | buf_rx(unsigned int* buf, unsigned int size) : circbuf_rx(buf, size) {} 14 | }; 15 | 16 | /* 17 | template <> class buf_tx : public sockbuf_rx 18 | { 19 | public: 20 | buf_rx() : sockbuf_rx(IP, Port) {} 21 | } 22 | */ 23 | 24 | template class buf_tx {}; 25 | 26 | template <> class buf_tx : public circbuf_tx 27 | { 28 | public: 29 | buf_tx(unsigned int* buf, unsigned int size) : circbuf_tx(buf, size) {} 30 | }; 31 | 32 | /* 33 | template <> class buf_tx : public sockbuf_tx 34 | { 35 | public: 36 | buf_tx() : sockbuf_tx(IP, Port) {} 37 | } 38 | */ 39 | 40 | } // namespace buf 41 | 42 | #endif -------------------------------------------------------------------------------- /ext/include/boost/test/debug_config.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //! @file 9 | //! @brief user's config for Boost.Test debugging support 10 | //! 11 | //! This file is intended to be edited by end user to specify varios macros, which configure debugger interface 12 | //! Alterntively you can set these parameters in your own sources/makefiles 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_DEBUG_CONFIG_HPP_112006GER 16 | #define BOOST_TEST_DEBUG_CONFIG_HPP_112006GER 17 | 18 | // ';' separated list of supported debuggers 19 | // #define BOOST_TEST_DBG_LIST gdb;dbx 20 | 21 | // maximum size of /proc/pid/stat file 22 | // #define BOOST_TEST_STAT_LINE_MAX 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /ext/include/boost/test/included/prg_exec_monitor.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : included (vs. linked ) version of Program Execution Monitor 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_INCLUDED_PRG_EXEC_MONITOR_HPP_071894GER 16 | #define BOOST_INCLUDED_PRG_EXEC_MONITOR_HPP_071894GER 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #define BOOST_TEST_INCLUDED 23 | #include 24 | 25 | #endif // BOOST_INCLUDED_PRG_EXEC_MONITOR_HPP_071894GER 26 | -------------------------------------------------------------------------------- /src/a429/a429dis.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENARINC_A429DIS_HPP 2 | #define OPENARINC_A429DIS_HPP 3 | 4 | #include "a429base.hpp" 5 | 6 | namespace a429 7 | { 8 | enum SSM_DIS 9 | { 10 | DIS_NO = 0, 11 | DIS_NCD = 1, 12 | DIS_FT = 2, 13 | DIS_FW = 3, 14 | }; 15 | 16 | // Represents an A429 discrete label by providing discrete-specific methods 17 | class a429dis : public virtual a429base 18 | { 19 | public: 20 | 21 | a429dis() : a429base() {} 22 | a429dis(UINT input) : a429base(input) {} 23 | a429dis(UINT* reference) : a429base(reference) {} 24 | 25 | operator UINT() const { return *m_packed; } 26 | UINT operator= (UINT word); 27 | 28 | a429dis& SetBit (bool value, int pos); 29 | a429dis& SetBits(UINT value, int msb, int lsb); 30 | 31 | bool GetBit (int pos) const; 32 | UINT GetBits(int msb, int lsb) const; 33 | }; 34 | } 35 | #endif // OPENARINC_A429DIS_HPP 36 | -------------------------------------------------------------------------------- /src/a429/a429dis.cpp: -------------------------------------------------------------------------------- 1 | #include "a429dis.hpp" 2 | 3 | namespace a429 4 | { 5 | UINT a429dis::operator= (UINT word) 6 | { 7 | *m_packed = word; 8 | return *m_packed; 9 | } 10 | 11 | a429dis& a429dis::SetBit(bool value, int pos) 12 | { 13 | if (value) 14 | *m_packed |= 0x1 << (pos - 1); 15 | else 16 | *m_packed &= ~(0x1 << (pos - 1)); 17 | return *this; 18 | } 19 | 20 | a429dis& a429dis::SetBits(UINT value, int msb, int lsb) 21 | { 22 | UINT mask = ~(-1 << msb) & (-1 << (lsb-1)); 23 | *m_packed &= ~mask; 24 | *m_packed |= (value << (lsb-1)) & mask; 25 | return *this; 26 | } 27 | 28 | bool a429dis::GetBit(int pos) const 29 | { 30 | return ((*m_packed >> (pos - 1)) & 0x1); 31 | } 32 | 33 | 34 | UINT a429dis::GetBits(int msb, int lsb) const 35 | { 36 | UINT mask = ~(-1 << msb); 37 | return (*m_packed & mask) >> --lsb; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/buffer/bufbase.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENARINC_BUFBASE_HPP 2 | #define OPENARINC_BUFBASE_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace buf 8 | { 9 | 10 | class bufbase_rx 11 | { 12 | public: 13 | typedef std::function callback_type; 14 | 15 | virtual void recieve() = 0; 16 | 17 | void registr(callback_type func) 18 | { 19 | m_listeners.push_back(func); 20 | } 21 | 22 | protected: 23 | void notify(unsigned int word) 24 | { 25 | for (std::vector::iterator it = m_listeners.begin; 26 | it != m_listeners.end; 27 | ++it) 28 | (*it)(word); 29 | } 30 | 31 | private: 32 | std::vector m_listeners; 33 | }; 34 | 35 | 36 | class bufbase_tx 37 | { 38 | public: 39 | virtual void send(unsigned int word) = 0; 40 | }; 41 | 42 | } // namespace buf 43 | #endif // OPENARINC_BUFBASE_HPP -------------------------------------------------------------------------------- /src/a429/a429hyb.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENARINC_A429HYB_HPP 2 | #define OPENARINC_A429HYB_HPP 3 | 4 | #include "a429base.hpp" 5 | #include "a429bcd.hpp" 6 | #include "a429bnr.hpp" 7 | #include "a429dis.hpp" 8 | 9 | namespace a429 10 | { 11 | 12 | // Represents an A429 hybrid label by providing methods from all other types 13 | class a429hyb : public virtual a429base, public virtual a429bnr, public virtual a429dis, public virtual a429bcd 14 | { 15 | public: 16 | using a429dis::SetBit; 17 | using a429dis::GetBit; 18 | 19 | a429hyb() : a429base() {} 20 | a429hyb(UINT input) : a429base(input) {} 21 | a429hyb(UINT* reference) : a429base(reference) {} 22 | 23 | operator UINT() const { return *m_packed; } 24 | UINT operator= (UINT word); // Casting from a UINT is automatically handled 25 | 26 | }; 27 | 28 | // The type A429 is a hybrid type which contains all methods from all types of A429 labels 29 | typedef a429hyb a429; 30 | } 31 | #endif // OPENARINC_A429HYB_HPP 32 | -------------------------------------------------------------------------------- /src/buffer/README: -------------------------------------------------------------------------------- 1 | To continue with development it is crucial that we have a means of transmitting information. This will be in the form of a bus. 2 | 3 | A generic bus is necessary to implement/test protocols such as Arinc 739, or even 429 buses. 4 | 5 | Questions: 6 | Should the busses be time-aware? 7 | - Some protocols have baud limitations that we could observe to make this realistic. 8 | - We can define repetitive intervals to transmit certain words 9 | - We can appropriately simulate time-intervals 10 | Yes, therefore I think we should be time-aware. 11 | What is the best way to make these time-aware? 12 | - They can rely on system time. However this may not be in sync with any real-time scheduler, especially if rates are manually manipulated or if over-runs are experienced on the rest of the system. 13 | - They can rely on a dt to be passed at a regular interval. This may complicate the interface, and require repetitive function calls. It also requires the client to be time-aware which may not be the case. 14 | - Can we make this optional? 15 | 16 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/monomorphic.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief Monomorphic dataset interfaces 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_MONOMORPHIC_HPP_102211GER 13 | #define BOOST_TEST_DATA_MONOMORPHIC_HPP_102211GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #endif // BOOST_TEST_DATA_MONOMORPHIC_HPP_102211GER 27 | 28 | -------------------------------------------------------------------------------- /ext/include/boost/test/detail/fwd_decl.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief contains forward eclarations for Boost.Test data types 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_FWD_DECL_HPP_011605GER 13 | #define BOOST_TEST_FWD_DECL_HPP_011605GER 14 | 15 | namespace boost { 16 | 17 | class execution_monitor; 18 | class execution_exception; 19 | 20 | namespace unit_test { 21 | 22 | class test_unit; 23 | class test_case; 24 | class test_suite; 25 | class master_test_suite_t; 26 | 27 | class test_tree_visitor; 28 | class test_observer; 29 | 30 | // singletons 31 | class unit_test_monitor_t; 32 | class unit_test_log_t; 33 | 34 | class unit_test_log_formatter; 35 | struct log_entry_data; 36 | struct log_checkpoint_data; 37 | 38 | class lazy_ostream; 39 | 40 | } // namespace unit_test 41 | 42 | } // namespace boost 43 | 44 | #endif // BOOST_TEST_FWD_DECL_HPP_011605GER 45 | 46 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/assign_op.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : overloadable assignment 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_UTILS_ASSIGN_OP_HPP 16 | #define BOOST_TEST_UTILS_ASSIGN_OP_HPP 17 | 18 | namespace boost { 19 | namespace unit_test { 20 | 21 | // ************************************************************************** // 22 | // ************** generic assign operator ************** // 23 | // ************************************************************************** // 24 | 25 | // generic 26 | template 27 | inline void 28 | assign_op( T& t, S const& s, long ) 29 | { 30 | t = s; 31 | } 32 | 33 | //____________________________________________________________________________// 34 | 35 | } // namespace unit_test 36 | } // namespace boost 37 | 38 | #endif // BOOST_TEST_UTILS_ASSIGN_OP_HPP 39 | 40 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/basic_cstring/basic_cstring_fwd.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : basic_cstring class wrap C string and provide std_string like 13 | // interface 14 | // *************************************************************************** 15 | 16 | #ifndef BOOST_TEST_UTILS_BASIC_CSTRING_FWD_HPP 17 | #define BOOST_TEST_UTILS_BASIC_CSTRING_FWD_HPP 18 | 19 | #include 20 | 21 | namespace boost { 22 | 23 | namespace unit_test { 24 | 25 | template class basic_cstring; 26 | typedef basic_cstring const_string; 27 | #if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590041)) 28 | typedef const_string literal_string; 29 | #else 30 | typedef const_string const literal_string; 31 | #endif 32 | 33 | typedef char const* const c_literal_string; 34 | 35 | } // namespace unit_test 36 | 37 | } // namespace boost 38 | 39 | #endif // BOOST_TEST_UTILS_BASIC_CSTRING_FWD_HPP 40 | 41 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/monomorphic/generators/keywords.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | ///@file 9 | /// Keywords used in generator interfaces 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_MONOMORPHIC_GENERATORS_KEYWORDS_HPP_101512GER 13 | #define BOOST_TEST_DATA_MONOMORPHIC_GENERATORS_KEYWORDS_HPP_101512GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | //____________________________________________________________________________// 22 | 23 | namespace boost { 24 | namespace unit_test { 25 | namespace data { 26 | 27 | namespace { 28 | nfp::keyword begin; 29 | nfp::keyword end; 30 | nfp::keyword step; 31 | } // local namespace 32 | 33 | } // namespace data 34 | } // namespace unit_test 35 | } // namespace boost 36 | 37 | #include 38 | 39 | #endif // BOOST_TEST_DATA_MONOMORPHIC_GENERATORS_KEYWORDS_HPP_101512GER 40 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/runtime/fwd.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : runtime parameters forward declaration 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_UTILS_RUNTIME_FWD_HPP 16 | #define BOOST_TEST_UTILS_RUNTIME_FWD_HPP 17 | 18 | // Boost.Test 19 | #include 20 | #include 21 | #include // operator<<(boost::runtime::cstring) 22 | 23 | // Boost 24 | #include 25 | 26 | // STL 27 | #include 28 | 29 | namespace boost { 30 | namespace runtime { 31 | 32 | typedef unit_test::const_string cstring; 33 | 34 | class argument; 35 | typedef shared_ptr argument_ptr; 36 | 37 | template class typed_argument; 38 | 39 | class basic_param; 40 | typedef shared_ptr basic_param_ptr; 41 | 42 | } // namespace runtime 43 | } // namespace boost 44 | 45 | #endif // BOOST_TEST_UTILS_RUNTIME_FWD_HPP 46 | -------------------------------------------------------------------------------- /openarinc.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openarinc", "openarinc.vcproj", "{217F0FDC-BA5D-41CA-A73F-E6C1120D4A7D}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcproj", "{846F2C3C-12DE-49F0-B392-737B26A2CAD9}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {217F0FDC-BA5D-41CA-A73F-E6C1120D4A7D} = {217F0FDC-BA5D-41CA-A73F-E6C1120D4A7D} 9 | EndProjectSection 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {217F0FDC-BA5D-41CA-A73F-E6C1120D4A7D}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {217F0FDC-BA5D-41CA-A73F-E6C1120D4A7D}.Debug|Win32.Build.0 = Debug|Win32 19 | {217F0FDC-BA5D-41CA-A73F-E6C1120D4A7D}.Release|Win32.ActiveCfg = Release|Win32 20 | {217F0FDC-BA5D-41CA-A73F-E6C1120D4A7D}.Release|Win32.Build.0 = Release|Win32 21 | {846F2C3C-12DE-49F0-B392-737B26A2CAD9}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {846F2C3C-12DE-49F0-B392-737B26A2CAD9}.Debug|Win32.Build.0 = Debug|Win32 23 | {846F2C3C-12DE-49F0-B392-737B26A2CAD9}.Release|Win32.ActiveCfg = Release|Win32 24 | {846F2C3C-12DE-49F0-B392-737B26A2CAD9}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /ext/include/boost/test/included/unit_test.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief Included (vs. linked) version of Unit Test Framework 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_INCLUDED_UNIT_TEST_FRAMEWORK_HPP_071894GER 13 | #define BOOST_INCLUDED_UNIT_TEST_FRAMEWORK_HPP_071894GER 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #define BOOST_TEST_INCLUDED 34 | #include 35 | 36 | #endif // BOOST_INCLUDED_UNIT_TEST_FRAMEWORK_HPP_071894GER 37 | -------------------------------------------------------------------------------- /src/buffer/circbuf.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENARINC_CIRCBUF_HPP 2 | #define OPENARINC_CIRCBUF_HPP 3 | 4 | #include "bufbase.hpp" 5 | 6 | namespace buf 7 | { 8 | 9 | class circbuf_rx : public bufbase_rx 10 | { 11 | public: 12 | 13 | circbuf_rx(unsigned int* buf, unsigned int size) 14 | : m_buf(buf), m_size(size), m_lastindex(0) {} 15 | 16 | void recieve() 17 | { 18 | unsigned int newindex = m_buf[0]; 19 | if (newindex == 0 || newindex == m_lastindex) 20 | return; 21 | 22 | if (newindex < m_lastindex) 23 | { 24 | while (++m_lastindex < m_size) 25 | notify(m_buf[m_lastindex]); 26 | 27 | m_lastindex = 0; 28 | } 29 | 30 | while (newindex > m_lastindex++) 31 | notify( m_buf[m_lastindex] ); 32 | } 33 | 34 | private: 35 | unsigned int* m_buf; 36 | unsigned int m_size; 37 | unsigned int m_lastindex; 38 | }; 39 | 40 | 41 | class circbuf_tx 42 | { 43 | public: 44 | 45 | circbuf_tx(unsigned int* buf, unsigned int size) 46 | : m_buf(buf), m_size(size) {} 47 | 48 | send(unsigned int word) 49 | { 50 | unsigned int nextindex = m_buf[0] + 1; 51 | 52 | if (nextindex >= m_size) nextindex = 1; 53 | 54 | m_buf[nextindex] = word; 55 | m_buf[0] = nextindex; // It's critical that the last thing we do is increment this index (thread safety). 56 | } 57 | 58 | private: 59 | unsigned int* m_buf ; 60 | unsigned int m_size; 61 | }; 62 | 63 | } // namespace buf 64 | 65 | #endif // OPENARINC_CIRCBUF_HPP -------------------------------------------------------------------------------- /src/a429/a429bcd.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENARINC_A429BCD_HPP 2 | #define OPENARINC_A429BCD_HPP 3 | 4 | #include "a429base.hpp" 5 | 6 | namespace a429 7 | { 8 | enum SSM_BCD 9 | { 10 | BCD_POS = 0, 11 | BCD_NCD = 1, 12 | BCD_FT = 2, 13 | BCD_NEG = 3, 14 | }; 15 | 16 | class a429bcd : public virtual a429base 17 | { 18 | protected: 19 | int m_numdigits; 20 | double m_res; 21 | 22 | public: 23 | // Constructors 24 | a429bcd() : a429base(), m_numdigits(5), m_res(1.0) {} 25 | a429bcd(UINT input) : a429base(input), m_numdigits(5), m_res(1.0) {} 26 | a429bcd(UINT* reference) : a429base(reference) {} 27 | 28 | // Operators 29 | operator UINT() const { return *m_packed; } 30 | UINT operator= (UINT word); 31 | 32 | a429bcd& SetBCD(double data); // Easily sets BCD data into a word where the packing information is previously defined 33 | 34 | // Unpacking BCD data where packing information was previously defined. 35 | double GetBCD() const; 36 | 37 | // Sets properties of BCD words given resolution and # of DIGITs 38 | a429bcd& SetBCDProperties(double resolution, unsigned int numdigits ); 39 | 40 | // Sets a single digit between 0 and 9 41 | a429bcd& SetDigit(unsigned int data, unsigned int startbit, unsigned int endbit); 42 | 43 | // Returns a single digit between 0 and 9 44 | UINT GetDigit(unsigned int startbit, unsigned int endbit) const; 45 | }; 46 | } 47 | 48 | #endif // OPENARINC_A429BCD_HPP 49 | -------------------------------------------------------------------------------- /ext/include/boost/test/detail/log_level.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief shared definition for unit test log levels 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_LOG_LEVEL_HPP_011605GER 13 | #define BOOST_TEST_LOG_LEVEL_HPP_011605GER 14 | 15 | namespace boost { 16 | namespace unit_test { 17 | 18 | // ************************************************************************** // 19 | // ************** log levels ************** // 20 | // ************************************************************************** // 21 | 22 | // each log level includes all subsequent higher loging levels 23 | enum log_level { 24 | invalid_log_level = -1, 25 | log_successful_tests = 0, 26 | log_test_units = 1, 27 | log_messages = 2, 28 | log_warnings = 3, 29 | log_all_errors = 4, // reported by unit test macros 30 | log_cpp_exception_errors = 5, // uncaught C++ exceptions 31 | log_system_errors = 6, // including timeouts, signals, traps 32 | log_fatal_errors = 7, // including unit test macros or 33 | // fatal system errors 34 | log_nothing = 8 35 | }; 36 | 37 | } // namespace unit_test 38 | } // namespace boost 39 | 40 | #endif // BOOST_TEST_LOG_LEVEL_HPP_011605GER 41 | -------------------------------------------------------------------------------- /ext/include/boost/test/included/test_exec_monitor.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // 9 | /// @file 10 | /// @brief Included (vs. linked) version of Test Execution Monitor 11 | // *************************************************************************** 12 | 13 | #ifndef BOOST_INCLUDED_TEST_EXEC_MONITOR_HPP_071894GER 14 | #define BOOST_INCLUDED_TEST_EXEC_MONITOR_HPP_071894GER 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #define BOOST_TEST_INCLUDED 36 | #include 37 | 38 | #endif // BOOST_INCLUDED_TEST_EXEC_MONITOR_HPP_071894GER 39 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/config.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief common dataset macros 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_CONFIG_HPP_112611GER 13 | #define BOOST_TEST_DATA_CONFIG_HPP_112611GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | 19 | // STL 20 | #include // for std::logic_error 21 | 22 | // availability on features: preprocessed by doxygen 23 | 24 | #if defined(BOOST_NO_CXX11_HDR_RANDOM) || defined(BOOST_TEST_DOXYGEN_DOC__) 25 | //! Defined when the random dataset feature is not available 26 | #define BOOST_TEST_NO_RANDOM_DATASET_AVAILABLE 27 | 28 | #endif 29 | 30 | #if defined(BOOST_NO_CXX11_HDR_TUPLE) || defined(BOOST_TEST_DOXYGEN_DOC__) 31 | 32 | //! Defined when grid composition of datasets is not available 33 | #define BOOST_TEST_NO_GRID_COMPOSITION_AVAILABLE 34 | 35 | //! Defined when zip composition of datasets is not available 36 | #define BOOST_TEST_NO_ZIP_COMPOSITION_AVAILABLE 37 | 38 | #endif 39 | 40 | //____________________________________________________________________________// 41 | 42 | #define BOOST_TEST_DS_ERROR( msg ) BOOST_TEST_I_THROW( std::logic_error( msg ) ) 43 | #define BOOST_TEST_DS_ASSERT( cond, msg ) BOOST_TEST_I_ASSRT( cond, std::logic_error( msg ) ) 44 | 45 | #endif // BOOST_TEST_DATA_CONFIG_HPP_112611GER 46 | -------------------------------------------------------------------------------- /ext/include/boost/test/detail/workaround.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief contains mics. workarounds 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_WORKAROUND_HPP_021005GER 13 | #define BOOST_TEST_WORKAROUND_HPP_021005GER 14 | 15 | // Boost 16 | #include // compilers workarounds and std::ptrdiff_t 17 | 18 | // STL 19 | #include // for std::distance 20 | 21 | #include 22 | 23 | //____________________________________________________________________________// 24 | 25 | namespace boost { 26 | namespace unit_test { 27 | namespace ut_detail { 28 | 29 | #ifdef BOOST_NO_STD_DISTANCE 30 | template 31 | std::ptrdiff_t distance( T const& x_, T const& y_ ) 32 | { 33 | std::ptrdiff_t res = 0; 34 | 35 | std::distance( x_, y_, res ); 36 | 37 | return res; 38 | } 39 | 40 | //____________________________________________________________________________// 41 | 42 | #else 43 | using std::distance; 44 | #endif 45 | 46 | template inline void ignore_unused_variable_warning(const T&) {} 47 | 48 | } // namespace ut_detail 49 | } // namespace unit_test 50 | } // namespace boost 51 | 52 | //____________________________________________________________________________// 53 | 54 | #include 55 | 56 | #endif // BOOST_TEST_WORKAROUND_HPP_021005GER 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Open Arinc 2 | 3 | Arinc is an organization which publishes standards for use in the Aviation industry. openarinc is a library which provides open-source software implementations of various Arinc standards. openarinc does not replace the Arinc documents, and those documents cannot be reverse engineered from this library. For a full understanding of the standards implemented here, it is suggested to obtain a copy of the standards. 4 | 5 | a429 is the first library available in openarinc and provides utilities for packing and unpacking words following the Arinc 429 specification. 6 | 7 | Filestructure: 8 | 9 | root - This folder, contains license, makefile, and this readme. 10 | \- bin - Contains binary outputs (executables, dynamic, and static libraries) 11 | | \- *.exe *.so *.dll *.a 12 | \- ext - Contains 3rd party libraries 13 | | \- lib - Contains 3rd party binary libraries (.so .a .dll) 14 | | \- inc - Contains 3rd party header files to accompany libraries 15 | \- inc - Contains an export of headers to be used with this library. 16 | | \- 17 | | \- *.hpp 18 | \- int - Contains intermediate binaries (.o, .d) 19 | | \- *.o 20 | | \- *.d 21 | \- test - Contains sources for unit-testing the library 22 | | \- *.hpp 23 | | \- *.cpp 24 | \- src - Contains all sources and headers in this library 25 | \- - sources are split logically by smaller modules 26 | \- *.hpp 27 | \- *.cpp 28 | 29 | 30 | 31 | Todo: Items outstanding 32 | - Find proper way to link boost headers 33 | - Implement socket buffers 34 | - Implement templated sizes for buffers 35 | - Fix std::function callback_type for basebuf_rx; 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/a429/a429bnr.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENARINC_A429BNR_HPP 2 | #define OPENARINC_A429BNR_HPP 3 | 4 | #include "a429base.hpp" 5 | 6 | namespace a429 7 | { 8 | enum SSM_BNR 9 | { 10 | BNR_FW = 0, 11 | BNR_NCD = 1, 12 | BNR_FT = 2, 13 | BNR_NO = 3, 14 | }; 15 | 16 | class a429bnr : public virtual a429base 17 | { 18 | private: 19 | void SetBit(bool value, unsigned int pos); 20 | UINT GetBit(unsigned int pos) const; 21 | 22 | protected: 23 | double m_res; 24 | short m_sigbits; 25 | short m_endbit; 26 | short m_signbit; 27 | unsigned int m_mask; 28 | 29 | public: 30 | a429bnr() : a429base() {} 31 | a429bnr(UINT input) : a429base(input) {} 32 | a429bnr(UINT* reference) : a429base(reference) {} 33 | 34 | operator UINT() const { return *m_packed; } 35 | UINT operator= (UINT word); 36 | 37 | a429bnr& SetBNR(double data); 38 | a429bnr& SetBNR(double data, double resolution, int sigbits, int endbit = 28, int signbit = 29); 39 | 40 | double GetBNR() const; 41 | double GetBNR (double resolution, int sigbits, int endbit = 28, int signbit = 29); 42 | a429bnr& SetBNRPropertiesA(double resolution, int sigbits, int endbit = 28, int signbit = 29); 43 | a429bnr& SetBNRPropertiesB(double range, int sigbits, int endbit = 28, int signbit = 29); 44 | a429bnr& SetBNRPropertiesC(double resolution, int startbit, int endbit = 28, int signbit = 29); 45 | a429bnr& SetBNRPropertiesD(double range, int startbit, int endbit = 28, int signbit = 29); 46 | }; 47 | } 48 | 49 | #endif // OPENARINC_A429BNR_HPP 50 | -------------------------------------------------------------------------------- /ext/include/boost/test/detail/enable_warnings.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief enable previously suppressed warnings 10 | // *************************************************************************** 11 | 12 | #ifdef BOOST_MSVC 13 | # pragma warning(default: 4511) // copy constructor can't not be generated 14 | # pragma warning(default: 4512) // assignment operator can't not be generated 15 | # pragma warning(default: 4100) // unreferenced formal parameter 16 | # pragma warning(default: 4996) // was declared deprecated 17 | # pragma warning(default: 4355) // 'this' : used in base member initializer list 18 | # pragma warning(default: 4706) // assignment within conditional expression 19 | # pragma warning(default: 4251) // class 'A' needs to have dll-interface to be used by clients of class 'B' 20 | # pragma warning(default: 4127) // conditional expression is constant 21 | # pragma warning(default: 4290) // C++ exception specification ignored except to ... 22 | # pragma warning(default: 4180) // qualifier applied to function type has no meaning; ignored 23 | # pragma warning(default: 4275) // non dll-interface class ... used as base for dll-interface class ... 24 | # pragma warning(default: 4267) // 'var' : conversion from 'size_t' to 'type', possible loss of data 25 | # pragma warning(default: 4511) // 'class' : copy constructor could not be generated 26 | # pragma warning(pop) 27 | #endif 28 | 29 | #if BOOST_CLANG 30 | #pragma clang diagnostic pop 31 | #endif 32 | 33 | #if defined(BOOST_GCC) && (BOOST_GCC >= 4 * 10000 + 6 * 100) 34 | # pragma GCC diagnostic pop 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /ext/include/boost/test/test_exec_monitor.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// @brief Deprecated implementation of Test Execution Monitor 10 | /// 11 | /// To convert to Unit Test Framework simply rewrite: 12 | /// @code 13 | /// #include 14 | /// 15 | /// int test_main( int, char *[] ) 16 | /// { 17 | /// ... 18 | /// } 19 | /// @endcode 20 | /// as 21 | /// @code 22 | /// #include 23 | /// 24 | /// BOOST_AUTO_TEST_CASE(test_main) 25 | /// { 26 | /// ... 27 | /// } 28 | /// @endcode 29 | /// and link with boost_unit_test_framework library *instead of* boost_test_exec_monitor 30 | // *************************************************************************** 31 | 32 | #ifndef BOOST_TEST_EXEC_MONITOR_HPP_071894GER 33 | #define BOOST_TEST_EXEC_MONITOR_HPP_071894GER 34 | 35 | // Boost.Test 36 | #include 37 | 38 | //____________________________________________________________________________// 39 | 40 | // ************************************************************************** // 41 | // ************** Auto Linking ************** // 42 | // ************************************************************************** // 43 | 44 | // Automatically link to the correct build variant where possible. 45 | #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_TEST_NO_LIB) && \ 46 | !defined(BOOST_TEST_SOURCE) && !defined(BOOST_TEST_INCLUDED) 47 | 48 | # define BOOST_LIB_NAME boost_test_exec_monitor 49 | # include 50 | 51 | #endif // auto-linking disabled 52 | 53 | #endif // BOOST_TEST_EXEC_MONITOR_HPP_071894GER 54 | -------------------------------------------------------------------------------- /ext/include/boost/test/tree/visitor.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision: -1 $ 11 | // 12 | // Description : defines test_tree_visitor 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_TREE_VISITOR_HPP_100211GER 16 | #define BOOST_TEST_TREE_VISITOR_HPP_100211GER 17 | 18 | // Boost.Test 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | 25 | //____________________________________________________________________________// 26 | 27 | namespace boost { 28 | namespace unit_test { 29 | 30 | // ************************************************************************** // 31 | // ************** test_tree_visitor ************** // 32 | // ************************************************************************** // 33 | 34 | class BOOST_TEST_DECL test_tree_visitor { 35 | public: 36 | // test tree visitor interface 37 | virtual bool visit( test_unit const& ) { return true; } 38 | virtual void visit( test_case const& tc ) { visit( (test_unit const&)tc ); } 39 | virtual bool test_suite_start( test_suite const& ts ){ return visit( (test_unit const&)ts ); } 40 | virtual void test_suite_finish( test_suite const& ) {} 41 | 42 | protected: 43 | BOOST_TEST_PROTECTED_VIRTUAL ~test_tree_visitor() {} 44 | }; 45 | 46 | } // namespace unit_test 47 | } // namespace boost 48 | 49 | #include 50 | 51 | #endif // BOOST_TEST_TREE_VISITOR_HPP_100211GER 52 | 53 | -------------------------------------------------------------------------------- /ext/include/boost/test/detail/suppress_warnings.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief suppress some warnings 10 | // *************************************************************************** 11 | 12 | #ifdef BOOST_MSVC 13 | # pragma warning(push) 14 | # pragma warning(disable: 4511) // copy constructor can't not be generated 15 | # pragma warning(disable: 4512) // assignment operator can't not be generated 16 | # pragma warning(disable: 4100) // unreferenced formal parameter 17 | # pragma warning(disable: 4996) // was declared deprecated 18 | # pragma warning(disable: 4355) // 'this' : used in base member initializer list 19 | # pragma warning(disable: 4706) // assignment within conditional expression 20 | # pragma warning(disable: 4251) // class 'A' needs to have dll-interface to be used by clients of class 'B' 21 | # pragma warning(disable: 4127) // conditional expression is constant 22 | # pragma warning(disable: 4290) // C++ exception specification ignored except to ... 23 | # pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored 24 | # pragma warning(disable: 4275) // non dll-interface class ... used as base for dll-interface class ... 25 | # pragma warning(disable: 4267) // 'var' : conversion from 'size_t' to 'type', possible loss of data 26 | # pragma warning(disable: 4511) // 'class' : copy constructor could not be generated 27 | #endif 28 | 29 | #if BOOST_CLANG 30 | # pragma clang diagnostic push 31 | # pragma clang diagnostic ignored "-Wvariadic-macros" 32 | #endif 33 | 34 | #if defined(BOOST_GCC) && (BOOST_GCC >= 4 * 10000 + 6 * 100) 35 | # pragma GCC diagnostic push 36 | # pragma GCC diagnostic ignored "-Wvariadic-macros" 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/is_cstring.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : defines the is_cstring type trait 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_UTILS_IS_CSTRING_HPP 16 | #define BOOST_TEST_UTILS_IS_CSTRING_HPP 17 | 18 | // Boost 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | //____________________________________________________________________________// 25 | 26 | namespace boost { 27 | namespace unit_test { 28 | 29 | // ************************************************************************** // 30 | // ************** is_cstring ************** // 31 | // ************************************************************************** // 32 | 33 | namespace ut_detail { 34 | 35 | template 36 | struct is_cstring_impl : public mpl::false_ {}; 37 | 38 | template 39 | struct is_cstring_impl : public is_cstring_impl {}; 40 | 41 | template 42 | struct is_cstring_impl : public is_cstring_impl {}; 43 | 44 | template<> 45 | struct is_cstring_impl : public mpl::true_ {}; 46 | 47 | template<> 48 | struct is_cstring_impl : public mpl::true_ {}; 49 | 50 | } // namespace ut_detail 51 | 52 | template 53 | struct is_cstring : public ut_detail::is_cstring_impl::type> {}; 54 | 55 | } // namespace unit_test 56 | } // namespace boost 57 | 58 | #endif // BOOST_TEST_UTILS_IS_CSTRING_HPP 59 | -------------------------------------------------------------------------------- /ext/include/boost/test/output/xml_report_formatter.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : OF_XML report formatter implementation 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_XML_REPORT_FORMATTER_HPP_020105GER 16 | #define BOOST_TEST_XML_REPORT_FORMATTER_HPP_020105GER 17 | 18 | // Boost.Test 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | //____________________________________________________________________________// 25 | 26 | namespace boost { 27 | namespace unit_test { 28 | namespace output { 29 | 30 | // ************************************************************************** // 31 | // ************** xml_report_formatter ************** // 32 | // ************************************************************************** // 33 | 34 | class xml_report_formatter : public results_reporter::format { 35 | public: 36 | // Formatter interface 37 | void results_report_start( std::ostream& ostr ); 38 | void results_report_finish( std::ostream& ostr ); 39 | 40 | void test_unit_report_start( test_unit const&, std::ostream& ostr ); 41 | void test_unit_report_finish( test_unit const&, std::ostream& ostr ); 42 | 43 | void do_confirmation_report( test_unit const&, std::ostream& ostr ); 44 | }; 45 | 46 | } // namespace output 47 | } // namespace unit_test 48 | } // namespace boost 49 | 50 | #include 51 | 52 | #endif // BOOST_TEST_XML_REPORT_FORMATTER_HPP_020105GER 53 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/runtime/finalize.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : runtime parameters initialization final step 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP 16 | #define BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP 17 | 18 | // Boost.Test Runtime parameters 19 | #include 20 | #include 21 | 22 | // Boost.Test 23 | #include 24 | 25 | #include 26 | 27 | namespace boost { 28 | namespace runtime { 29 | 30 | inline void 31 | finalize_arguments( parameters_store const& params, runtime::arguments_store& args ) 32 | { 33 | BOOST_TEST_FOREACH( parameters_store::storage_type::value_type const&, v, params.all() ) { 34 | basic_param_ptr param = v.second; 35 | 36 | if( !args.has( param->p_name ) ) { 37 | if( param->p_has_default_value ) 38 | param->produce_default( args ); 39 | 40 | if( !args.has( param->p_name ) ) { 41 | BOOST_TEST_I_ASSRT( param->p_optional, 42 | missing_req_arg( param->p_name ) << "Missing argument for required parameter " << param->p_name << "." ); 43 | } 44 | } 45 | 46 | if( args.has( param->p_name ) && !!param->p_callback ) 47 | param->p_callback( param->p_name ); 48 | } 49 | } 50 | 51 | } // namespace runtime 52 | } // namespace boost 53 | 54 | #include 55 | 56 | #endif // BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP 57 | -------------------------------------------------------------------------------- /ext/include/boost/test/detail/pp_variadic.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief few helpers for working with variadic macros 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_PP_VARIADIC_HPP_021515GER 13 | #define BOOST_TEST_PP_VARIADIC_HPP_021515GER 14 | 15 | // Boost 16 | #include 17 | #include 18 | #include 19 | 20 | //____________________________________________________________________________// 21 | 22 | #if BOOST_PP_VARIADICS 23 | 24 | #if BOOST_PP_VARIADICS_MSVC 25 | # define BOOST_TEST_INVOKE_VARIADIC( tool, ... ) BOOST_PP_CAT( tool (__VA_ARGS__), ) 26 | #else 27 | # define BOOST_TEST_INVOKE_VARIADIC( tool, ... ) tool (__VA_ARGS__) 28 | #endif 29 | 30 | //____________________________________________________________________________// 31 | 32 | /// if sizeof(__VA_ARGS__) == N: F1(__VA_ARGS__) 33 | /// else: F2(__VA_ARGS__) 34 | #define BOOST_TEST_INVOKE_IF_N_ARGS( N, F1, F2, ... ) \ 35 | BOOST_TEST_INVOKE_VARIADIC( \ 36 | BOOST_PP_IIF( \ 37 | BOOST_PP_EQUAL(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), N), \ 38 | F1, \ 39 | F2), \ 40 | __VA_ARGS__ ) \ 41 | /**/ 42 | 43 | //____________________________________________________________________________// 44 | 45 | #endif /* BOOST_PP_VARIADICS */ 46 | 47 | #endif // BOOST_TEST_PP_VARIADIC_HPP_021515GER 48 | 49 | // EOF 50 | -------------------------------------------------------------------------------- /ext/include/boost/test/tree/test_case_counter.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision: 74640 $ 11 | // 12 | // Description : defines test_case_counter 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_TREE_TEST_CASE_COUNTER_HPP_100211GER 16 | #define BOOST_TEST_TREE_TEST_CASE_COUNTER_HPP_100211GER 17 | 18 | // Boost.Test 19 | #include 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | //____________________________________________________________________________// 28 | 29 | namespace boost { 30 | namespace unit_test { 31 | 32 | // ************************************************************************** // 33 | // ************** test_case_counter ************** // 34 | // ************************************************************************** // 35 | 36 | class test_case_counter : public test_tree_visitor { 37 | public: 38 | // Constructor 39 | test_case_counter() : p_count( 0 ) {} 40 | 41 | BOOST_READONLY_PROPERTY( counter_t, (test_case_counter)) p_count; 42 | private: 43 | // test tree visitor interface 44 | virtual void visit( test_case const& tc ) { if( tc.is_enabled() ) ++p_count.value; } 45 | virtual bool test_suite_start( test_suite const& ts ) { return ts.is_enabled(); } 46 | }; 47 | 48 | } // namespace unit_test 49 | } // namespace boost 50 | 51 | #include 52 | 53 | #endif // BOOST_TEST_TREE_TEST_CASE_COUNTER_HPP_100211GER 54 | 55 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/rtti.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : simple facilities for accessing type information at runtime 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_UTILS_RTTI_HPP 16 | #define BOOST_TEST_UTILS_RTTI_HPP 17 | 18 | // C Runtime 19 | #include 20 | 21 | namespace boost { 22 | namespace rtti { 23 | 24 | // ************************************************************************** // 25 | // ************** rtti::type_id ************** // 26 | // ************************************************************************** // 27 | 28 | typedef std::ptrdiff_t id_t; 29 | 30 | namespace rtti_detail { 31 | 32 | template 33 | struct rttid_holder { 34 | static id_t id() { return reinterpret_cast( &inst() ); } 35 | 36 | private: 37 | struct rttid {}; 38 | 39 | static rttid const& inst() { static rttid s_inst; return s_inst; } 40 | }; 41 | 42 | } // namespace rtti_detail 43 | 44 | //____________________________________________________________________________// 45 | 46 | template 47 | inline id_t 48 | type_id() 49 | { 50 | return rtti_detail::rttid_holder::id(); 51 | } 52 | 53 | //____________________________________________________________________________// 54 | 55 | #define BOOST_RTTI_SWITCH( type_id_ ) if( ::boost::rtti::id_t switch_by_id = type_id_ ) 56 | #define BOOST_RTTI_CASE( type ) if( switch_by_id == ::boost::rtti::type_id() ) 57 | 58 | //____________________________________________________________________________// 59 | 60 | } // namespace rtti 61 | } // namespace boost 62 | 63 | #endif // BOOST_TEST_UTILS_RTTI_HPP 64 | -------------------------------------------------------------------------------- /ext/include/boost/test/tree/auto_registration.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision: 74640 $ 11 | // 12 | // Description : defines auto_test_unit_registrar 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_TREE_AUTO_REGISTRATION_HPP_100211GER 16 | #define BOOST_TEST_TREE_AUTO_REGISTRATION_HPP_100211GER 17 | 18 | // Boost.Test 19 | #include 20 | #include 21 | #include 22 | 23 | // STL 24 | #include 25 | 26 | #include 27 | 28 | //____________________________________________________________________________// 29 | 30 | namespace boost { 31 | namespace unit_test { 32 | namespace ut_detail { 33 | 34 | // ************************************************************************** // 35 | // ************** auto_test_unit_registrar ************** // 36 | // ************************************************************************** // 37 | 38 | struct BOOST_TEST_DECL auto_test_unit_registrar { 39 | // Constructors 40 | auto_test_unit_registrar( test_case* tc, decorator::collector& decorators, counter_t exp_fail = 0 ); 41 | explicit auto_test_unit_registrar( const_string ts_name, const_string ts_file, std::size_t ts_line, decorator::collector& decorators ); 42 | explicit auto_test_unit_registrar( test_unit_generator const& tc_gen, decorator::collector& decorators ); 43 | explicit auto_test_unit_registrar( int ); 44 | }; 45 | 46 | } // namespace ut_detail 47 | } // namespace unit_test 48 | } // namespace boost 49 | 50 | #include 51 | 52 | #endif // BOOST_TEST_TREE_AUTO_REGISTRATION_HPP_100211GER 53 | 54 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/custom_manip.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : simple helpers for creating cusom output manipulators 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_UTILS_CUSTOM_MANIP_HPP 16 | #define BOOST_TEST_UTILS_CUSTOM_MANIP_HPP 17 | 18 | // STL 19 | #include 20 | 21 | #include 22 | 23 | //____________________________________________________________________________// 24 | 25 | namespace boost { 26 | namespace unit_test { 27 | namespace utils { 28 | 29 | // ************************************************************************** // 30 | // ************** custom manipulators helpers ************** // 31 | // ************************************************************************** // 32 | 33 | template 34 | struct custom_printer { 35 | explicit custom_printer( std::ostream& ostr ) : m_ostr( &ostr ) {} 36 | 37 | std::ostream& operator*() const { return *m_ostr; } 38 | 39 | private: 40 | std::ostream* const m_ostr; 41 | }; 42 | 43 | //____________________________________________________________________________// 44 | 45 | template struct custom_manip {}; 46 | 47 | //____________________________________________________________________________// 48 | 49 | template 50 | inline custom_printer > 51 | operator<<( std::ostream& ostr, custom_manip const& ) { return custom_printer >( ostr ); } 52 | 53 | //____________________________________________________________________________// 54 | 55 | } // namespace utils 56 | } // namespace unit_test 57 | } // namespace boost 58 | 59 | #include 60 | 61 | #endif // BOOST_TEST_UTILS_CUSTOM_MANIP_HPP 62 | -------------------------------------------------------------------------------- /ext/include/boost/test/output/plain_report_formatter.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : plain report formatter implementation 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_PLAIN_REPORT_FORMATTER_HPP_020105GER 16 | #define BOOST_TEST_PLAIN_REPORT_FORMATTER_HPP_020105GER 17 | 18 | // Boost.Test 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | //____________________________________________________________________________// 25 | 26 | namespace boost { 27 | namespace unit_test { 28 | namespace output { 29 | 30 | // ************************************************************************** // 31 | // ************** plain_report_formatter ************** // 32 | // ************************************************************************** // 33 | 34 | class plain_report_formatter : public results_reporter::format { 35 | public: 36 | plain_report_formatter() : m_indent( 0 ), m_color_output( false ) {} 37 | 38 | // Formatter interface 39 | void results_report_start( std::ostream& ostr ); 40 | void results_report_finish( std::ostream& ostr ); 41 | 42 | void test_unit_report_start( test_unit const&, std::ostream& ostr ); 43 | void test_unit_report_finish( test_unit const&, std::ostream& ostr ); 44 | 45 | void do_confirmation_report( test_unit const&, std::ostream& ostr ); 46 | 47 | private: 48 | // Data members 49 | counter_t m_indent; 50 | bool m_color_output; 51 | }; 52 | 53 | } // namespace output 54 | } // namespace unit_test 55 | } // namespace boost 56 | 57 | #include 58 | 59 | #endif // BOOST_TEST_PLAIN_REPORT_FORMATTER_HPP_020105GER 60 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/index_sequence.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// Defines c++14 index_sequence implementation 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_INDEX_SEQUENCE_HPP 13 | #define BOOST_TEST_DATA_INDEX_SEQUENCE_HPP 14 | 15 | // Boost.Test 16 | #include 17 | 18 | #include 19 | 20 | //____________________________________________________________________________// 21 | 22 | namespace boost { 23 | namespace unit_test { 24 | namespace data { 25 | 26 | // ************************************************************************** // 27 | // ************** data::index_sequence ************** // 28 | // ************************************************************************** // 29 | 30 | template 31 | struct index_sequence {}; 32 | 33 | template 34 | struct merge_index_sequence; 35 | 36 | template 37 | struct merge_index_sequence, index_sequence> { 38 | typedef index_sequence type; 39 | }; 40 | 41 | template 42 | struct make_index_sequence { 43 | typedef typename merge_index_sequence::type, 44 | typename make_index_sequence<(B+E)/2,E>::type>::type type; 45 | }; 46 | 47 | template 48 | struct make_index_sequence::type> { 49 | typedef index_sequence type; 50 | }; 51 | 52 | template 53 | using index_sequence_for = typename make_index_sequence<0, sizeof...(T)>::type; 54 | 55 | } // namespace data 56 | } // namespace unit_test 57 | } // namespace boost 58 | 59 | #include 60 | 61 | #endif // BOOST_TEST_DATA_INDEX_SEQUENCE_HPP 62 | 63 | -------------------------------------------------------------------------------- /ext/include/boost/test/tree/global_fixture.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision: 74640 $ 11 | // 12 | // Description : defines global_fixture 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_TREE_GLOBAL_FIXTURE_HPP_091911GER 16 | #define BOOST_TEST_TREE_GLOBAL_FIXTURE_HPP_091911GER 17 | 18 | // Boost.Test 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | #include 25 | 26 | 27 | //____________________________________________________________________________// 28 | 29 | namespace boost { 30 | namespace unit_test { 31 | 32 | // ************************************************************************** // 33 | // ************** global_fixture ************** // 34 | // ************************************************************************** // 35 | 36 | class BOOST_TEST_DECL global_fixture : public test_observer { 37 | public: 38 | // Constructor 39 | global_fixture(); 40 | }; 41 | 42 | //____________________________________________________________________________// 43 | 44 | namespace ut_detail { 45 | 46 | template 47 | struct global_fixture_impl : public global_fixture { 48 | // Constructor 49 | global_fixture_impl() : m_fixture( 0 ) {} 50 | 51 | // test observer interface 52 | virtual void test_start( counter_t ) { m_fixture = new F; } 53 | virtual void test_finish() { delete m_fixture; m_fixture = 0; } 54 | virtual void test_aborted() { delete m_fixture; m_fixture = 0; } 55 | 56 | private: 57 | // Data members 58 | F* m_fixture; 59 | }; 60 | 61 | } // namespace ut_detail 62 | } // namespace unit_test 63 | } // namespace boost 64 | 65 | #include 66 | 67 | #endif // BOOST_TEST_TREE_GLOBAL_FIXTURE_HPP_091911GER 68 | 69 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/string_cast.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : trivial utility to cast to/from strings 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_UTILS_STRING_CAST_HPP 16 | #define BOOST_TEST_UTILS_STRING_CAST_HPP 17 | 18 | // Boost.Test 19 | #include 20 | 21 | // STL 22 | #include 23 | 24 | #include 25 | 26 | //____________________________________________________________________________// 27 | 28 | namespace boost { 29 | namespace unit_test { 30 | namespace utils { 31 | 32 | // ************************************************************************** // 33 | // ************** string_cast ************** // 34 | // ************************************************************************** // 35 | 36 | template 37 | inline std::string 38 | string_cast( T const& t ) 39 | { 40 | std::ostringstream buff; 41 | buff << t; 42 | return buff.str(); 43 | } 44 | 45 | //____________________________________________________________________________// 46 | 47 | // ************************************************************************** // 48 | // ************** string_as ************** // 49 | // ************************************************************************** // 50 | 51 | template 52 | inline bool 53 | string_as( const_string str, T& res ) 54 | { 55 | std::istringstream buff( std::string( str.begin(), str.end() ) ); 56 | buff >> res; 57 | 58 | return !buff.fail() && buff.eof(); 59 | } 60 | 61 | //____________________________________________________________________________// 62 | 63 | } // namespace utils 64 | } // namespace unit_test 65 | } // namespace boost 66 | 67 | #include 68 | 69 | #endif // BOOST_TEST_UTILS_STRING_CAST_HPP 70 | -------------------------------------------------------------------------------- /ext/include/boost/test/unit_test_monitor.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// @brief defines specific version of execution monitor used to managed run unit of test cases 10 | /// 11 | /// Translates execution exception into error level 12 | // *************************************************************************** 13 | 14 | #ifndef BOOST_TEST_UNIT_TEST_MONITOR_HPP_020905GER 15 | #define BOOST_TEST_UNIT_TEST_MONITOR_HPP_020905GER 16 | 17 | // Boost.Test 18 | #include 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | //____________________________________________________________________________// 25 | 26 | namespace boost { 27 | namespace unit_test { 28 | 29 | // ************************************************************************** // 30 | // ************** unit_test_monitor ************** // 31 | // ************************************************************************** // 32 | 33 | class BOOST_TEST_DECL unit_test_monitor_t : public singleton, public execution_monitor { 34 | public: 35 | enum error_level { 36 | test_ok = 0, 37 | precondition_failure = -1, 38 | unexpected_exception = -2, 39 | os_exception = -3, 40 | os_timeout = -4, 41 | fatal_error = -5 // includes both system and user 42 | }; 43 | 44 | static bool is_critical_error( error_level e ) { return e <= fatal_error; } 45 | 46 | // monitor method 47 | error_level execute_and_translate( boost::function const& func, unsigned timeout = 0 ); 48 | 49 | private: 50 | BOOST_TEST_SINGLETON_CONS( unit_test_monitor_t ) 51 | }; 52 | 53 | BOOST_TEST_SINGLETON_INST( unit_test_monitor ) 54 | 55 | } // namespace unit_test 56 | } // namespace boost 57 | 58 | #include 59 | 60 | #endif // BOOST_TEST_UNIT_TEST_MONITOR_HPP_020905GER 61 | -------------------------------------------------------------------------------- /ext/include/boost/test/tree/traverse.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision: -1 $ 11 | // 12 | // Description : defines traverse_test_tree algorithm 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_TREE_TRAVERSE_HPP_100211GER 16 | #define BOOST_TEST_TREE_TRAVERSE_HPP_100211GER 17 | 18 | // Boost.Test 19 | #include 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | 27 | //____________________________________________________________________________// 28 | 29 | namespace boost { 30 | namespace unit_test { 31 | 32 | // ************************************************************************** // 33 | // ************** traverse_test_tree ************** // 34 | // ************************************************************************** // 35 | 36 | BOOST_TEST_DECL void traverse_test_tree( test_case const&, test_tree_visitor&, bool ignore_status = false ); 37 | BOOST_TEST_DECL void traverse_test_tree( test_suite const&, test_tree_visitor&, bool ignore_status = false ); 38 | BOOST_TEST_DECL void traverse_test_tree( test_unit_id , test_tree_visitor&, bool ignore_status = false ); 39 | 40 | //____________________________________________________________________________// 41 | 42 | inline void 43 | traverse_test_tree( test_unit const& tu, test_tree_visitor& V, bool ignore_status = false ) 44 | { 45 | if( tu.p_type == TUT_CASE ) 46 | traverse_test_tree( static_cast( tu ), V, ignore_status ); 47 | else 48 | traverse_test_tree( static_cast( tu ), V, ignore_status ); 49 | } 50 | 51 | //____________________________________________________________________________// 52 | 53 | } // namespace unit_test 54 | } // namespace boost 55 | 56 | #include 57 | 58 | #endif // BOOST_TEST_TREE_TRAVERSE_HPP_100211GER 59 | -------------------------------------------------------------------------------- /ext/include/boost/test/impl/test_main.ipp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // (C) Copyright Beman Dawes 1995-2001. 3 | // Distributed under the Boost Software License, Version 1.0. 4 | // (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | // See http://www.boost.org/libs/test for the library home page. 8 | // 9 | /// @file 10 | /// @brief Implements main function for Test Execution Monitor. 11 | // *************************************************************************** 12 | 13 | #ifndef BOOST_TEST_TEST_MAIN_IPP_012205GER 14 | #define BOOST_TEST_TEST_MAIN_IPP_012205GER 15 | 16 | // Boost.Test 17 | #include 18 | #include 19 | #include 20 | 21 | // Boost 22 | #include 23 | 24 | #include 25 | 26 | //____________________________________________________________________________// 27 | 28 | extern int test_main( int argc, char* argv[] ); // prototype for user's test_main() 29 | 30 | struct test_main_caller { 31 | test_main_caller( int argc, char** argv ) : m_argc( argc ), m_argv( argv ) {} 32 | 33 | void operator()() { 34 | int test_main_result = test_main( m_argc, m_argv ); 35 | 36 | // translate a test_main non-success return into a test error 37 | BOOST_CHECK( test_main_result == 0 || test_main_result == boost::exit_success ); 38 | } 39 | 40 | private: 41 | // Data members 42 | int m_argc; 43 | char** m_argv; 44 | }; 45 | 46 | // ************************************************************************** // 47 | // ************** test main ************** // 48 | // ************************************************************************** // 49 | 50 | ::boost::unit_test::test_suite* 51 | init_unit_test_suite( int argc, char* argv[] ) { 52 | using namespace ::boost::unit_test; 53 | 54 | framework::master_test_suite().p_name.value = "Test Program"; 55 | 56 | framework::master_test_suite().add( BOOST_TEST_CASE( test_main_caller( argc, argv ) ) ); 57 | 58 | return 0; 59 | } 60 | 61 | //____________________________________________________________________________// 62 | 63 | #include 64 | 65 | #endif // BOOST_TEST_TEST_MAIN_IPP_012205GER 66 | -------------------------------------------------------------------------------- /ext/include/boost/test/detail/throw_exception.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief contains wrappers, which allows to build Boost.Test with no exception 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DETAIL_THROW_EXCEPTION_HPP 13 | #define BOOST_TEST_DETAIL_THROW_EXCEPTION_HPP 14 | 15 | // Boost 16 | #include // BOOST_NO_EXCEPTION 17 | 18 | #ifdef BOOST_NO_EXCEPTION 19 | // C RUNTIME 20 | #include 21 | 22 | #endif 23 | 24 | #include 25 | 26 | //____________________________________________________________________________// 27 | 28 | namespace boost { 29 | namespace unit_test { 30 | namespace ut_detail { 31 | 32 | #ifdef BOOST_NO_EXCEPTIONS 33 | 34 | template 35 | BOOST_NORETURN inline void 36 | throw_exception(E const& e) { abort(); } 37 | 38 | #define BOOST_TEST_I_TRY 39 | #define BOOST_TEST_I_CATCH( T, var ) for(T const& var = *(T*)0; false;) 40 | #define BOOST_TEST_I_CATCH0( T ) if(0) 41 | #define BOOST_TEST_I_CATCHALL() if(0) 42 | #define BOOST_TEST_I_RETHROW 43 | 44 | #else 45 | 46 | template 47 | BOOST_NORETURN inline void 48 | throw_exception(E const& e) { throw e; } 49 | 50 | #define BOOST_TEST_I_TRY try 51 | #define BOOST_TEST_I_CATCH( T, var ) catch( T const& var ) 52 | #define BOOST_TEST_I_CATCH0( T ) catch( T const& ) 53 | #define BOOST_TEST_I_CATCHALL() catch(...) 54 | #define BOOST_TEST_I_RETHROW throw 55 | #endif 56 | 57 | //____________________________________________________________________________// 58 | 59 | #define BOOST_TEST_I_THROW( E ) unit_test::ut_detail::throw_exception( E ) 60 | #define BOOST_TEST_I_THROW( E ) unit_test::ut_detail::throw_exception( E ) 61 | #define BOOST_TEST_I_ASSRT( cond, ex ) if( cond ) {} else BOOST_TEST_I_THROW( ex ) 62 | 63 | 64 | } // namespace ut_detail 65 | } // namespace unit_test 66 | } // namespace boost 67 | 68 | //____________________________________________________________________________// 69 | 70 | #include 71 | 72 | #endif // BOOST_TEST_DETAIL_THROW_EXCEPTION_HPP 73 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/basic_cstring/io.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : basic_cstring i/o implementation 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_UTILS_BASIC_CSTRING_IO_HPP 16 | #define BOOST_TEST_UTILS_BASIC_CSTRING_IO_HPP 17 | 18 | // Boost.Test 19 | #include 20 | 21 | // STL 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | //____________________________________________________________________________// 28 | 29 | namespace boost { 30 | 31 | namespace unit_test { 32 | 33 | #ifdef BOOST_CLASSIC_IOSTREAMS 34 | 35 | template 36 | inline std::ostream& 37 | operator<<( std::ostream& os, basic_cstring const& str ) 38 | { 39 | typedef typename ut_detail::bcs_base_char::type char_type; 40 | char_type const* const beg = reinterpret_cast( str.begin() ); 41 | char_type const* const end = reinterpret_cast( str.end() ); 42 | os << std::basic_string( beg, end - beg ); 43 | 44 | return os; 45 | } 46 | 47 | #else 48 | 49 | template 50 | inline std::basic_ostream& 51 | operator<<( std::basic_ostream& os, basic_cstring const& str ) 52 | { 53 | CharT1 const* const beg = reinterpret_cast( str.begin() ); // !! 54 | CharT1 const* const end = reinterpret_cast( str.end() ); 55 | os << std::basic_string( beg, end - beg ); 56 | 57 | return os; 58 | } 59 | 60 | #endif 61 | 62 | //____________________________________________________________________________// 63 | 64 | 65 | } // namespace unit_test 66 | 67 | } // namespace boost 68 | 69 | //____________________________________________________________________________// 70 | 71 | #include 72 | 73 | #endif // BOOST_TEST_BASIC_CSTRING_IO_HPP_071894GER 74 | -------------------------------------------------------------------------------- /ext/include/boost/test/progress_monitor.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// @brief defines simple text based progress monitor 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER 13 | #define BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | 19 | // STL 20 | #include // for std::ostream& 21 | 22 | #include 23 | 24 | //____________________________________________________________________________// 25 | 26 | namespace boost { 27 | namespace unit_test { 28 | 29 | // ************************************************************************** // 30 | // ************** progress_monitor ************** // 31 | // ************************************************************************** // 32 | 33 | /// This class implements test observer interface and updates test progress as test units finish or get aborted 34 | class BOOST_TEST_DECL progress_monitor_t : public test_observer, public singleton { 35 | public: 36 | /// @name Test observer interface 37 | /// @{ 38 | virtual void test_start( counter_t test_cases_amount ); 39 | virtual void test_aborted(); 40 | 41 | virtual void test_unit_finish( test_unit const&, unsigned long ); 42 | virtual void test_unit_skipped( test_unit const&, const_string ); 43 | 44 | virtual int priority() { return 3; } 45 | /// @} 46 | 47 | /// @name Configuration 48 | /// @{ 49 | void set_stream( std::ostream& ); 50 | /// @} 51 | 52 | private: 53 | BOOST_TEST_SINGLETON_CONS( progress_monitor_t ) 54 | }; // progress_monitor_t 55 | 56 | BOOST_TEST_SINGLETON_INST( progress_monitor ) 57 | 58 | } // namespace unit_test 59 | } // namespace boost 60 | 61 | //____________________________________________________________________________// 62 | 63 | #include 64 | 65 | #endif // BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER 66 | 67 | -------------------------------------------------------------------------------- /ext/include/boost/test/tools/detail/expression_holder.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision: 74248 $ 11 | // 12 | // Description : toolbox implementation details 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_TOOLS_DETAIL_EXPRESSION_HOLDER_HPP_012705GER 16 | #define BOOST_TEST_TOOLS_DETAIL_EXPRESSION_HOLDER_HPP_012705GER 17 | 18 | #ifdef BOOST_NO_CXX11_AUTO_DECLARATIONS 19 | 20 | #include 21 | 22 | //____________________________________________________________________________// 23 | 24 | namespace boost { 25 | namespace test_tools { 26 | namespace tt_detail { 27 | 28 | // ************************************************************************** // 29 | // ************** tt_detail::expression_holder ************** // 30 | // ************************************************************************** // 31 | 32 | class expression_holder { 33 | public: 34 | virtual ~expression_holder() {} 35 | virtual assertion_result evaluate( bool no_message = false ) const = 0; 36 | }; 37 | 38 | //____________________________________________________________________________// 39 | 40 | template 41 | class expression_holder_t: public expression_holder { 42 | public: 43 | explicit expression_holder_t( E const& e ) : m_expr( e ) {} 44 | 45 | private: 46 | virtual assertion_result evaluate( bool no_message = false ) const { return m_expr.evaluate( no_message ); } 47 | 48 | E m_expr; 49 | }; 50 | 51 | //____________________________________________________________________________// 52 | 53 | template 54 | expression_holder_t 55 | hold_expression( E const& e ) 56 | { 57 | return expression_holder_t( e ); 58 | } 59 | 60 | //____________________________________________________________________________// 61 | 62 | } // namespace tt_detail 63 | } // namespace test_tools 64 | } // namespace boost 65 | 66 | #include 67 | 68 | #endif 69 | 70 | #endif // BOOST_TEST_TOOLS_DETAIL_EXPRESSION_HOLDER_HPP_012705GER 71 | -------------------------------------------------------------------------------- /ext/include/boost/test/tools/context.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision: 74248 $ 11 | // 12 | // Description : test tools context interfaces 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER 16 | #define BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER 17 | 18 | // Boost.Test 19 | #include 20 | 21 | #include 22 | 23 | //____________________________________________________________________________// 24 | 25 | namespace boost { 26 | namespace test_tools { 27 | namespace tt_detail { 28 | 29 | // ************************************************************************** // 30 | // ************** context_frame ************** // 31 | // ************************************************************************** // 32 | 33 | struct BOOST_TEST_DECL context_frame { 34 | explicit context_frame( ::boost::unit_test::lazy_ostream const& context_descr ); 35 | ~context_frame(); 36 | 37 | operator bool(); 38 | 39 | private: 40 | // Data members 41 | int m_frame_id; 42 | }; 43 | 44 | //____________________________________________________________________________// 45 | 46 | #define BOOST_TEST_INFO( context_descr ) \ 47 | ::boost::unit_test::framework::add_context( BOOST_TEST_LAZY_MSG( context_descr ) , false ) \ 48 | /**/ 49 | 50 | //____________________________________________________________________________// 51 | 52 | #define BOOST_TEST_CONTEXT( context_descr ) \ 53 | if( ::boost::test_tools::tt_detail::context_frame BOOST_JOIN( context_frame_, __LINE__ ) = \ 54 | ::boost::test_tools::tt_detail::context_frame( BOOST_TEST_LAZY_MSG( context_descr ) ) ) \ 55 | /**/ 56 | 57 | //____________________________________________________________________________// 58 | 59 | } // namespace tt_detail 60 | } // namespace test_tools 61 | } // namespace boost 62 | 63 | #include 64 | 65 | #endif // BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER 66 | -------------------------------------------------------------------------------- /ext/include/boost/test/test_tools.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// @brief test tools compatibility header 10 | /// 11 | /// This file is used to select the test tools implementation and includes all the necessary headers 12 | // *************************************************************************** 13 | 14 | #ifndef BOOST_TEST_TOOLS_HPP_111812GER 15 | #define BOOST_TEST_TOOLS_HPP_111812GER 16 | 17 | #include 18 | 19 | // brings some compiler configuration like BOOST_PP_VARIADICS 20 | #include 21 | 22 | #include 23 | 24 | #if defined(BOOST_NO_CXX11_VARIADIC_MACROS) \ 25 | || defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) \ 26 | || defined(BOOST_NO_CXX11_DECLTYPE) 27 | # define BOOST_TEST_MACRO_LIMITED_SUPPORT 28 | #endif 29 | 30 | // Boost.Test 31 | // #define BOOST_TEST_NO_OLD_TOOLS 32 | 33 | #if defined(BOOST_TEST_MACRO_LIMITED_SUPPORT) \ 34 | && ( !BOOST_PP_VARIADICS \ 35 | || !(__cplusplus >= 201103L) && defined(BOOST_NO_CXX11_VARIADIC_MACROS)) 36 | # define BOOST_TEST_NO_NEW_TOOLS 37 | #endif 38 | 39 | // #define BOOST_TEST_TOOLS_UNDER_DEBUGGER 40 | // #define BOOST_TEST_TOOLS_DEBUGGABLE 41 | 42 | #include 43 | 44 | #ifndef BOOST_TEST_NO_OLD_TOOLS 45 | # include 46 | # include 47 | 48 | # include 49 | #endif 50 | 51 | #ifndef BOOST_TEST_NO_NEW_TOOLS 52 | # include 53 | # include 54 | # include 55 | # include 56 | # include 57 | 58 | # include 59 | # include 60 | # include 61 | 62 | # include 63 | # include 64 | # include 65 | # include 66 | #endif 67 | 68 | #endif // BOOST_TEST_TOOLS_HPP_111812GER 69 | -------------------------------------------------------------------------------- /ext/include/boost/test/tools/detail/it_pair.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision: 74248 $ 11 | // 12 | // Description : support for backward compatible collection comparison interface 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_TOOLS_DETAIL_IT_PAIR_HPP_112812GER 16 | #define BOOST_TEST_TOOLS_DETAIL_IT_PAIR_HPP_112812GER 17 | 18 | #ifdef BOOST_TEST_NO_OLD_TOOLS 19 | 20 | #include 21 | 22 | //____________________________________________________________________________// 23 | 24 | namespace boost { 25 | namespace test_tools { 26 | namespace tt_detail { 27 | 28 | // ************************************************************************** // 29 | // ************** backward compatibility support ************** // 30 | // ************************************************************************** // 31 | 32 | template 33 | struct it_pair { 34 | typedef It const_iterator; 35 | typedef typename std::iterator_traits::value_type value_type; 36 | 37 | it_pair( It const& b, It const& e ) : m_begin( b ), m_size( 0 ) 38 | { 39 | It tmp = b; 40 | while( tmp != e ) { ++m_size; ++tmp; } 41 | } 42 | 43 | It begin() const { return m_begin; } 44 | It end() const { return m_begin + m_size; } 45 | size_t size() const { return m_size; } 46 | 47 | private: 48 | It m_begin; 49 | size_t m_size; 50 | }; 51 | 52 | //____________________________________________________________________________// 53 | 54 | template 55 | it_pair 56 | make_it_pair( It const& b, It const& e ) { return it_pair( b, e ); } 57 | 58 | //____________________________________________________________________________// 59 | 60 | template 61 | it_pair 62 | make_it_pair( T const* b, T const* e ) { return it_pair( b, e ); } 63 | 64 | //____________________________________________________________________________// 65 | 66 | } // namespace tt_detail 67 | } // namespace test_tools 68 | } // namespace boost 69 | 70 | #include 71 | 72 | #endif // BOOST_TEST_NO_OLD_TOOLS 73 | 74 | #endif // BOOST_TEST_TOOLS_DETAIL_IT_PAIR_HPP_112812GER 75 | -------------------------------------------------------------------------------- /ext/include/boost/test/tools/detail/per_element_manip.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //! @file 9 | //! Per element comparison manipulator implementation 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_TOOLS_DETAIL_PER_ELEMENT_MANIP_HPP_050815GER 13 | #define BOOST_TEST_TOOLS_DETAIL_PER_ELEMENT_MANIP_HPP_050815GER 14 | 15 | // Boost Test 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | //____________________________________________________________________________// 25 | 26 | namespace boost { 27 | namespace test_tools { 28 | 29 | // ************************************************************************** // 30 | // ************** per element comparison manipulator ************** // 31 | // ************************************************************************** // 32 | 33 | //! Per element comparison manipulator, for containers 34 | struct per_element {}; 35 | 36 | //____________________________________________________________________________// 37 | 38 | inline int 39 | operator<<( unit_test::lazy_ostream const&, per_element ) { return 0; } 40 | 41 | //____________________________________________________________________________// 42 | 43 | namespace tt_detail { 44 | 45 | template 46 | inline assertion_result 47 | operator<<(assertion_evaluate_t > const& ae, per_element ) 48 | { 49 | typedef typename OP::elem_op elem_op; 50 | return assertion::op::element_compare( ae.m_e.lhs().value(), ae.m_e.rhs() ); 51 | } 52 | 53 | //____________________________________________________________________________// 54 | 55 | inline check_type 56 | operator<<( assertion_type const&, per_element ) 57 | { 58 | return CHECK_BUILT_ASSERTION; 59 | } 60 | 61 | //____________________________________________________________________________// 62 | 63 | } // namespace tt_detail 64 | } // namespace test_tools 65 | } // namespace boost 66 | 67 | #include 68 | 69 | #endif // BOOST_TEST_TOOLS_DETAIL_PER_ELEMENT_MANIP_HPP_050815GER 70 | -------------------------------------------------------------------------------- /ext/include/boost/test/tools/detail/lexicographic_manip.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //! @file 9 | //! Lexicographic comparison manipulator implementation 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_TOOLS_DETAIL_LEXICOGRAPHIC_MANIP_HPP_050815GER 13 | #define BOOST_TEST_TOOLS_DETAIL_LEXICOGRAPHIC_MANIP_HPP_050815GER 14 | 15 | // Boost Test 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | //____________________________________________________________________________// 25 | 26 | namespace boost { 27 | namespace test_tools { 28 | 29 | // ************************************************************************** // 30 | // ************** per element comparison manipulator ************** // 31 | // ************************************************************************** // 32 | 33 | //! Lexicographic comparison manipulator, for containers 34 | struct lexicographic {}; 35 | 36 | //____________________________________________________________________________// 37 | 38 | inline int 39 | operator<<( unit_test::lazy_ostream const&, lexicographic ) { return 0; } 40 | 41 | //____________________________________________________________________________// 42 | 43 | namespace tt_detail { 44 | 45 | template 46 | inline assertion_result 47 | operator<<(assertion_evaluate_t > const& ae, lexicographic ) 48 | { 49 | typedef typename OP::elem_op elem_op; 50 | return assertion::op::lexicographic_compare( ae.m_e.lhs().value(), ae.m_e.rhs() ); 51 | } 52 | 53 | //____________________________________________________________________________// 54 | 55 | inline check_type 56 | operator<<( assertion_type const&, lexicographic ) 57 | { 58 | return CHECK_BUILT_ASSERTION; 59 | } 60 | 61 | //____________________________________________________________________________// 62 | 63 | } // namespace tt_detail 64 | } // namespace test_tools 65 | } // namespace boost 66 | 67 | #include 68 | 69 | #endif // BOOST_TEST_TOOLS_DETAIL_LEXICOGRAPHIC_MANIP_HPP_050815GER 70 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/monomorphic/array.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | ///@file 9 | ///Defines monomorphic dataset based on C type arrays 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_MONOMORPHIC_ARRAY_HPP_121411GER 13 | #define BOOST_TEST_DATA_MONOMORPHIC_ARRAY_HPP_121411GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | //____________________________________________________________________________// 22 | 23 | namespace boost { 24 | namespace unit_test { 25 | namespace data { 26 | namespace monomorphic { 27 | 28 | // ************************************************************************** // 29 | // ************** array ************** // 30 | // ************************************************************************** // 31 | 32 | /// Dataset view of a C array 33 | template 34 | class array { 35 | public: 36 | typedef T sample; 37 | 38 | enum { arity = 1 }; 39 | 40 | typedef T const* iterator; 41 | 42 | // Constructor 43 | array( T const* arr_, std::size_t size_ ) 44 | : m_arr( arr_ ) 45 | , m_size( size_ ) 46 | {} 47 | 48 | // dataset interface 49 | data::size_t size() const { return m_size; } 50 | iterator begin() const { return m_arr; } 51 | 52 | private: 53 | // Data members 54 | T const* m_arr; 55 | std::size_t m_size; 56 | }; 57 | 58 | //____________________________________________________________________________// 59 | 60 | //! An array dataset is a dataset 61 | template 62 | struct is_dataset> : mpl::true_ {}; 63 | 64 | } // namespace monomorphic 65 | 66 | //____________________________________________________________________________// 67 | 68 | //! @overload boost::unit_test::data::make() 69 | template 70 | inline monomorphic::array::type> 71 | make( T (&a)[size] ) 72 | { 73 | return monomorphic::array::type>( a, size ); 74 | } 75 | 76 | } // namespace data 77 | } // namespace unit_test 78 | } // namespace boost 79 | 80 | #include 81 | 82 | #endif // BOOST_TEST_DATA_MONOMORPHIC_ARRAY_HPP_121411GER 83 | 84 | -------------------------------------------------------------------------------- /ext/include/boost/test/tree/observer.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief defines abstract interface for test observer 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_TEST_OBSERVER_HPP_021005GER 13 | #define BOOST_TEST_TEST_OBSERVER_HPP_021005GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | //____________________________________________________________________________// 23 | 24 | namespace boost { 25 | namespace unit_test { 26 | 27 | // ************************************************************************** // 28 | // ************** test_observer ************** // 29 | // ************************************************************************** // 30 | 31 | class BOOST_TEST_DECL test_observer { 32 | public: 33 | // test observer interface 34 | virtual void test_start( counter_t /* test_cases_amount */ ) {} 35 | virtual void test_finish() {} 36 | virtual void test_aborted() {} 37 | 38 | virtual void test_unit_start( test_unit const& ) {} 39 | virtual void test_unit_finish( test_unit const&, unsigned long /* elapsed */ ) {} 40 | virtual void test_unit_skipped( test_unit const& tu, const_string ) { test_unit_skipped( tu ); } 41 | virtual void test_unit_skipped( test_unit const& ) {} ///< backward compatibility 42 | virtual void test_unit_aborted( test_unit const& ) {} 43 | 44 | virtual void assertion_result( unit_test::assertion_result ar ) 45 | { 46 | switch( ar ) { 47 | case AR_PASSED: assertion_result( true ); break; 48 | case AR_FAILED: assertion_result( false ); break; 49 | case AR_TRIGGERED: break; 50 | default: break; 51 | } 52 | } 53 | virtual void exception_caught( execution_exception const& ) {} 54 | 55 | virtual int priority() { return 0; } 56 | 57 | protected: 58 | // depracated now 59 | virtual void assertion_result( bool /* passed */ ) {} 60 | 61 | BOOST_TEST_PROTECTED_VIRTUAL ~test_observer() {} 62 | }; 63 | 64 | } // namespace unit_test 65 | } // namespace boost 66 | 67 | #include 68 | 69 | #endif // BOOST_TEST_TEST_OBSERVER_HPP_021005GER 70 | 71 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/monomorphic/initializer_list.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | ///@file 9 | ///Defines monomorphic dataset based on C++11 initializer_list template 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_MONOMORPHIC_INITIALIZATION_LIST_HPP_091515GER 13 | #define BOOST_TEST_DATA_MONOMORPHIC_INITIALIZATION_LIST_HPP_091515GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | //____________________________________________________________________________// 22 | 23 | namespace boost { 24 | namespace unit_test { 25 | namespace data { 26 | namespace monomorphic { 27 | 28 | // ************************************************************************** // 29 | // ************** array ************** // 30 | // ************************************************************************** // 31 | 32 | /// Dataset view of a C array 33 | template 34 | class init_list { 35 | public: 36 | typedef T sample; 37 | 38 | enum { arity = 1 }; 39 | 40 | typedef T const* iterator; 41 | 42 | //! Constructor swallows initializer_list 43 | init_list( std::initializer_list&& il ) 44 | : m_data( std::forward>( il ) ) 45 | {} 46 | 47 | //! dataset interface 48 | data::size_t size() const { return m_data.size(); } 49 | iterator begin() const { return m_data.begin(); } 50 | 51 | private: 52 | // Data members 53 | std::initializer_list m_data; 54 | }; 55 | 56 | //____________________________________________________________________________// 57 | 58 | //! An array dataset is a dataset 59 | template 60 | struct is_dataset> : mpl::true_ {}; 61 | 62 | } // namespace monomorphic 63 | 64 | //____________________________________________________________________________// 65 | 66 | //! @overload boost::unit_test::data::make() 67 | template 68 | inline monomorphic::init_list 69 | make( std::initializer_list&& il ) 70 | { 71 | return monomorphic::init_list( std::forward>( il ) ); 72 | } 73 | 74 | } // namespace data 75 | } // namespace unit_test 76 | } // namespace boost 77 | 78 | #include 79 | 80 | #endif // BOOST_TEST_DATA_MONOMORPHIC_INITIALIZATION_LIST_HPP_091515GER 81 | 82 | -------------------------------------------------------------------------------- /src/a429/a429base.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENARINC_A429BASE_HPP 2 | #define OPENARINC_A429BASE_HPP 3 | 4 | namespace a429 5 | { 6 | typedef unsigned int UINT; 7 | typedef unsigned char UCHAR; 8 | 9 | // Base class for A429 objects 10 | // It provides common methods for manipulating the word 11 | class a429base 12 | { 13 | private: 14 | UINT m_myword; // Local label used if constructed by value 15 | protected: 16 | UINT* m_packed; // Points to m_myword if constructed by value, or the origin if constructed by reference 17 | 18 | public: 19 | // Constructors 20 | a429base(); // Default constructor (initializes to zero'd internal memory) 21 | a429base(const a429base& copy); // Copy constructor 22 | a429base(UINT input); // Construct by value, (initializes to internal memory with the input value) 23 | a429base(UINT* reference); // Construct to a refernce (intializes to utilize external memory, see Link() ). 24 | 25 | ~a429base(); 26 | 27 | // Casting/Operating 28 | operator UINT() const { return *m_packed; } 29 | UINT operator= (UINT word); 30 | 31 | // Which memory? 32 | a429base& Link(UINT* word); // Uses the linked pointer as memory, any manipulation done by this class will affect that memory. 33 | a429base& UnLink(); // De-links the object and points to its own internal memory 34 | 35 | // Common A429 utilities 36 | a429base& SetSDI(UCHAR value); // Self-descriptive, set 0-3 37 | a429base& SetSSM(UCHAR value); // Self-descriptive, set 0-3 38 | a429base& SetLbl(UCHAR value); // Sets the label name from an octal number, Ex: SetLbl(0270) will set label 270 (0x1d) 39 | a429base& SetRevLbl(UCHAR value); // Sets the label name from a direct byte, Ex: SetRevLbl(0x1d) will set label 0270 40 | a429base& SetPar(); // Auto-sets the parity of the label 41 | a429base& SetPar(bool p); // Allows the user to drive the parity bit of the label 42 | 43 | UCHAR GetSDI() const; // Returns the SDI (bits 9-10) 44 | UCHAR GetSSM() const; // Returns the SSM (bits 30-31) 45 | UCHAR GetLbl() const; // Returns the label (ex: 0270) 46 | UCHAR GetRevLbl() const; // Returns the reversed packed label (bits 1-9)(ex: 0x1d) 47 | UCHAR GetPar() const; // Returns the parity bit (bit 32) 48 | UINT GetWord() const; // Returns the entire A429 word 49 | 50 | UCHAR CalcPar() const; // Calculates the appropriate parity bit of the A429 word. 51 | }; 52 | } 53 | #endif // OPENARINC_A429BASE_HPP 54 | 55 | -------------------------------------------------------------------------------- /ext/include/boost/test/unit_test.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// @brief Entry point into the Unit Test Framework 10 | /// 11 | /// This header should be the only header necessary to include to start using the framework 12 | // *************************************************************************** 13 | 14 | #ifndef BOOST_TEST_UNIT_TEST_HPP_071894GER 15 | #define BOOST_TEST_UNIT_TEST_HPP_071894GER 16 | 17 | // Boost.Test 18 | #include 19 | #include 20 | 21 | //____________________________________________________________________________// 22 | 23 | // ************************************************************************** // 24 | // ************** Auto Linking ************** // 25 | // ************************************************************************** // 26 | 27 | #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_TEST_NO_LIB) && \ 28 | !defined(BOOST_TEST_SOURCE) && !defined(BOOST_TEST_INCLUDED) 29 | # define BOOST_LIB_NAME boost_unit_test_framework 30 | 31 | # if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_TEST_DYN_LINK) 32 | # define BOOST_DYN_LINK 33 | # endif 34 | 35 | # include 36 | 37 | #endif // auto-linking disabled 38 | 39 | // ************************************************************************** // 40 | // ************** unit_test_main ************** // 41 | // ************************************************************************** // 42 | 43 | namespace boost { namespace unit_test { 44 | 45 | int BOOST_TEST_DECL unit_test_main( init_unit_test_func init_func, int argc, char* argv[] ); 46 | 47 | } 48 | 49 | // !! ?? to remove 50 | namespace unit_test_framework=unit_test; 51 | 52 | } 53 | 54 | #if defined(BOOST_TEST_DYN_LINK) && defined(BOOST_TEST_MAIN) && !defined(BOOST_TEST_NO_MAIN) 55 | 56 | // ************************************************************************** // 57 | // ************** main function for tests using dll ************** // 58 | // ************************************************************************** // 59 | 60 | int BOOST_TEST_CALL_DECL 61 | main( int argc, char* argv[] ) 62 | { 63 | return ::boost::unit_test::unit_test_main( &init_unit_test, argc, argv ); 64 | } 65 | 66 | //____________________________________________________________________________// 67 | 68 | #endif // BOOST_TEST_DYN_LINK && BOOST_TEST_MAIN && !BOOST_TEST_NO_MAIN 69 | 70 | #endif // BOOST_TEST_UNIT_TEST_HPP_071894GER 71 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/trivial_singleton.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : simple helpers for creating cusom output manipulators 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_UTILS_TRIVIAL_SIGNLETON_HPP 16 | #define BOOST_TEST_UTILS_TRIVIAL_SIGNLETON_HPP 17 | 18 | // Boost.Test 19 | #include 20 | #include 21 | 22 | // Boost 23 | #include 24 | 25 | //____________________________________________________________________________// 26 | 27 | namespace boost { 28 | namespace unit_test { 29 | 30 | // ************************************************************************** // 31 | // ************** singleton ************** // 32 | // ************************************************************************** // 33 | 34 | template 35 | class singleton { 36 | public: 37 | static Derived& instance() { static Derived the_inst; return the_inst; } 38 | 39 | BOOST_DELETED_FUNCTION(singleton(singleton const&)) 40 | BOOST_DELETED_FUNCTION(singleton& operator=(singleton const&)) 41 | 42 | protected: 43 | BOOST_DEFAULTED_FUNCTION(singleton(), {}) 44 | BOOST_DEFAULTED_FUNCTION(~singleton(), {}) 45 | }; 46 | 47 | //____________________________________________________________________________// 48 | 49 | #define BOOST_TEST_SINGLETON_CONS( type ) \ 50 | friend class boost::unit_test::singleton; \ 51 | type() {} \ 52 | /**/ 53 | 54 | #if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) 55 | 56 | #define BOOST_TEST_SINGLETON_INST( inst ) \ 57 | template class unit_test::singleton< BOOST_JOIN( inst, _t ) > ; \ 58 | namespace { BOOST_JOIN( inst, _t)& inst = BOOST_JOIN( inst, _t)::instance(); } 59 | 60 | #elif defined(__APPLE_CC__) && defined(__GNUC__) && __GNUC__ < 4 61 | #define BOOST_TEST_SINGLETON_INST( inst ) \ 62 | static BOOST_JOIN( inst, _t)& inst = BOOST_JOIN (inst, _t)::instance(); 63 | 64 | #else 65 | 66 | #define BOOST_TEST_SINGLETON_INST( inst ) \ 67 | namespace { BOOST_JOIN( inst, _t)& inst = BOOST_JOIN( inst, _t)::instance(); } 68 | 69 | #endif 70 | 71 | //____________________________________________________________________________// 72 | 73 | } // namespace unit_test 74 | } // namespace boost 75 | 76 | 77 | #include 78 | 79 | #endif // BOOST_TEST_UTILS_TRIVIAL_SIGNLETON_HPP 80 | -------------------------------------------------------------------------------- /ext/include/boost/test/output/xml_log_formatter.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : contains OF_XML Log formatter definition 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_XML_LOG_FORMATTER_020105GER 16 | #define BOOST_TEST_XML_LOG_FORMATTER_020105GER 17 | 18 | // Boost.Test 19 | #include 20 | #include 21 | 22 | // STL 23 | #include // std::size_t 24 | 25 | #include 26 | 27 | //____________________________________________________________________________// 28 | 29 | namespace boost { 30 | namespace unit_test { 31 | namespace output { 32 | 33 | // ************************************************************************** // 34 | // ************** xml_log_formatter ************** // 35 | // ************************************************************************** // 36 | 37 | class xml_log_formatter : public unit_test_log_formatter { 38 | public: 39 | // Formatter interface 40 | void log_start( std::ostream&, counter_t test_cases_amount ); 41 | void log_finish( std::ostream& ); 42 | void log_build_info( std::ostream& ); 43 | 44 | void test_unit_start( std::ostream&, test_unit const& tu ); 45 | void test_unit_finish( std::ostream&, test_unit const& tu, unsigned long elapsed ); 46 | void test_unit_skipped( std::ostream&, test_unit const& tu, const_string reason ); 47 | 48 | void log_exception_start( std::ostream&, log_checkpoint_data const&, execution_exception const& ex ); 49 | void log_exception_finish( std::ostream& ); 50 | 51 | void log_entry_start( std::ostream&, log_entry_data const&, log_entry_types let ); 52 | using unit_test_log_formatter::log_entry_value; // bring base class functions into overload set 53 | void log_entry_value( std::ostream&, const_string value ); 54 | void log_entry_finish( std::ostream& ); 55 | 56 | void entry_context_start( std::ostream&, log_level ); 57 | void log_entry_context( std::ostream&, const_string ); 58 | void entry_context_finish( std::ostream& ); 59 | 60 | private: 61 | // Data members 62 | const_string m_curr_tag; 63 | bool m_value_closed; 64 | }; 65 | 66 | } // namespace output 67 | } // namespace unit_test 68 | } // namespace boost 69 | 70 | #include 71 | 72 | #endif // BOOST_TEST_XML_LOG_FORMATTER_020105GER 73 | -------------------------------------------------------------------------------- /ext/include/boost/test/output/compiler_log_formatter.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : contains compiler like Log formatter definition 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_COMPILER_LOG_FORMATTER_HPP_020105GER 16 | #define BOOST_TEST_COMPILER_LOG_FORMATTER_HPP_020105GER 17 | 18 | // Boost.Test 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | //____________________________________________________________________________// 25 | 26 | namespace boost { 27 | namespace unit_test { 28 | namespace output { 29 | 30 | // ************************************************************************** // 31 | // ************** compiler_log_formatter ************** // 32 | // ************************************************************************** // 33 | 34 | class BOOST_TEST_DECL compiler_log_formatter : public unit_test_log_formatter { 35 | public: 36 | compiler_log_formatter() : m_color_output( false ) {} 37 | 38 | // Formatter interface 39 | void log_start( std::ostream&, counter_t test_cases_amount ); 40 | void log_finish( std::ostream& ); 41 | void log_build_info( std::ostream& ); 42 | 43 | void test_unit_start( std::ostream&, test_unit const& tu ); 44 | void test_unit_finish( std::ostream&, test_unit const& tu, unsigned long elapsed ); 45 | void test_unit_skipped( std::ostream&, test_unit const& tu, const_string reason ); 46 | 47 | void log_exception_start( std::ostream&, log_checkpoint_data const&, execution_exception const& ex ); 48 | void log_exception_finish( std::ostream& ); 49 | 50 | void log_entry_start( std::ostream&, log_entry_data const&, log_entry_types let ); 51 | void log_entry_value( std::ostream&, const_string value ); 52 | void log_entry_value( std::ostream&, lazy_ostream const& value ); 53 | void log_entry_finish( std::ostream& ); 54 | 55 | void entry_context_start( std::ostream&, log_level ); 56 | void log_entry_context( std::ostream&, const_string ); 57 | void entry_context_finish( std::ostream& ); 58 | 59 | protected: 60 | virtual void print_prefix( std::ostream&, const_string file, std::size_t line ); 61 | 62 | // Data members 63 | bool m_color_output; 64 | }; 65 | 66 | } // namespace output 67 | } // namespace unit_test 68 | } // namespace boost 69 | 70 | #include 71 | 72 | #endif // BOOST_TEST_COMPILER_LOG_FORMATTER_HPP_020105GER 73 | -------------------------------------------------------------------------------- /src/a429/a429bnr.cpp: -------------------------------------------------------------------------------- 1 | #include "a429bnr.hpp" 2 | 3 | namespace a429 4 | { 5 | UINT a429bnr::operator= (UINT word) 6 | { 7 | *m_packed = word; 8 | return *m_packed; 9 | } 10 | 11 | void a429bnr::SetBit(bool value, unsigned int pos) 12 | { 13 | if (value) 14 | { 15 | *m_packed |= 0x1 << (pos - 1); 16 | } 17 | else 18 | { 19 | *m_packed &= ~(0x1 << (pos - 1)); 20 | } 21 | } 22 | 23 | UINT a429bnr::GetBit(unsigned int pos) const 24 | { 25 | return (*m_packed >> (pos - 1)) & 0x1; 26 | } 27 | 28 | a429bnr& a429bnr::SetBNR(double data) 29 | { 30 | double absdata = (data < 0) ? -1*data : data; 31 | unsigned int iData = (((unsigned int)(absdata / m_res)) & m_mask) << (m_endbit - m_sigbits); 32 | 33 | *m_packed &= ~(m_mask << (m_endbit - m_sigbits)); 34 | *m_packed |= iData; 35 | 36 | if (m_signbit) 37 | SetBit((data <= -1 * m_res) || (data == (m_mask + 1) * m_res), m_signbit); 38 | 39 | return *this; 40 | } 41 | 42 | a429bnr& a429bnr::SetBNR(double data, double resolution, int sigbits, int endbit /*= 28 */, int signbit /*= 29 */) 43 | { 44 | SetBNRPropertiesA(resolution, sigbits, endbit, signbit); 45 | 46 | return SetBNR(data); 47 | } 48 | 49 | double a429bnr::GetBNR() const 50 | { 51 | short startbit = m_endbit - m_sigbits; 52 | unsigned int iData = (*m_packed & (m_mask << (startbit))) >> (startbit); 53 | double data = GetBit(m_signbit) ? (int)(iData) * -m_res : iData * m_res; 54 | 55 | return data; 56 | } 57 | 58 | double a429bnr::GetBNR(double resolution, int sigbits, int endbit /*= 28 */, int signbit /*= 29 */) 59 | { 60 | SetBNRPropertiesA(resolution, sigbits, endbit, signbit); 61 | 62 | return GetBNR(); 63 | } 64 | 65 | a429bnr& a429bnr::SetBNRPropertiesA(double resolution, int sigbits, int endbit, int signbit) 66 | { 67 | m_res = resolution; 68 | m_sigbits = sigbits; 69 | m_endbit = endbit; 70 | m_signbit = signbit; 71 | 72 | m_mask = 1; 73 | for (int i = 0; i < m_sigbits; ++i) m_mask *= 2; 74 | m_mask -= 1; 75 | 76 | return *this; 77 | } 78 | 79 | a429bnr& a429bnr::SetBNRPropertiesB(double range, int sigbits, int endbit /*= 28 */, int signbit /*= 29 */) 80 | { 81 | double pow = 1.; 82 | for (int i = 0; i < sigbits; ++i) pow *= 2.; 83 | 84 | return SetBNRPropertiesA( (range) / pow , sigbits, endbit, signbit); 85 | } 86 | 87 | a429bnr& a429bnr::SetBNRPropertiesC(double resolution, int startbit, int endbit /*= 28 */, int signbit /*= 29 */) 88 | { 89 | return SetBNRPropertiesA(resolution, endbit-startbit+1, endbit, signbit); 90 | } 91 | 92 | a429bnr& a429bnr::SetBNRPropertiesD(double range, int startbit, int endbit /*= 28 */, int signbit /*= 29 */) 93 | { 94 | return SetBNRPropertiesB(range, endbit - startbit + 1, endbit, signbit); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /ext/include/boost/test/tools/assertion_result.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// Enhanced result for test predicate that include message explaining failure 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_PREDICATE_RESULT_HPP_012705GER 13 | #define BOOST_TEST_PREDICATE_RESULT_HPP_012705GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | #include 19 | 20 | // Boost 21 | #include 22 | #include 23 | 24 | // STL 25 | #include // for std::size_t 26 | 27 | #include 28 | 29 | //____________________________________________________________________________// 30 | 31 | namespace boost { 32 | namespace test_tools { 33 | 34 | // ************************************************************************** // 35 | // ************** assertion_result ************** // 36 | // ************************************************************************** // 37 | 38 | //!@brief Type used for storing the result of an assertion. 39 | class BOOST_TEST_DECL assertion_result { 40 | 41 | //!@internal 42 | typedef unit_test::const_string const_string; 43 | 44 | //!@internal 45 | struct dummy { void nonnull() {} }; 46 | 47 | //!@internal 48 | typedef void (dummy::*safe_bool)(); 49 | 50 | public: 51 | // Constructor 52 | assertion_result( bool pv_ ) 53 | : p_predicate_value( pv_ ) 54 | {} 55 | 56 | template 57 | assertion_result( BoolConvertable const& pv_ ) : p_predicate_value( !!pv_ ) {} 58 | 59 | // Access methods 60 | bool operator!() const { return !p_predicate_value; } 61 | void operator=( bool pv_ ) { p_predicate_value.value = pv_; } 62 | operator safe_bool() const { return !!p_predicate_value ? &dummy::nonnull : 0; } 63 | 64 | // Public properties 65 | BOOST_READONLY_PROPERTY( bool, (assertion_result) ) p_predicate_value; 66 | 67 | // Access methods 68 | bool has_empty_message() const { return !m_message; } 69 | wrap_stringstream& message() 70 | { 71 | if( !m_message ) 72 | m_message.reset( new wrap_stringstream ); 73 | 74 | return *m_message; 75 | } 76 | const_string message() const { return !m_message ? const_string() : const_string( m_message->str() ); } 77 | 78 | private: 79 | // Data members 80 | shared_ptr m_message; 81 | }; 82 | 83 | typedef assertion_result predicate_result; 84 | 85 | } // namespace test_tools 86 | } // namespace boost 87 | 88 | #include 89 | 90 | #endif // BOOST_TEST_PREDICATE_RESULT_HPP_012705GER 91 | -------------------------------------------------------------------------------- /ext/include/boost/test/impl/unit_test_monitor.ipp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : implements specific subclass of Executon Monitor used by Unit 13 | // Test Framework to monitor test cases run. 14 | // *************************************************************************** 15 | 16 | #ifndef BOOST_TEST_UNIT_TEST_MONITOR_IPP_012205GER 17 | #define BOOST_TEST_UNIT_TEST_MONITOR_IPP_012205GER 18 | 19 | // Boost.Test 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | //____________________________________________________________________________// 28 | 29 | namespace boost { 30 | namespace unit_test { 31 | 32 | // ************************************************************************** // 33 | // ************** unit_test_monitor ************** // 34 | // ************************************************************************** // 35 | 36 | unit_test_monitor_t::error_level 37 | unit_test_monitor_t::execute_and_translate( boost::function const& func, unsigned timeout ) 38 | { 39 | BOOST_TEST_I_TRY { 40 | p_catch_system_errors.value = runtime_config::get( runtime_config::CATCH_SYS_ERRORS ); 41 | p_timeout.value = timeout; 42 | p_auto_start_dbg.value = runtime_config::get( runtime_config::AUTO_START_DBG ); 43 | p_use_alt_stack.value = runtime_config::get( runtime_config::USE_ALT_STACK ); 44 | p_detect_fp_exceptions.value = runtime_config::get( runtime_config::DETECT_FP_EXCEPT ); 45 | 46 | vexecute( func ); 47 | } 48 | BOOST_TEST_I_CATCH( execution_exception, ex ) { 49 | framework::exception_caught( ex ); 50 | framework::test_unit_aborted( framework::current_test_case() ); 51 | 52 | // translate execution_exception::error_code to error_level 53 | switch( ex.code() ) { 54 | case execution_exception::no_error: return test_ok; 55 | case execution_exception::user_error: return unexpected_exception; 56 | case execution_exception::cpp_exception_error: return unexpected_exception; 57 | case execution_exception::system_error: return os_exception; 58 | case execution_exception::timeout_error: return os_timeout; 59 | case execution_exception::user_fatal_error: 60 | case execution_exception::system_fatal_error: return fatal_error; 61 | default: return unexpected_exception; 62 | } 63 | } 64 | 65 | return test_ok; 66 | } 67 | 68 | //____________________________________________________________________________// 69 | 70 | } // namespace unit_test 71 | } // namespace boost 72 | 73 | #include 74 | 75 | #endif // BOOST_TEST_UNIT_TEST_MONITOR_IPP_012205GER 76 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/monomorphic/collection.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | ///@file 9 | ///Defines monomorphic dataset based on forward iterable sequence 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_MONOMORPHIC_COLLECTION_HPP_102211GER 13 | #define BOOST_TEST_DATA_MONOMORPHIC_COLLECTION_HPP_102211GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | //____________________________________________________________________________// 22 | 23 | namespace boost { 24 | namespace unit_test { 25 | namespace data { 26 | namespace monomorphic { 27 | 28 | // ************************************************************************** // 29 | // ************** collection ************** // 30 | // ************************************************************************** // 31 | 32 | 33 | //!@brief Dataset from a forward iterable container (collection) 34 | //! 35 | //! This dataset is applicable to any container implementing a forward iterator. Note that 36 | //! container with one element will be considered as singletons. 37 | //! This dataset is constructible with the @ref boost::unit_test::data::make function. 38 | template 39 | class collection { 40 | typedef typename boost::decay::type col_type; 41 | public: 42 | typedef typename col_type::value_type sample; 43 | 44 | enum { arity = 1 }; 45 | 46 | typedef typename col_type::const_iterator iterator; 47 | 48 | //! Constructor consumed a temporary collection or stores a reference 49 | explicit collection( C&& col ) : m_col( std::forward(col) ) {} 50 | 51 | //! Move constructor 52 | collection( collection&& c ) : m_col( std::forward( c.m_col ) ) {} 53 | 54 | //! Returns the underlying collection 55 | C const& col() const { return m_col; } 56 | 57 | //! dataset interface 58 | data::size_t size() const { return m_col.size(); } 59 | iterator begin() const { return m_col.begin(); } 60 | 61 | private: 62 | // Data members 63 | C m_col; 64 | }; 65 | 66 | //____________________________________________________________________________// 67 | 68 | //! A collection from a forward iterable container is a dataset. 69 | template 70 | struct is_dataset> : mpl::true_ {}; 71 | 72 | } // namespace monomorphic 73 | 74 | //____________________________________________________________________________// 75 | 76 | //! @overload boost::unit_test::data::make() 77 | template 78 | inline typename std::enable_if::value,monomorphic::collection>::type 79 | make( C&& c ) 80 | { 81 | return monomorphic::collection( std::forward(c) ); 82 | } 83 | 84 | } // namespace data 85 | } // namespace unit_test 86 | } // namespace boost 87 | 88 | #include 89 | 90 | #endif // BOOST_TEST_DATA_MONOMORPHIC_COLLECTION_HPP_102211GER 91 | 92 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/runtime/env/fetch.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : implements fetching absent parameter athuments from environment 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_UTILS_RUNTIME_ENV_FETCH_HPP 16 | #define BOOST_TEST_UTILS_RUNTIME_ENV_FETCH_HPP 17 | 18 | // Boost.Test Runtime parameters 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | // C Runtime 25 | #include 26 | 27 | namespace boost { 28 | namespace runtime { 29 | namespace env { 30 | 31 | namespace env_detail { 32 | 33 | #ifndef UNDER_CE 34 | 35 | #ifdef BOOST_MSVC 36 | #pragma warning(push) 37 | #pragma warning(disable:4996) // getenv 38 | #endif 39 | 40 | inline std::pair 41 | sys_read_var( cstring var_name ) 42 | { 43 | using namespace std; 44 | char const* res = getenv( var_name.begin() ); 45 | 46 | return std::make_pair( cstring(res), res != NULL ); 47 | } 48 | 49 | #ifdef BOOST_MSVC 50 | #pragma warning(pop) 51 | #endif 52 | 53 | #else 54 | 55 | inline std::pair 56 | sys_read_var( cstring var_name ) 57 | { 58 | return std::make_pair( cstring(), false ); 59 | } 60 | 61 | #endif 62 | 63 | //____________________________________________________________________________// 64 | 65 | template 66 | inline void 67 | fetch_absent( parameters_store const& params, runtime::arguments_store& args, ReadFunc read_func ) 68 | { 69 | BOOST_TEST_FOREACH( parameters_store::storage_type::value_type const&, v, params.all() ) { 70 | basic_param_ptr param = v.second; 71 | 72 | if( args.has( param->p_name ) || param->p_env_var.empty() ) 73 | continue; 74 | 75 | std::pair value = read_func( param->p_env_var ); 76 | 77 | if( !value.second ) 78 | continue; 79 | 80 | // Validate against unexpected empty value 81 | BOOST_TEST_I_ASSRT( !value.first.is_empty() || param->p_has_optional_value, 82 | format_error( param->p_name ) 83 | << "Missing an argument value for the parameter " << param->p_name 84 | << " in the environment." ); 85 | 86 | // Produce argument value 87 | param->produce_argument( value.first, false, args ); 88 | 89 | } 90 | } 91 | 92 | //____________________________________________________________________________// 93 | 94 | } // namespace env_detail 95 | 96 | inline void 97 | fetch_absent( parameters_store const& params, runtime::arguments_store& args ) 98 | { 99 | env_detail::fetch_absent( params, args, &env_detail::sys_read_var ); 100 | } 101 | 102 | } // namespace env 103 | } // namespace runtime 104 | } // namespace boost 105 | 106 | #include 107 | 108 | #endif // BOOST_TEST_UTILS_RUNTIME_ENV_FETCH_HPP 109 | -------------------------------------------------------------------------------- /ext/include/boost/test/detail/global_typedef.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief some trivial global typedefs 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_GLOBAL_TYPEDEF_HPP_021005GER 13 | #define BOOST_TEST_GLOBAL_TYPEDEF_HPP_021005GER 14 | 15 | #include 16 | #include 17 | 18 | #define BOOST_TEST_L( s ) ::boost::unit_test::const_string( s, sizeof( s ) - 1 ) 19 | #define BOOST_TEST_STRINGIZE( s ) BOOST_TEST_L( BOOST_STRINGIZE( s ) ) 20 | #define BOOST_TEST_EMPTY_STRING BOOST_TEST_L( "" ) 21 | 22 | #include 23 | 24 | //____________________________________________________________________________// 25 | 26 | namespace boost { 27 | namespace unit_test { 28 | 29 | typedef unsigned long counter_t; 30 | 31 | //____________________________________________________________________________// 32 | 33 | enum report_level { INV_REPORT_LEVEL, CONFIRMATION_REPORT, SHORT_REPORT, DETAILED_REPORT, NO_REPORT }; 34 | 35 | //____________________________________________________________________________// 36 | 37 | enum output_format { OF_INVALID, 38 | OF_CLF, ///< compiler log format 39 | OF_XML, ///< XML format for report and log, 40 | OF_DOT ///< dot format for output content 41 | }; 42 | 43 | //____________________________________________________________________________// 44 | 45 | enum test_unit_type { TUT_CASE = 0x01, TUT_SUITE = 0x10, TUT_ANY = 0x11 }; 46 | 47 | //____________________________________________________________________________// 48 | 49 | enum assertion_result { AR_FAILED, AR_PASSED, AR_TRIGGERED }; 50 | 51 | //____________________________________________________________________________// 52 | 53 | typedef unsigned long test_unit_id; 54 | 55 | const test_unit_id INV_TEST_UNIT_ID = 0xFFFFFFFF; 56 | const test_unit_id MAX_TEST_CASE_ID = 0xFFFFFFFE; 57 | const test_unit_id MIN_TEST_CASE_ID = 0x00010000; 58 | const test_unit_id MAX_TEST_SUITE_ID = 0x0000FF00; 59 | const test_unit_id MIN_TEST_SUITE_ID = 0x00000001; 60 | 61 | //____________________________________________________________________________// 62 | 63 | namespace ut_detail { 64 | 65 | inline test_unit_type 66 | test_id_2_unit_type( test_unit_id id ) 67 | { 68 | return (id & 0xFFFF0000) != 0 ? TUT_CASE : TUT_SUITE; 69 | } 70 | 71 | //____________________________________________________________________________// 72 | 73 | } // namespace ut_detail 74 | 75 | // helper templates to prevent ODR violations 76 | template 77 | struct static_constant { 78 | static T value; 79 | }; 80 | 81 | template 82 | T static_constant::value; 83 | 84 | //____________________________________________________________________________// 85 | 86 | } // namespace unit_test 87 | } // namespace boost 88 | 89 | //____________________________________________________________________________// 90 | 91 | #include 92 | 93 | #endif // BOOST_TEST_GLOBAL_TYPEDEF_HPP_021005GER 94 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/runtime/cla/argv_traverser.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Use, modification, and distribution are subject to the 3 | // Boost Software License, Version 1.0. (See accompanying file 4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : defines facility to hide input traversing details 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_UTILS_RUNTIME_CLA_ARGV_TRAVERSER_HPP 16 | #define BOOST_TEST_UTILS_RUNTIME_CLA_ARGV_TRAVERSER_HPP 17 | 18 | // Boost.Test Runtime parameters 19 | #include 20 | 21 | #include 22 | 23 | namespace boost { 24 | namespace runtime { 25 | namespace cla { 26 | 27 | // ************************************************************************** // 28 | // ************** runtime::cla::argv_traverser ************** // 29 | // ************************************************************************** // 30 | 31 | class argv_traverser { 32 | typedef char const** argv_type; 33 | public: 34 | /// Constructs traverser based on argc/argv pair 35 | /// argv is taken "by reference" and later can be 36 | /// updated in remainder method 37 | argv_traverser( int argc, argv_type argv ) 38 | : m_argc( argc ) 39 | , m_curr_token( 0 ) 40 | , m_token_size( 0 ) 41 | , m_argv( argv ) 42 | { 43 | // save program name 44 | save_token(); 45 | } 46 | 47 | /// Returns new argc 48 | int remainder() 49 | { 50 | return m_argc; 51 | } 52 | 53 | /// Returns true, if we reached end on input 54 | bool eoi() const 55 | { 56 | return m_curr_token == m_argc; 57 | } 58 | 59 | /// Returns current token in the input 60 | cstring current_token() 61 | { 62 | if( eoi() ) 63 | return cstring(); 64 | 65 | return cstring( m_argv[m_curr_token], m_token_size ); 66 | } 67 | 68 | /// Saves current token for remainder 69 | void save_token() 70 | { 71 | ++m_curr_token; 72 | 73 | if( !eoi() ) 74 | m_token_size = ::strlen( m_argv[m_curr_token] ); 75 | } 76 | 77 | /// Commit current token and iterate to next one 78 | void next_token() 79 | { 80 | if( !eoi() ) { 81 | for( std::size_t i = m_curr_token; i < m_argc-1; ++i ) 82 | m_argv[i] = m_argv[i + 1]; 83 | 84 | --m_argc; 85 | 86 | m_token_size = ::strlen( m_argv[m_curr_token] ); 87 | } 88 | } 89 | 90 | private: 91 | 92 | // Data members 93 | std::size_t m_argc; // total number of arguments 94 | std::size_t m_curr_token; // current token index in argv 95 | std::size_t m_token_size; // current token size 96 | argv_type m_argv; // all arguments 97 | }; 98 | 99 | } // namespace cla 100 | } // namespace runtime 101 | } // namespace boost 102 | 103 | #include 104 | 105 | #endif // BOOST_TEST_UTILS_RUNTIME_CLA_ARGV_TRAVERSER_HPP 106 | -------------------------------------------------------------------------------- /ext/include/boost/test/tools/fpc_tolerance.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision: 74248 $ 11 | // 12 | // Description : FPC tools tolerance holder 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_TOOLS_FPC_TOLERANCE_HPP_121612GER 16 | #define BOOST_TEST_TOOLS_FPC_TOLERANCE_HPP_121612GER 17 | 18 | // Boost Test 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | //____________________________________________________________________________// 25 | 26 | namespace boost { 27 | namespace test_tools { 28 | 29 | namespace fpc = math::fpc; 30 | 31 | // ************************************************************************** // 32 | // ************** floating point comparison tolerance ************** // 33 | // ************************************************************************** // 34 | 35 | template 36 | inline FPT& 37 | fpc_tolerance() 38 | { 39 | static FPT s_value = 0; 40 | return s_value; 41 | } 42 | 43 | //____________________________________________________________________________// 44 | 45 | template 46 | struct local_fpc_tolerance { 47 | local_fpc_tolerance( FPT fraction_tolerance ) : m_old_tolerance( fpc_tolerance() ) 48 | { 49 | fpc_tolerance() = fraction_tolerance; 50 | } 51 | 52 | ~local_fpc_tolerance() 53 | { 54 | if( m_old_tolerance != (FPT)-1 ) 55 | fpc_tolerance() = m_old_tolerance; 56 | } 57 | 58 | private: 59 | // Data members 60 | FPT m_old_tolerance; 61 | }; 62 | 63 | //____________________________________________________________________________// 64 | 65 | } // namespace test_tools 66 | 67 | // ************************************************************************** // 68 | // ************** decorator::tolerance ************** // 69 | // ************************************************************************** // 70 | 71 | namespace unit_test { 72 | namespace decorator { 73 | 74 | template 75 | inline fixture_t 76 | tolerance( FPT v ) 77 | { 78 | return fixture_t( test_unit_fixture_ptr( 79 | new unit_test::class_based_fixture,FPT>( v ) ) ); 80 | } 81 | 82 | //____________________________________________________________________________// 83 | 84 | template 85 | inline fixture_t 86 | tolerance( test_tools::fpc::percent_tolerance_t v ) 87 | { 88 | return fixture_t( test_unit_fixture_ptr( 89 | new unit_test::class_based_fixture,FPT>( boost::math::fpc::fpc_detail::fraction_tolerance( v ) ) ) ); 90 | } 91 | 92 | //____________________________________________________________________________// 93 | 94 | } // namespace decorator 95 | 96 | using decorator::tolerance; 97 | 98 | } // namespace unit_test 99 | } // namespace boost 100 | 101 | #include 102 | 103 | #endif // BOOST_TEST_TOOLS_FPC_TOLERANCE_HPP_121612GER 104 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/iterator/input_iterator_facade.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //! Input iterator facade 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_UTILS_INPUT_ITERATOR_FACADE_HPP 13 | #define BOOST_TEST_UTILS_INPUT_ITERATOR_FACADE_HPP 14 | 15 | // Boost 16 | #include 17 | 18 | #include 19 | 20 | //____________________________________________________________________________// 21 | 22 | namespace boost { 23 | namespace unit_test { 24 | namespace utils { 25 | 26 | // ************************************************************************** // 27 | // ************** input_iterator_core_access ************** // 28 | // ************************************************************************** // 29 | 30 | class input_iterator_core_access 31 | { 32 | #if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) 33 | public: 34 | #else 35 | template friend class input_iterator_facade; 36 | #endif 37 | 38 | template 39 | static bool get( Facade& f ) 40 | { 41 | return f.get(); 42 | } 43 | 44 | private: 45 | // objects of this class are useless 46 | input_iterator_core_access(); //undefined 47 | }; 48 | 49 | // ************************************************************************** // 50 | // ************** input_iterator_facade ************** // 51 | // ************************************************************************** // 52 | 53 | template 57 | class input_iterator_facade : public iterator_facade 58 | { 59 | public: 60 | // Constructor 61 | input_iterator_facade() : m_valid( false ), m_value() {} 62 | 63 | protected: // provide access to the Derived 64 | void init() 65 | { 66 | m_valid = true; 67 | increment(); 68 | } 69 | 70 | // Data members 71 | mutable bool m_valid; 72 | ValueType m_value; 73 | 74 | private: 75 | friend class boost::iterator_core_access; 76 | 77 | // iterator facade interface implementation 78 | void increment() 79 | { 80 | // we make post-end incrementation indefinetly safe 81 | if( m_valid ) 82 | m_valid = input_iterator_core_access::get( *static_cast(this) ); 83 | } 84 | Reference dereference() const 85 | { 86 | return m_value; 87 | } 88 | 89 | // iterator facade interface implementation 90 | bool equal( input_iterator_facade const& rhs ) const 91 | { 92 | // two invalid iterator equals, inequal otherwise 93 | return !m_valid && !rhs.m_valid; 94 | } 95 | }; 96 | 97 | } // namespace utils 98 | } // namespace unit_test 99 | } // namespace boost 100 | 101 | //____________________________________________________________________________// 102 | 103 | #include 104 | 105 | #endif // BOOST_TEST_UTILS_INPUT_ITERATOR_FACADE_HPP 106 | -------------------------------------------------------------------------------- /ext/include/boost/test/tools/detail/indirections.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision: 74248 $ 11 | // 12 | // Description : inidiration interfaces to support manipulators and message output 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_TOOLS_DETAIL_INDIRECTIONS_HPP_112812GER 16 | #define BOOST_TEST_TOOLS_DETAIL_INDIRECTIONS_HPP_112812GER 17 | 18 | // Boost.Test 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | 25 | //____________________________________________________________________________// 26 | 27 | namespace boost { 28 | namespace test_tools { 29 | namespace tt_detail { 30 | 31 | // ************************************************************************** // 32 | // ************** assertion_evaluate indirection ************** // 33 | // ************************************************************************** // 34 | 35 | template 36 | struct assertion_evaluate_t { 37 | assertion_evaluate_t( E const& e ) : m_e( e ) {} 38 | operator assertion_result() { return m_e.evaluate( true ); } 39 | 40 | E const& m_e; 41 | }; 42 | 43 | //____________________________________________________________________________// 44 | 45 | template 46 | inline assertion_evaluate_t 47 | assertion_evaluate( E const& e ) { return assertion_evaluate_t( e ); } 48 | 49 | //____________________________________________________________________________// 50 | 51 | template 52 | inline assertion_evaluate_t 53 | operator<<( assertion_evaluate_t const& ae, T const& ) { return ae; } 54 | 55 | //____________________________________________________________________________// 56 | 57 | // ************************************************************************** // 58 | // ************** assertion_text indirection ************** // 59 | // ************************************************************************** // 60 | 61 | template 62 | inline unit_test::lazy_ostream const& 63 | assertion_text( unit_test::lazy_ostream const& /*et*/, T const& m ) { return m; } 64 | 65 | //____________________________________________________________________________// 66 | 67 | inline unit_test::lazy_ostream const& 68 | assertion_text( unit_test::lazy_ostream const& et, int ) { return et; } 69 | 70 | //____________________________________________________________________________// 71 | 72 | // ************************************************************************** // 73 | // ************** assertion_evaluate indirection ************** // 74 | // ************************************************************************** // 75 | 76 | struct assertion_type { 77 | operator check_type() { return CHECK_MSG; } 78 | }; 79 | 80 | //____________________________________________________________________________// 81 | 82 | template 83 | inline assertion_type 84 | operator<<( assertion_type const& at, T const& ) { return at; } 85 | 86 | //____________________________________________________________________________// 87 | 88 | } // namespace tt_detail 89 | } // namespace test_tools 90 | } // namespace boost 91 | 92 | #include 93 | 94 | #endif // BOOST_TEST_TOOLS_DETAIL_INDIRECTIONS_HPP_112812GER 95 | -------------------------------------------------------------------------------- /ext/include/boost/test/prg_exec_monitor.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// @brief Entry point for the end user into the Program Execution Monitor. 10 | /// 11 | /// Use this header to forward declare function prg_exec_monitor_main and to automatically define a main 12 | /// function for you. If you prefer to use your own main you are free to do so, but you need to define 13 | /// BOOST_TEST_NO_MAIN before incuding this header. To initiate your main program body execution you 14 | /// would use statement like this: 15 | /// @code ::boost::prg_exec_monitor_main( &my_main, argc, argv ); @endcode 16 | /// Also this header facilitate auto linking with the Program Execution Monitor library if this feature 17 | /// is supported 18 | // *************************************************************************** 19 | 20 | #ifndef BOOST_PRG_EXEC_MONITOR_HPP_071894GER 21 | #define BOOST_PRG_EXEC_MONITOR_HPP_071894GER 22 | 23 | #include 24 | 25 | //____________________________________________________________________________// 26 | 27 | // ************************************************************************** // 28 | // ************** Auto Linking ************** // 29 | // ************************************************************************** // 30 | 31 | // Automatically link to the correct build variant where possible. 32 | #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_TEST_NO_LIB) && \ 33 | !defined(BOOST_TEST_SOURCE) && !defined(BOOST_TEST_INCLUDED) 34 | # define BOOST_LIB_NAME boost_prg_exec_monitor 35 | 36 | // If we're importing code from a dll, then tell auto_link.hpp about it: 37 | # if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_TEST_DYN_LINK) 38 | # define BOOST_DYN_LINK 39 | # endif 40 | 41 | # include 42 | 43 | #endif // auto-linking disabled 44 | 45 | // ************************************************************************** // 46 | // ************** prg_exec_monitor_main ************** // 47 | // ************************************************************************** // 48 | 49 | namespace boost { 50 | 51 | /// @brief Wrapper around the main function 52 | /// 53 | /// Call this routine instead of your own main body implementation directly. This routine impements all the monitoring 54 | /// functionality. THe monitor behavior is configurable by using the environment variable BOOST_TEST_CATCH_SYSTEM_ERRORS. 55 | /// If set to string value "no", the monitor will not attempt to catch system errors (signals) 56 | /// @param[in] cpp_main main function body. Should have the same signature as regular main function 57 | /// @param[in] argc, argv command line arguments 58 | int BOOST_TEST_DECL prg_exec_monitor_main( int (*cpp_main)( int argc, char* argv[] ), int argc, char* argv[] ); 59 | 60 | } // boost 61 | 62 | #if defined(BOOST_TEST_DYN_LINK) && !defined(BOOST_TEST_NO_MAIN) 63 | 64 | // ************************************************************************** // 65 | // ************** main function for tests using dll ************** // 66 | // ************************************************************************** // 67 | 68 | // prototype for user's cpp_main() 69 | int cpp_main( int argc, char* argv[] ); 70 | 71 | int BOOST_TEST_CALL_DECL 72 | main( int argc, char* argv[] ) 73 | { 74 | return ::boost::prg_exec_monitor_main( &cpp_main, argc, argv ); 75 | } 76 | 77 | //____________________________________________________________________________// 78 | 79 | #endif // BOOST_TEST_DYN_LINK && !BOOST_TEST_NO_MAIN 80 | 81 | #endif // BOOST_PRG_EXEC_MONITOR_HPP_071894GER 82 | -------------------------------------------------------------------------------- /ext/include/boost/test/tools/output_test_stream.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// @brief output_test_stream class definition 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_OUTPUT_TEST_STREAM_HPP_012705GER 13 | #define BOOST_TEST_OUTPUT_TEST_STREAM_HPP_012705GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | #include 19 | 20 | // STL 21 | #include // for std::size_t 22 | 23 | #include 24 | 25 | //____________________________________________________________________________// 26 | 27 | // ************************************************************************** // 28 | // ************** output_test_stream ************** // 29 | // ************************************************************************** // 30 | 31 | 32 | 33 | namespace boost { 34 | namespace test_tools { 35 | 36 | //! Class to be used to simplify testing of ostream-based output operations 37 | class BOOST_TEST_DECL output_test_stream : public wrap_stringstream::wrapped_stream { 38 | typedef unit_test::const_string const_string; 39 | public: 40 | //! Constructor 41 | //! 42 | //!@param[in] pattern_file_name indicates the name of the file for matching. If the 43 | //! string is empty, the standard input or output streams are used instead 44 | //! (depending on match_or_save) 45 | //!@param[in] match_or_save if true, the pattern file will be read, otherwise it will be 46 | //! written 47 | //!@param[in] text_or_binary if false, opens the stream in binary mode. Otherwise the stream 48 | //! is opened with default flags and the carriage returns are ignored. 49 | explicit output_test_stream( const_string pattern_file_name = const_string(), 50 | bool match_or_save = true, 51 | bool text_or_binary = true ); 52 | 53 | // Destructor 54 | ~output_test_stream(); 55 | 56 | //! Checks if the stream is empty 57 | //! 58 | //!@param[in] flush_stream if true, flushes the stream after the call 59 | assertion_result is_empty( bool flush_stream = true ); 60 | 61 | //! Checks the length of the stream 62 | //! 63 | //!@param[in] length target length 64 | //!@param[in] flush_stream if true, flushes the stream after the call. Set to false to call 65 | //! additional checks on the same content. 66 | assertion_result check_length( std::size_t length, bool flush_stream = true ); 67 | 68 | //! Checks the content of the stream against a string 69 | //! 70 | //!@param[in] arg_ the target stream 71 | //!@param[in] flush_stream if true, flushes the stream after the call. 72 | assertion_result is_equal( const_string arg_, bool flush_stream = true ); 73 | 74 | //! Checks the content of the stream against a pattern file 75 | //! 76 | //!@param[in] flush_stream if true, flushes the stream after the call. 77 | assertion_result match_pattern( bool flush_stream = true ); 78 | 79 | //! Flushes the stream 80 | void flush(); 81 | 82 | private: 83 | // helper functions 84 | std::size_t length(); 85 | void sync(); 86 | 87 | struct Impl; 88 | Impl* m_pimpl; 89 | }; 90 | 91 | } // namespace test_tools 92 | } // namespace boost 93 | 94 | #include 95 | 96 | #endif // BOOST_TEST_OUTPUT_TEST_STREAM_HPP_012705GER 97 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/for_each_sample.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// Defines for_each_sample algorithm 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_FOR_EACH_SAMPLE_HPP_102211GER 13 | #define BOOST_TEST_DATA_FOR_EACH_SAMPLE_HPP_102211GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | // STL 22 | #include 23 | 24 | #include 25 | 26 | // needed for std::min 27 | #include 28 | 29 | //____________________________________________________________________________// 30 | 31 | namespace boost { 32 | namespace unit_test { 33 | namespace data { 34 | 35 | // ************************************************************************** // 36 | // ************** data::invoke_action ************** // 37 | // ************************************************************************** // 38 | 39 | template 40 | inline void 41 | invoke_action( Action const& action, T const& arg ) 42 | { 43 | action( arg ); 44 | } 45 | 46 | //____________________________________________________________________________// 47 | 48 | template 49 | inline void 50 | invoke_action_impl( Action const& action, std::tuple const& args, index_sequence const& ) 51 | { 52 | action( std::get(args)... ); 53 | } 54 | 55 | //____________________________________________________________________________// 56 | 57 | template 58 | inline void 59 | invoke_action( Action const& action, std::tuple const& args ) 60 | { 61 | invoke_action_impl( action, args, index_sequence_for{} ); 62 | } 63 | 64 | //____________________________________________________________________________// 65 | 66 | // ************************************************************************** // 67 | // ************** for_each_sample ************** // 68 | // ************************************************************************** // 69 | 70 | template 71 | inline typename std::enable_if::value,void>::type 72 | for_each_sample( DataSet const& samples, 73 | Action const& act, 74 | data::size_t number_of_samples = BOOST_TEST_DS_INFINITE_SIZE ) 75 | { 76 | data::size_t size = (std::min)( samples.size(), number_of_samples ); 77 | BOOST_TEST_DS_ASSERT( !size.is_inf(), "Dataset has infinite size. Please specify the number of samples" ); 78 | 79 | auto it = samples.begin(); 80 | 81 | while( size-- > 0 ) { 82 | invoke_action( act, *it ); 83 | ++it; 84 | } 85 | } 86 | 87 | //____________________________________________________________________________// 88 | 89 | template 90 | inline typename std::enable_if::value,void>::type 91 | for_each_sample( DataSet const& samples, 92 | Action const& act, 93 | data::size_t number_of_samples = BOOST_TEST_DS_INFINITE_SIZE ) 94 | { 95 | data::for_each_sample( data::make( samples ), act, number_of_samples ); 96 | } 97 | 98 | } // namespace data 99 | } // namespace unit_test 100 | } // namespace boost 101 | 102 | #include 103 | 104 | #endif // BOOST_TEST_DATA_FOR_EACH_SAMPLE_HPP_102211GER 105 | 106 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/monomorphic/generate.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// Defines generic interface for monomorphic dataset based on generator 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_MONOMORPHIC_GENERATE_HPP_112011GER 13 | #define BOOST_TEST_DATA_MONOMORPHIC_GENERATE_HPP_112011GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | //____________________________________________________________________________// 22 | 23 | namespace boost { 24 | namespace unit_test { 25 | namespace data { 26 | namespace monomorphic { 27 | 28 | // ************************************************************************** // 29 | // ************** generated_by ************** // 30 | // ************************************************************************** // 31 | 32 | /*!@brief Generators interface 33 | * 34 | * This class implements the dataset concept over a generator. Examples of generators are: 35 | * - xrange_t 36 | * - random_t 37 | * 38 | * The generator concept is the following: 39 | * - the type of the generated samples is given by field @c sample 40 | * - the member function @c capacity should return the size of the collection being generated (potentially infinite) 41 | * - the member function @c next should change the state of the generator to the next generated value 42 | * - the member function @c reset should put the state of the object in the same state as right after its instanciation 43 | */ 44 | template 45 | class generated_by { 46 | public: 47 | typedef typename Generator::sample sample; 48 | 49 | enum { arity = 1 }; 50 | 51 | struct iterator { 52 | // Constructor 53 | explicit iterator( Generator& gen ) 54 | : m_gen( &gen ) 55 | { 56 | if(m_gen->capacity() > 0) { 57 | m_gen->reset(); 58 | ++*this; 59 | } 60 | } 61 | 62 | // forward iterator interface 63 | sample const& operator*() const { return m_curr_sample; } 64 | void operator++() { m_curr_sample = m_gen->next(); } 65 | 66 | private: 67 | // Data members 68 | Generator* m_gen; 69 | sample m_curr_sample; 70 | }; 71 | 72 | typedef Generator generator_type; 73 | 74 | // Constructor 75 | explicit generated_by( Generator&& G ) 76 | : m_generator( std::forward(G) ) 77 | {} 78 | 79 | // Move constructor 80 | generated_by( generated_by&& rhs ) 81 | : m_generator( std::forward(rhs.m_generator) ) 82 | {} 83 | 84 | //! Size of the underlying dataset 85 | data::size_t size() const { return m_generator.capacity(); } 86 | 87 | //! Iterator on the beginning of the dataset 88 | iterator begin() const { return iterator( boost::ref(const_cast(m_generator)) ); } 89 | 90 | private: 91 | // Data members 92 | Generator m_generator; 93 | }; 94 | 95 | //____________________________________________________________________________// 96 | 97 | //! A generated dataset is a dataset. 98 | template 99 | struct is_dataset> : mpl::true_ {}; 100 | 101 | } // namespace monomorphic 102 | } // namespace data 103 | } // namespace unit_test 104 | } // namespace boost 105 | 106 | #include 107 | 108 | #endif // BOOST_TEST_DATA_MONOMORPHIC_GENERATE_HPP_112011GER 109 | 110 | -------------------------------------------------------------------------------- /ext/include/boost/test/tree/fixture.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision: 74640 $ 11 | // 12 | // Description : defines fixture interface and object makers 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_TREE_FIXTURE_HPP_100311GER 16 | #define BOOST_TEST_TREE_FIXTURE_HPP_100311GER 17 | 18 | // Boost.Test 19 | #include 20 | 21 | // Boost 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | //____________________________________________________________________________// 29 | 30 | namespace boost { 31 | namespace unit_test { 32 | 33 | // ************************************************************************** // 34 | // ************** test_unit_fixture ************** // 35 | // ************************************************************************** // 36 | 37 | class BOOST_TEST_DECL test_unit_fixture { 38 | public: 39 | virtual ~test_unit_fixture() {} 40 | 41 | // Fixture interface 42 | virtual void setup() = 0; 43 | virtual void teardown() = 0; 44 | }; 45 | 46 | typedef shared_ptr test_unit_fixture_ptr; 47 | 48 | // ************************************************************************** // 49 | // ************** class_based_fixture ************** // 50 | // ************************************************************************** // 51 | 52 | template 53 | class class_based_fixture : public test_unit_fixture { 54 | public: 55 | // Constructor 56 | explicit class_based_fixture( Arg const& arg ) : m_inst(), m_arg( arg ) {} 57 | 58 | private: 59 | // Fixture interface 60 | virtual void setup() { m_inst.reset( new F( m_arg ) ); } 61 | virtual void teardown() { m_inst.reset(); } 62 | 63 | // Data members 64 | scoped_ptr m_inst; 65 | Arg m_arg; 66 | }; 67 | 68 | //____________________________________________________________________________// 69 | 70 | template 71 | class class_based_fixture : public test_unit_fixture { 72 | public: 73 | // Constructor 74 | class_based_fixture() : m_inst( 0 ) {} 75 | 76 | private: 77 | // Fixture interface 78 | virtual void setup() { m_inst.reset( new F ); } 79 | virtual void teardown() { m_inst.reset(); } 80 | 81 | // Data members 82 | scoped_ptr m_inst; 83 | }; 84 | 85 | //____________________________________________________________________________// 86 | 87 | // ************************************************************************** // 88 | // ************** function_based_fixture ************** // 89 | // ************************************************************************** // 90 | 91 | class function_based_fixture : public test_unit_fixture { 92 | public: 93 | // Constructor 94 | function_based_fixture( boost::function const& setup_, boost::function const& teardown_ ) 95 | : m_setup( setup_ ) 96 | , m_teardown( teardown_ ) 97 | { 98 | } 99 | 100 | private: 101 | // Fixture interface 102 | virtual void setup() { if( m_setup ) m_setup(); } 103 | virtual void teardown() { if( m_teardown ) m_teardown(); } 104 | 105 | // Data members 106 | boost::function m_setup; 107 | boost::function m_teardown; 108 | }; 109 | 110 | } // namespace unit_test 111 | } // namespace boost 112 | 113 | #include 114 | 115 | #endif // BOOST_TEST_TREE_FIXTURE_HPP_100311GER 116 | 117 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/monomorphic/singleton.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// Defines single element monomorphic dataset 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_MONOMORPHIC_SINGLETON_HPP_102211GER 13 | #define BOOST_TEST_DATA_MONOMORPHIC_SINGLETON_HPP_102211GER 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | //____________________________________________________________________________// 22 | 23 | namespace boost { 24 | namespace unit_test { 25 | namespace data { 26 | namespace monomorphic { 27 | 28 | // ************************************************************************** // 29 | // ************** singleton ************** // 30 | // ************************************************************************** // 31 | 32 | /// Models a single element data set 33 | template 34 | class singleton { 35 | public: 36 | typedef typename boost::decay::type sample; 37 | 38 | enum { arity = 1 }; 39 | 40 | struct iterator { 41 | // Constructor 42 | explicit iterator( singleton const* owner ) 43 | : m_owner( owner ) 44 | {} 45 | 46 | // forward iterator interface 47 | sample const& operator*() const { return m_owner->value(); } 48 | void operator++() {} 49 | 50 | private: 51 | singleton const* m_owner; 52 | }; 53 | 54 | //! Constructor 55 | explicit singleton( T&& value ) : m_value( std::forward( value ) ) {} 56 | 57 | //! Move constructor 58 | singleton( singleton&& s ) : m_value( std::forward( s.m_value ) ) {} 59 | 60 | //! Value access method 61 | T const& value() const { return m_value; } 62 | 63 | //! dataset interface 64 | data::size_t size() const { return 1; } 65 | iterator begin() const { return iterator( this ); } 66 | 67 | private: 68 | // Data members 69 | T m_value; 70 | }; 71 | 72 | //____________________________________________________________________________// 73 | 74 | // a singleton is a dataset 75 | template 76 | struct is_dataset> : mpl::true_ {}; 77 | 78 | //____________________________________________________________________________// 79 | 80 | } // namespace monomorphic 81 | 82 | /// @overload boost::unit_test::data::make() 83 | template 84 | inline typename std::enable_if::value && 85 | !monomorphic::is_dataset::value && 86 | !boost::is_array::type>::value, 87 | monomorphic::singleton 88 | >::type 89 | make( T&& v ) 90 | { 91 | return monomorphic::singleton( std::forward( v ) ); 92 | } 93 | 94 | //____________________________________________________________________________// 95 | 96 | /// @overload boost::unit_test::data::make 97 | inline monomorphic::singleton 98 | make( char* str ) 99 | { 100 | return monomorphic::singleton( std::move(str) ); 101 | } 102 | 103 | //____________________________________________________________________________// 104 | 105 | /// @overload boost::unit_test::data::make 106 | inline monomorphic::singleton 107 | make( char const* str ) 108 | { 109 | return monomorphic::singleton( std::move(str) ); 110 | } 111 | 112 | } // namespace data 113 | } // namespace unit_test 114 | } // namespace boost 115 | 116 | #include 117 | 118 | #endif // BOOST_TEST_DATA_MONOMORPHIC_SINGLETON_HPP_102211GER 119 | 120 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/runtime/modifier.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Use, modification, and distribution are subject to the 3 | // Boost Software License, Version 1.0. (See accompanying file 4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : parameter modifiers 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_UTILS_RUNTIME_MODIFIER_HPP 16 | #define BOOST_TEST_UTILS_RUNTIME_MODIFIER_HPP 17 | 18 | // Boost.Test Runtime parameters 19 | #include 20 | 21 | // Boost.Test 22 | #include 23 | 24 | #include 25 | 26 | namespace boost { 27 | namespace runtime { 28 | 29 | // ************************************************************************** // 30 | // ************** environment variable modifiers ************** // 31 | // ************************************************************************** // 32 | 33 | namespace { 34 | 35 | #if !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) 36 | #define BOOST_TEST_CLA_NEW_API 37 | #endif 38 | 39 | #ifdef BOOST_TEST_CLA_NEW_API 40 | auto const& description = unit_test::static_constant>::value; 41 | auto const& help = unit_test::static_constant>::value; 42 | auto const& env_var = unit_test::static_constant>::value; 43 | auto const& end_of_params = unit_test::static_constant>::value; 44 | auto const& negation_prefix = unit_test::static_constant>::value; 45 | auto const& value_hint = unit_test::static_constant>::value; 46 | auto const& optional_value = unit_test::static_constant>::value; 47 | auto const& default_value = unit_test::static_constant>::value; 48 | auto const& callback = unit_test::static_constant>::value; 49 | 50 | template 51 | using enum_values = unit_test::static_constant< 52 | nfp::typed_keyword>, struct enum_values_t> 53 | >; 54 | 55 | #else 56 | 57 | nfp::typed_keyword description; 58 | nfp::typed_keyword help; 59 | nfp::typed_keyword env_var; 60 | nfp::typed_keyword end_of_params; 61 | nfp::typed_keyword negation_prefix; 62 | nfp::typed_keyword value_hint; 63 | nfp::keyword optional_value; 64 | nfp::keyword default_value; 65 | nfp::keyword callback; 66 | 67 | template 68 | struct enum_values_list { 69 | typedef std::pair ElemT; 70 | typedef std::vector ValuesT; 71 | 72 | enum_values_list const& 73 | operator()( cstring k, EnumType v ) const 74 | { 75 | const_cast(this)->m_values.push_back( ElemT( k, v ) ); 76 | 77 | return *this; 78 | } 79 | 80 | operator ValuesT const&() const { return m_values; } 81 | 82 | private: 83 | ValuesT m_values; 84 | }; 85 | 86 | template 87 | struct enum_values : unit_test::static_constant< 88 | nfp::typed_keyword, struct enum_values_t> > 89 | { 90 | }; 91 | 92 | #endif 93 | 94 | } // local namespace 95 | 96 | } // namespace runtime 97 | } // namespace boost 98 | 99 | #include 100 | 101 | #endif // BOOST_TEST_UTILS_RUNTIME_MODIFIER_HPP 102 | -------------------------------------------------------------------------------- /ext/include/boost/test/impl/xml_report_formatter.ipp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision$ 11 | // 12 | // Description : OF_XML report formatter 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_XML_REPORT_FORMATTER_IPP_020105GER 16 | #define BOOST_TEST_XML_REPORT_FORMATTER_IPP_020105GER 17 | 18 | // Boost.Test 19 | #include 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | //____________________________________________________________________________// 29 | 30 | namespace boost { 31 | namespace unit_test { 32 | namespace output { 33 | 34 | void 35 | xml_report_formatter::results_report_start( std::ostream& ostr ) 36 | { 37 | ostr << ""; 38 | } 39 | 40 | //____________________________________________________________________________// 41 | 42 | void 43 | xml_report_formatter::results_report_finish( std::ostream& ostr ) 44 | { 45 | ostr << ""; 46 | } 47 | 48 | 49 | //____________________________________________________________________________// 50 | 51 | void 52 | xml_report_formatter::test_unit_report_start( test_unit const& tu, std::ostream& ostr ) 53 | { 54 | test_results const& tr = results_collector.results( tu.p_id ); 55 | 56 | const_string descr; 57 | 58 | if( tr.passed() ) 59 | descr = "passed"; 60 | else if( tr.p_skipped ) 61 | descr = "skipped"; 62 | else if( tr.p_aborted ) 63 | descr = "aborted"; 64 | else 65 | descr = "failed"; 66 | 67 | ostr << '<' << ( tu.p_type == TUT_CASE ? "TestCase" : "TestSuite" ) 68 | << " name" << utils::attr_value() << tu.p_name.get() 69 | << " result" << utils::attr_value() << descr 70 | << " assertions_passed" << utils::attr_value() << tr.p_assertions_passed 71 | << " assertions_failed" << utils::attr_value() << tr.p_assertions_failed 72 | << " warnings_failed" << utils::attr_value() << tr.p_warnings_failed 73 | << " expected_failures" << utils::attr_value() << tr.p_expected_failures; 74 | 75 | if( tu.p_type == TUT_SUITE ) { 76 | ostr << " test_cases_passed" << utils::attr_value() << tr.p_test_cases_passed 77 | << " test_cases_passed_with_warnings" << utils::attr_value() << tr.p_test_cases_warned 78 | << " test_cases_failed" << utils::attr_value() << tr.p_test_cases_failed 79 | << " test_cases_skipped" << utils::attr_value() << tr.p_test_cases_skipped 80 | << " test_cases_aborted" << utils::attr_value() << tr.p_test_cases_aborted; 81 | } 82 | 83 | ostr << '>'; 84 | } 85 | 86 | //____________________________________________________________________________// 87 | 88 | void 89 | xml_report_formatter::test_unit_report_finish( test_unit const& tu, std::ostream& ostr ) 90 | { 91 | ostr << "'; 92 | } 93 | 94 | //____________________________________________________________________________// 95 | 96 | void 97 | xml_report_formatter::do_confirmation_report( test_unit const& tu, std::ostream& ostr ) 98 | { 99 | test_unit_report_start( tu, ostr ); 100 | test_unit_report_finish( tu, ostr ); 101 | } 102 | 103 | //____________________________________________________________________________// 104 | 105 | } // namespace output 106 | } // namespace unit_test 107 | } // namespace boost 108 | 109 | #include 110 | 111 | #endif // BOOST_TEST_XML_REPORT_FORMATTER_IPP_020105GER 112 | -------------------------------------------------------------------------------- /test/test.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 25 | 28 | 31 | 34 | 37 | 40 | 50 | 53 | 56 | 59 | 65 | 68 | 71 | 74 | 77 | 80 | 83 | 86 | 87 | 95 | 98 | 101 | 104 | 107 | 110 | 120 | 123 | 126 | 129 | 137 | 140 | 143 | 146 | 149 | 152 | 155 | 158 | 159 | 160 | 161 | 162 | 163 | 166 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /ext/include/boost/test/tools/detail/fwd.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | // File : $RCSfile$ 9 | // 10 | // Version : $Revision: 74248 $ 11 | // 12 | // Description : toolbox implementation types and forward declarations 13 | // *************************************************************************** 14 | 15 | #ifndef BOOST_TEST_TOOLS_DETAIL_FWD_HPP_012705GER 16 | #define BOOST_TEST_TOOLS_DETAIL_FWD_HPP_012705GER 17 | 18 | // Boost.Test 19 | #include 20 | #include 21 | 22 | // STL 23 | #include // for std::size_t 24 | 25 | #include 26 | 27 | //____________________________________________________________________________// 28 | 29 | namespace boost { 30 | namespace unit_test { 31 | 32 | class lazy_ostream; 33 | 34 | } // namespace unit_test 35 | 36 | namespace test_tools { 37 | 38 | using unit_test::const_string; 39 | class assertion_result; 40 | 41 | //____________________________________________________________________________// 42 | 43 | namespace tt_detail { 44 | 45 | inline bool dummy_cond() { return false; } 46 | 47 | // ************************************************************************** // 48 | // ************** types of supported assertions ************** // 49 | // ************************************************************************** // 50 | 51 | //____________________________________________________________________________// 52 | 53 | enum check_type { 54 | CHECK_PRED, 55 | CHECK_MSG, 56 | CHECK_EQUAL, 57 | CHECK_NE, 58 | CHECK_LT, 59 | CHECK_LE, 60 | CHECK_GT, 61 | CHECK_GE, 62 | CHECK_CLOSE, 63 | CHECK_CLOSE_FRACTION, 64 | CHECK_SMALL, 65 | CHECK_BITWISE_EQUAL, 66 | CHECK_PRED_WITH_ARGS, 67 | CHECK_EQUAL_COLL, 68 | CHECK_BUILT_ASSERTION 69 | }; 70 | 71 | //____________________________________________________________________________// 72 | 73 | // ************************************************************************** // 74 | // ************** levels of supported assertions ************** // 75 | // ************************************************************************** // 76 | 77 | enum tool_level { 78 | WARN, CHECK, REQUIRE, PASS 79 | }; 80 | 81 | //____________________________________________________________________________// 82 | 83 | // ************************************************************************** // 84 | // ************** Tools offline implementation ************** // 85 | // ************************************************************************** // 86 | 87 | BOOST_TEST_DECL bool 88 | report_assertion( assertion_result const& pr, unit_test::lazy_ostream const& assertion_descr, 89 | const_string file_name, std::size_t line_num, 90 | tool_level tl, check_type ct, 91 | std::size_t num_args, ... ); 92 | 93 | //____________________________________________________________________________// 94 | 95 | BOOST_TEST_DECL assertion_result 96 | format_assertion_result( const_string expr_val, const_string details ); 97 | 98 | //____________________________________________________________________________// 99 | 100 | BOOST_TEST_DECL assertion_result 101 | format_fpc_report( const_string expr_val, const_string details ); 102 | 103 | //____________________________________________________________________________// 104 | 105 | BOOST_TEST_DECL bool 106 | is_defined_impl( const_string symbol_name, const_string symbol_value ); 107 | 108 | //____________________________________________________________________________// 109 | 110 | BOOST_TEST_DECL assertion_result 111 | equal_impl( char const* left, char const* right ); 112 | 113 | //____________________________________________________________________________// 114 | 115 | } // namespace tt_detail 116 | } // namespace test_tools 117 | } // namespace boost 118 | 119 | #include 120 | 121 | #endif // BOOST_TEST_TOOLS_DETAIL_FWD_HPP_012705GER 122 | -------------------------------------------------------------------------------- /ext/include/boost/test/data/monomorphic/sample_merge.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | /// @file 9 | /// Defines helper routines and types for merging monomorphic samples 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_DATA_MONOMORPHIC_SAMPLE_MERGE_HPP 13 | #define BOOST_TEST_DATA_MONOMORPHIC_SAMPLE_MERGE_HPP 14 | 15 | // Boost.Test 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | #include 22 | 23 | namespace boost { 24 | namespace unit_test { 25 | namespace data { 26 | namespace monomorphic { 27 | 28 | template 29 | struct merged_sample { 30 | typedef std::tuple type; 31 | typedef std::tuple ref; 32 | }; 33 | 34 | //____________________________________________________________________________// 35 | 36 | template 37 | struct merged_sample> { 38 | typedef std::tuple type; 39 | typedef std::tuple ref; 40 | }; 41 | 42 | //____________________________________________________________________________// 43 | 44 | template 45 | struct merged_sample, T1> { 46 | typedef std::tuple type; 47 | typedef std::tuple ref; 48 | }; 49 | 50 | //____________________________________________________________________________// 51 | 52 | template 53 | struct merged_sample, std::tuple> { 54 | typedef std::tuple type; 55 | typedef std::tuple ref; 56 | }; 57 | 58 | //____________________________________________________________________________// 59 | 60 | namespace ds_detail { 61 | 62 | template 63 | inline typename merged_sample, std::tuple>::ref 64 | sample_merge_impl( std::tuple const& a1, std::tuple const& a2, 65 | index_sequence const& , index_sequence const& ) 66 | { 67 | using ref_type = typename merged_sample, std::tuple>::ref; 68 | 69 | return ref_type( std::get(a1)..., std::get(a2)... ); 70 | } 71 | 72 | //____________________________________________________________________________// 73 | 74 | template 75 | inline typename merged_sample, std::tuple>::ref 76 | sample_merge_impl( std::tuple const& a1, std::tuple const& a2 ) 77 | { 78 | return sample_merge_impl( a1, a2, index_sequence_for{}, index_sequence_for{} ); 79 | } 80 | 81 | //____________________________________________________________________________// 82 | 83 | template 84 | inline std::tuple 85 | as_tuple( T const& arg ) 86 | { 87 | return std::tuple( arg ); 88 | } 89 | 90 | //____________________________________________________________________________// 91 | 92 | template 93 | inline std::tuple const& 94 | as_tuple( std::tuple const& arg ) 95 | { 96 | return arg; 97 | } 98 | 99 | //____________________________________________________________________________// 100 | 101 | } // namespace ds_detail 102 | 103 | template 104 | inline typename merged_sample::ref 105 | sample_merge( T1 const& a1, T2 const& a2 ) 106 | { 107 | auto const& a1_as_tuple = ds_detail::as_tuple( a1 ); 108 | auto const& a2_as_tuple = ds_detail::as_tuple( a2 ); 109 | 110 | return ds_detail::sample_merge_impl( a1_as_tuple, a2_as_tuple ); 111 | } 112 | 113 | } // namespace monomorphic 114 | } // namespace data 115 | } // namespace unit_test 116 | } // namespace boost 117 | 118 | #include 119 | 120 | #endif // BOOST_TEST_DATA_MONOMORPHIC_SAMPLE_MERGE_HPP 121 | 122 | -------------------------------------------------------------------------------- /ext/include/boost/test/utils/nullstream.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // (C) Copyright Daryle Walker 2000-2001. 3 | // Distributed under the Boost Software License, Version 1.0. 4 | // (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | // See http://www.boost.org/libs/test for the library home page. 8 | // 9 | // File : $RCSfile$ 10 | // 11 | // Version : $Revision$ 12 | // 13 | // Description : simulate /dev/null stream 14 | // *************************************************************************** 15 | 16 | #ifndef BOOST_TEST_UTILS_NULLSTREAM_HPP 17 | #define BOOST_TEST_UTILS_NULLSTREAM_HPP 18 | 19 | // STL 20 | #include // for std::basic_ostream 21 | #include // for std::basic_streambuf 22 | #include // for std::char_traits 23 | 24 | // Boost 25 | #include 26 | 27 | #include 28 | 29 | //____________________________________________________________________________// 30 | 31 | namespace boost { 32 | 33 | // ************************************************************************** // 34 | // ************** basic_nullbuf ************** // 35 | // ************************************************************************** // 36 | // Class for a buffer that reads nothing and writes to nothing. 37 | // Idea from an Usenet post by Tom at 38 | // 27 Oct 2000 14:06:21 GMT on comp.lang.c++. 39 | 40 | template > 41 | class basic_nullbuf : public ::std::basic_streambuf { 42 | typedef ::std::basic_streambuf base_type; 43 | public: 44 | // Types 45 | typedef typename base_type::char_type char_type; 46 | typedef typename base_type::traits_type traits_type; 47 | typedef typename base_type::int_type int_type; 48 | typedef typename base_type::pos_type pos_type; 49 | typedef typename base_type::off_type off_type; 50 | 51 | // Use automatic default constructor and destructor 52 | 53 | protected: 54 | // The default implementations of the miscellaneous virtual 55 | // member functions are sufficient. 56 | 57 | // The default implementations of the input & putback virtual 58 | // member functions, being nowhere but EOF, are sufficient. 59 | 60 | // The output virtual member functions need to be changed to 61 | // accept anything without any problems, instead of being at EOF. 62 | virtual ::std::streamsize xsputn( char_type const* /*s*/, ::std::streamsize n ) { return n; } // "s" is unused 63 | virtual int_type overflow( int_type c = traits_type::eof() ) { return traits_type::not_eof( c ); } 64 | }; 65 | 66 | typedef basic_nullbuf nullbuf; 67 | typedef basic_nullbuf wnullbuf; 68 | 69 | // ************************************************************************** // 70 | // ************** basic_onullstream ************** // 71 | // ************************************************************************** // 72 | // Output streams based on basic_nullbuf. 73 | 74 | #ifdef BOOST_MSVC 75 | # pragma warning(push) 76 | # pragma warning(disable: 4355) // 'this' : used in base member initializer list 77 | #endif 78 | 79 | template< typename CharType, class CharTraits = ::std::char_traits > 80 | class basic_onullstream : private boost::base_from_member > 81 | , public ::std::basic_ostream { 82 | typedef boost::base_from_member > pbase_type; 83 | typedef ::std::basic_ostream base_type; 84 | public: 85 | // Constructor 86 | basic_onullstream() : pbase_type(), base_type( &this->pbase_type::member ) {} 87 | }; 88 | 89 | #ifdef BOOST_MSVC 90 | # pragma warning(default: 4355) 91 | # pragma warning(pop) 92 | #endif 93 | 94 | typedef basic_onullstream onullstream; 95 | typedef basic_onullstream wonullstream; 96 | 97 | } // namespace boost 98 | 99 | //____________________________________________________________________________// 100 | 101 | #include 102 | 103 | #endif // BOOST_TEST_UTILS_NULLSTREAM_HPP 104 | -------------------------------------------------------------------------------- /ext/include/boost/test/detail/config.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief a central place for global configuration switches 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_CONFIG_HPP_071894GER 13 | #define BOOST_TEST_CONFIG_HPP_071894GER 14 | 15 | // Boost 16 | #include // compilers workarounds 17 | #include 18 | 19 | #if defined(_WIN32) && !defined(BOOST_DISABLE_WIN32) && \ 20 | (!defined(__COMO__) && !defined(__MWERKS__) && !defined(__GNUC__) || \ 21 | BOOST_WORKAROUND(__MWERKS__, >= 0x3000)) 22 | # define BOOST_SEH_BASED_SIGNAL_HANDLING 23 | #endif 24 | 25 | #if defined(__COMO__) && defined(_MSC_VER) 26 | // eh.h uses type_info without declaring it. 27 | class type_info; 28 | # define BOOST_SEH_BASED_SIGNAL_HANDLING 29 | #endif 30 | 31 | //____________________________________________________________________________// 32 | 33 | #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) || \ 34 | BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) || \ 35 | (defined __sgi && BOOST_WORKAROUND(_COMPILER_VERSION, BOOST_TESTED_AT(730))) 36 | # define BOOST_TEST_SHIFTED_LINE 37 | #endif 38 | 39 | //____________________________________________________________________________// 40 | 41 | #if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32)) 42 | # define BOOST_TEST_CALL_DECL __cdecl 43 | #else 44 | # define BOOST_TEST_CALL_DECL /**/ 45 | #endif 46 | 47 | //____________________________________________________________________________// 48 | 49 | #if !defined(BOOST_NO_STD_LOCALE) && !defined(__MWERKS__) 50 | # define BOOST_TEST_USE_STD_LOCALE 1 51 | #endif 52 | 53 | //____________________________________________________________________________// 54 | 55 | #if BOOST_WORKAROUND(__BORLANDC__, <= 0x570) || \ 56 | BOOST_WORKAROUND( __COMO__, <= 0x433 ) || \ 57 | BOOST_WORKAROUND( __INTEL_COMPILER, <= 800 ) || \ 58 | defined(__sgi) && _COMPILER_VERSION <= 730 || \ 59 | BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) || \ 60 | defined(__DECCXX) || \ 61 | defined(__DMC__) 62 | # define BOOST_TEST_NO_PROTECTED_USING 63 | #endif 64 | 65 | //____________________________________________________________________________// 66 | 67 | #if defined(__GNUC__) || BOOST_WORKAROUND(BOOST_MSVC, == 1400) 68 | #define BOOST_TEST_PROTECTED_VIRTUAL virtual 69 | #else 70 | #define BOOST_TEST_PROTECTED_VIRTUAL 71 | #endif 72 | 73 | //____________________________________________________________________________// 74 | 75 | #if !defined(__BORLANDC__) && !BOOST_WORKAROUND( __SUNPRO_CC, < 0x5100 ) 76 | #define BOOST_TEST_SUPPORT_TOKEN_ITERATOR 1 77 | #endif 78 | 79 | //____________________________________________________________________________// 80 | 81 | #if defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_TEST_DYN_LINK) 82 | # define BOOST_TEST_DYN_LINK 83 | #endif 84 | 85 | #if defined(BOOST_TEST_INCLUDED) 86 | # undef BOOST_TEST_DYN_LINK 87 | #endif 88 | 89 | #if defined(BOOST_TEST_DYN_LINK) 90 | # define BOOST_TEST_ALTERNATIVE_INIT_API 91 | 92 | # ifdef BOOST_TEST_SOURCE 93 | # define BOOST_TEST_DECL BOOST_SYMBOL_EXPORT 94 | # else 95 | # define BOOST_TEST_DECL BOOST_SYMBOL_IMPORT 96 | # endif // BOOST_TEST_SOURCE 97 | #else 98 | # define BOOST_TEST_DECL 99 | #endif 100 | 101 | #if !defined(BOOST_TEST_MAIN) && defined(BOOST_AUTO_TEST_MAIN) 102 | #define BOOST_TEST_MAIN BOOST_AUTO_TEST_MAIN 103 | #endif 104 | 105 | #if !defined(BOOST_TEST_MAIN) && defined(BOOST_TEST_MODULE) 106 | #define BOOST_TEST_MAIN BOOST_TEST_MODULE 107 | #endif 108 | 109 | 110 | 111 | #ifndef BOOST_PP_VARIADICS /* we can change this only if not already defined) */ 112 | 113 | #ifdef __PGI 114 | #define BOOST_PP_VARIADICS 1 115 | #endif 116 | 117 | #if BOOST_CLANG 118 | #define BOOST_PP_VARIADICS 1 119 | #endif 120 | 121 | #if defined(BOOST_GCC) && (BOOST_GCC >= 4 * 10000 + 8 * 100) 122 | #define BOOST_PP_VARIADICS 1 123 | #endif 124 | 125 | #endif /* ifndef BOOST_PP_VARIADICS */ 126 | 127 | #endif // BOOST_TEST_CONFIG_HPP_071894GER 128 | -------------------------------------------------------------------------------- /ext/include/boost/test/tools/cstring_comparison_op.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Gennadiy Rozental 2001. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org/libs/test for the library home page. 7 | // 8 | //!@file 9 | //!@brief C string comparison with enhanced reporting 10 | // *************************************************************************** 11 | 12 | #ifndef BOOST_TEST_TOOLS_CSTRING_COMPARISON_OP_HPP_050815GER 13 | #define BOOST_TEST_TOOLS_CSTRING_COMPARISON_OP_HPP_050815GER 14 | 15 | // Boost.Test 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | // Boost 22 | #include 23 | 24 | #include 25 | 26 | //____________________________________________________________________________// 27 | 28 | namespace boost { 29 | namespace test_tools { 30 | namespace assertion { 31 | namespace op { 32 | 33 | 34 | 35 | // ************************************************************************** // 36 | // ************** string_compare ************** // 37 | // ************************************************************************** // 38 | 39 | #define DEFINE_CSTRING_COMPARISON( oper, name, rev ) \ 40 | template \ 41 | struct name::value && \ 43 | unit_test::is_cstring::value>::type> { \ 44 | typedef typename boost::add_const< \ 45 | typename remove_pointer< \ 46 | typename decay::type>::type>::type \ 47 | lhs_char_type; \ 48 | typedef typename boost::add_const< \ 49 | typename remove_pointer< \ 50 | typename decay::type>::type>::type \ 51 | rhs_char_type; \ 52 | public: \ 53 | typedef assertion_result result_type; \ 54 | \ 55 | static bool \ 56 | eval( Lhs const& lhs, Rhs const& rhs) \ 57 | { \ 58 | return unit_test::basic_cstring(lhs) oper \ 59 | unit_test::basic_cstring(rhs); \ 60 | } \ 61 | \ 62 | template \ 63 | static void \ 64 | report( std::ostream& ostr, \ 65 | PrevExprType const& lhs, \ 66 | Rhs const& rhs) \ 67 | { \ 68 | lhs.report( ostr ); \ 69 | ostr << revert() \ 70 | << tt_detail::print_helper( rhs ); \ 71 | } \ 72 | \ 73 | static char const* revert() \ 74 | { return " " #rev " "; } \ 75 | }; \ 76 | /**/ 77 | 78 | BOOST_TEST_FOR_EACH_COMP_OP( DEFINE_CSTRING_COMPARISON ) 79 | #undef DEFINE_CSTRING_COMPARISON 80 | 81 | //____________________________________________________________________________// 82 | 83 | } // namespace op 84 | } // namespace assertion 85 | } // namespace test_tools 86 | } // namespace boost 87 | 88 | #include 89 | 90 | #endif // BOOST_TEST_TOOLS_CSTRING_COMPARISON_OP_HPP_050815GER 91 | 92 | --------------------------------------------------------------------------------