• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ not_passed_list类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中not_passed_list的典型用法代码示例。如果您正苦于以下问题:C++ not_passed_list类的具体用法?C++ not_passed_list怎么用?C++ not_passed_list使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了not_passed_list类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: run_completed

    void run_completed()
    {
        os << std::endl;

        if (not_passed.size() > 0)
        {
            not_passed_list::const_iterator i = not_passed.begin();
            while (i != not_passed.end())
            {
                tut::test_result tr = *i;

                os << std::endl;

                os << "---> " << "group: " << tr.group
                << ", test: test<" << tr.test << ">"
                << (!tr.name.empty() ? (std::string(" : ") + tr.name) : std::string())
                << std::endl;

#if defined(TUT_USE_POSIX)
                if(tr.pid != getpid())
                {
                    os << "     child pid: " << tr.pid << std::endl;
                }
#endif
                os << "     problem: ";
                switch(tr.result)
                {
                case test_result::rethrown:
                    os << "assertion failed in child" << std::endl;
                    break;
                case test_result::fail:
                    os << "assertion failed" << std::endl;
                    break;
                case test_result::ex:
                case test_result::ex_ctor:
                    os << "unexpected exception" << std::endl;
                    if( tr.exception_typeid != "" )
                    {
                        os << "     exception typeid: "
                        << tr.exception_typeid << std::endl;
                    }
                    break;
                case test_result::term:
                    os << "would be terminated" << std::endl;
                    break;
                case test_result::warn:
                    os << "test passed, but cleanup code (destructor) raised"
                        " an exception" << std::endl;
                    break;
                default:
                    break;
                }

                if (!tr.message.empty())
                {
                    if (tr.result == test_result::fail)
                    {
                        os << "     failed assertion: \"" << tr.message << "\""
                            << std::endl;
                    }
                    else
                    {
                        os << "     message: \"" << tr.message << "\""
                            << std::endl;
                    }
                }

                ++i;
            }
        }

        os << std::endl;

        os << "tests summary:";
        if (terminations_count > 0)
        {
            os << " terminations:" << terminations_count;
        }
        if (exceptions_count > 0)
        {
            os << " exceptions:" << exceptions_count;
        }
        if (failures_count > 0)
        {
            os << " failures:" << failures_count;
        }
        if (warnings_count > 0)
        {
            os << " warnings:" << warnings_count;
        }
        os << " ok:" << ok_count;
        os << std::endl;
    }
开发者ID:121903115,项目名称:puremvc-cpp-multicore-framework,代码行数:93,代码来源:tut_console_reporter.hpp


示例2: init

 void init()
 {
     ok_count = 0;
     exceptions_count = 0;
     failures_count = 0;
     terminations_count = 0;
     warnings_count = 0;
     not_passed.clear();
 }
开发者ID:121903115,项目名称:puremvc-cpp-multicore-framework,代码行数:9,代码来源:tut_console_reporter.hpp


示例3: test_completed

    void test_completed(const tut::test_result& tr) override
    {
        if (tr.group != current_group)
        {
            os << std::endl << tr.group << ": " << std::flush;
            current_group = tr.group;
        }

        os << tr << std::flush;

        // update global statistics
        switch (tr.result) {
            case test_result::ok:
                ok_count++;
                break;
            case test_result::fail:
            case test_result::rethrown:
                failures_count++;
                break;
            case test_result::ex:
            case test_result::ex_ctor:
                exceptions_count++;
                break;
            case test_result::warn:
                warnings_count++;
                break;
            case test_result::term:
                terminations_count++;
                break;
            case test_result::skipped:
                skipped_count++;
                break;
            case tut::test_result::dummy:
                assert( (tr.result != tut::test_result::dummy) && "Should never be called");
        } // switch

        if ( (tr.result != tut::test_result::ok) &&
             (tr.result != tut::test_result::skipped) )
        {
            not_passed.push_back(tr);
        }
    }
开发者ID:nextgis-borsch,项目名称:lib_geos,代码行数:42,代码来源:tut_console_reporter.hpp


示例4: test_completed

    void test_completed(const tut::test_result& tr)
    {
        if (tr.group != current_group)
        {
            os << std::endl << tr.group << ": " << std::endl;
            current_group = tr.group;
        }

        os << tr << std::flush;
        if (tr.result == tut::test_result::ok)
        {
            ok_count++;
        }
        else if (tr.result == tut::test_result::ex)
        {
            exceptions_count++;
        }
        else if (tr.result == tut::test_result::ex_ctor)
        {
            exceptions_count++;
        }
        else if (tr.result == tut::test_result::fail)
        {
            failures_count++;
        }
        else if (tr.result == tut::test_result::warn)
        {
            warnings_count++;
        }
        else
        {
            terminations_count++;
        }

        if (tr.result != tut::test_result::ok)
        {
            not_passed.push_back(tr);
        }
    }
开发者ID:coolaj86,项目名称:fizzbuzz,代码行数:39,代码来源:tut_reporter.hpp


示例5: all_ok

 bool all_ok() const
 {
     return not_passed.empty();
 }
开发者ID:121903115,项目名称:puremvc-cpp-multicore-framework,代码行数:4,代码来源:tut_console_reporter.hpp


示例6: all_ok

 bool all_ok() const override
 {
     return not_passed.empty();
 }
开发者ID:nextgis-borsch,项目名称:lib_geos,代码行数:4,代码来源:tut_console_reporter.hpp



注:本文中的not_passed_list类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ npc类代码示例发布时间:2022-05-31
下一篇:
C++ not_null类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap