亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? client-test-main.cpp

?? funambol windows mobile plugin source code, the source code is taken from the funambol site
?? CPP
字號:
/*
 * Copyright (C) 2006-2007 Funambol, Inc
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 * 02111-1307  USA
 */

/** @cond API */
/** @addtogroup ClientTest */
/** @{ */

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "base/test.h"

#include <cppunit/CompilerOutputter.h>
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/TestListener.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestFailure.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/extensions/HelperMacros.h>

#include <base/Log.h>

#include <stdlib.h>
#include <stdio.h>
#ifdef HAVE_SIGNAL_H
# include <signal.h>
#endif

#include <string>
#include <stdexcept>
using namespace std;

void simplifyFilename(string &filename)
{
    size_t pos = 0;
    while (true) {
        pos = filename.find(":", pos);
        if (pos == filename.npos ) {
            break;
        }
        filename.replace(pos, 1, "_");
    }
}

class ClientOutputter : public CppUnit::CompilerOutputter {
public:
    ClientOutputter(CppUnit::TestResultCollector *result, std::ostream &stream) :
        CompilerOutputter(result, stream) {}
    void write() {
        // ensure that output goes to console again
        LOG.setLogName("test.log");
        CompilerOutputter::write();
    }
};

class ClientListener : public CppUnit::TestListener {
public:
    ClientListener() :
        m_failed(false) {
#ifdef HAVE_SIGNAL_H
        // install signal handler which turns an alarm signal into a runtime exception
        // to abort tests which run too long
        const char *alarm = getenv("CLIENT_TEST_ALARM");
        m_alarmSeconds = alarm ? atoi(alarm) : -1;

        struct sigaction action;
        memset(&action, 0, sizeof(action));
        action.sa_handler = alarmTriggered;
        action.sa_flags = SA_NODEFER;
        sigaction(SIGALRM, &action, NULL);
#endif
    }

    void addAllowedFailures(string allowedFailures) {
        size_t start = 0, end;
        while ((end = allowedFailures.find(',', start)) != allowedFailures.npos) {
            size_t len = end - start;
            if (len) {
                m_allowedFailures.insert(allowedFailures.substr(start, len));
            }
            start = end + 1;
        }
        if (allowedFailures.size() > start) {
            m_allowedFailures.insert(allowedFailures.substr(start));
        }
    }

    void startTest (CppUnit::Test *test) {
        m_currentTest = test->getName();
        LOG.setLogName("test.log");
        cerr << m_currentTest;
        string logfile = m_currentTest + ".log";
        simplifyFilename(logfile);
        remove(logfile.c_str());
        LOG.setLogName(logfile.c_str());
        m_testFailed = false;

#ifdef HAVE_SIGNAL_H
        if (m_alarmSeconds > 0) {
            alarm(m_alarmSeconds);
        }
#endif
    }

    void addFailure(const CppUnit::TestFailure &failure) {
        m_testFailed = true;
    }

    void endTest (CppUnit::Test *test) {
#ifdef HAVE_SIGNAL_H
        if (m_alarmSeconds > 0) {
            alarm(0);
        }
#endif

        LOG.setLogName("test.log");
        if (m_testFailed) {
            if (m_allowedFailures.find(m_currentTest) == m_allowedFailures.end()) {
                cerr << " *** failed ***";
                m_failed = true;
            } else {
                cerr << " *** failure ignored ***";
            }
        }
        cerr << "\n";
    }

    bool hasFailed() { return m_failed; }
    const string &getCurrentTest() const { return m_currentTest; }

private:
    set<string> m_allowedFailures;
    bool m_failed, m_testFailed;
    string m_currentTest;
    int m_alarmSeconds;

    static void alarmTriggered(int signal) {
        CPPUNIT_ASSERT_MESSAGE(false, "test timed out");
    }
} syncListener;

const string &getCurrentTest() {
    return syncListener.getCurrentTest();
}

static void printTests(CppUnit::Test *test, int indention)
{
    if (!test) {
        return;
    }

    std::string name = test->getName();
    printf("%*s%s\n", indention * 3, "", name.c_str());
    for (int i = 0; i < test->getChildTestCount(); i++) {
        printTests(test->getChildTestAt(i), indention+1);
    }
}

int main(int argc, char* argv[])
{
  // Get the top level suite from the registry
  CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();

  if (argc >= 2 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))) {
      printf("usage: %s [test name]+\n\n"
             "Without arguments all available tests are run.\n"
             "Otherwise only the tests or group of tests listed are run.\n"
             "Here is the test hierarchy of this test program:\n",
             argv[0]);
      printTests(suite, 1);
      return 0;
  }

  // Adds the test to the list of test to run
  CppUnit::TextUi::TestRunner runner;
  runner.addTest( suite );

  // Change the default outputter to a compiler error format outputter
  runner.setOutputter( new ClientOutputter( &runner.result(),
                                            std::cerr ) );

  // track current test and failure state
  const char *allowedFailures = getenv("CLIENT_TEST_FAILURES");
  if (allowedFailures) {
      syncListener.addAllowedFailures(allowedFailures);
  }
  runner.eventManager().addListener(&syncListener);

  try {
      // Run the tests.
      if (argc <= 1) {
          // all tests
          runner.run("", false, true, false);
      } else {
          // run selected tests individually
          for (int test = 1; test < argc; test++) {
              runner.run(argv[test], false, true, false);
          }
      }

      // Return error code 1 if the one of test failed.
      return syncListener.hasFailed() ? 1 : 0;
  } catch (invalid_argument e) {
      // Test path not resolved
      std::cerr << std::endl
                << "ERROR: " << e.what()
                << std::endl;
      return 1;
  }
}

/** @} */
/** @endcond */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩一级二级三级| 亚洲免费在线观看| www.日韩大片| 国产精品1024久久| 国产成人夜色高潮福利影视| 色综合视频一区二区三区高清| 99久久免费视频.com| a在线欧美一区| 欧美一级日韩不卡播放免费| 这里只有精品视频在线观看| 欧美高清视频www夜色资源网| 欧美一区二区视频在线观看| 中文字幕亚洲区| 亚洲不卡一区二区三区| 日本vs亚洲vs韩国一区三区二区 | 国产精品久99| 日韩理论片在线| 亚洲成人免费电影| 99vv1com这只有精品| 国产日韩综合av| 国产风韵犹存在线视精品| 精品国产99国产精品| 日本一区二区免费在线观看视频 | 国产成人夜色高潮福利影视| 精品国产欧美一区二区| 日本视频一区二区| 成人午夜免费视频| 5月丁香婷婷综合| 亚洲无人区一区| 国产一区二区三区四| 99久久婷婷国产综合精品电影| 久久久久综合网| 亚洲mv在线观看| 欧美日韩国产三级| 国产女人18毛片水真多成人如厕 | 国产精品日日摸夜夜摸av| 性感美女久久精品| 欧美午夜理伦三级在线观看| 久久午夜电影网| 亚洲午夜精品17c| 欧美精品日韩一本| 久久精品久久综合| 欧美在线你懂的| 国产精品热久久久久夜色精品三区| 国产电影一区二区三区| 亚洲欧洲精品天堂一级| 色8久久精品久久久久久蜜| 精品国产一区二区精华| 国产毛片精品一区| 国产精品嫩草影院com| 91免费看片在线观看| 精品国产一区a| 成人性生交大片免费看视频在线 | 久久免费精品国产久精品久久久久 | 欧美性色黄大片| 日本亚洲天堂网| 国产亚洲自拍一区| 麻豆成人av在线| 欧美丰满高潮xxxx喷水动漫| 久久成人麻豆午夜电影| 欧美国产日韩在线观看| 国产精品一区二区在线观看网站| 7777精品伊人久久久大香线蕉| 免费在线欧美视频| 欧美国产国产综合| 欧美精品一级二级三级| 成人毛片在线观看| 天天综合日日夜夜精品| 欧美精品日韩一区| 国产99一区视频免费| 国产午夜精品美女毛片视频| 一本久久综合亚洲鲁鲁五月天| 三级亚洲高清视频| 欧美一区二区三区视频免费播放| 国产精品主播直播| 亚洲成人免费av| 日韩美女精品在线| 精品国产青草久久久久福利| 色综合久久久久久久久久久| 久久精品国产免费| 亚洲无线码一区二区三区| 日本一区二区免费在线| 日韩欧美成人一区二区| 国产乱人伦偷精品视频免下载| 日韩美女久久久| 国产欧美日韩视频在线观看| 91麻豆精品国产91久久久| 91在线视频在线| 国产成人在线免费观看| 免费日韩伦理电影| 天堂影院一区二区| 亚洲色图19p| 中文字幕欧美国产| 精品美女在线播放| 99精品国产热久久91蜜凸| 久久99九九99精品| 亚洲丝袜美腿综合| 国产欧美精品国产国产专区| 欧美变态凌虐bdsm| 91精品黄色片免费大全| 欧美性受xxxx| 在线看日本不卡| 一本色道亚洲精品aⅴ| 99精品欧美一区二区蜜桃免费| 国产成人综合亚洲91猫咪| 久久丁香综合五月国产三级网站| 午夜精品在线视频一区| 亚洲一区二区精品3399| 久久久久久久综合色一本| 91精品国模一区二区三区| 7777精品久久久大香线蕉| 欧美午夜精品久久久久久超碰 | 免费成人美女在线观看| 亚洲成av人在线观看| 亚洲激情男女视频| 久久久久久一二三区| 精品国产三级a在线观看| 精品av综合导航| 久久久久久久久久电影| 久久久久久久综合色一本| 国产女主播一区| 国产精品电影一区二区三区| 国产精品久久一卡二卡| 亚洲欧美另类小说| 亚洲韩国一区二区三区| 亚洲成人7777| 老司机精品视频在线| 精品一二三四在线| 懂色av中文字幕一区二区三区| 国产伦精品一区二区三区免费| 国产精品一区二区三区乱码| 成人久久18免费网站麻豆| 91农村精品一区二区在线| 欧美日韩你懂的| 色系网站成人免费| 欧美视频在线观看一区| 欧美精品黑人性xxxx| 精品国产一二三| 亚洲色图欧美激情| 青青草国产精品亚洲专区无| 国产做a爰片久久毛片| 日日噜噜夜夜狠狠视频欧美人| 免费精品视频在线| 成人激情小说网站| 高清在线不卡av| 91激情在线视频| 日韩一二三区视频| 欧美一卡2卡3卡4卡| 亚洲精品一线二线三线| 中文字幕在线一区免费| 香蕉成人伊视频在线观看| 国内精品自线一区二区三区视频| 成人精品视频一区二区三区 | 国产亚洲婷婷免费| 亚洲精品免费一二三区| 免费一级欧美片在线观看| 99精品偷自拍| 精品国产一区二区三区不卡| 亚洲欧美一区二区三区极速播放 | 欧美日韩一区二区电影| 2021国产精品久久精品| 一区二区三区免费看视频| 亚洲精品你懂的| 国产一区二区三区在线观看免费| 在线免费观看日本欧美| 国产亚洲欧美一级| 亚洲动漫第一页| 91亚洲国产成人精品一区二区三| 日韩精品一区二区三区四区视频| 中文字幕五月欧美| 国产伦精一区二区三区| 欧美精品三级在线观看| 一区二区三区.www| 成人免费av网站| 国产人成亚洲第一网站在线播放| 午夜a成v人精品| 色天使久久综合网天天| 欧美国产日本韩| 国产一区二区三区免费观看| 欧美一区二区黄| 婷婷久久综合九色综合绿巨人| 91看片淫黄大片一级在线观看| 国产午夜精品一区二区三区嫩草 | 中文字幕精品在线不卡| 麻豆精品久久久| 欧美日韩国产小视频| 亚洲制服丝袜一区| 色播五月激情综合网| 欧美国产视频在线| 国产91精品一区二区| 欧美va在线播放| 久久精品国产99国产| 欧美精品粉嫩高潮一区二区| 亚洲午夜久久久久久久久电影院| 不卡的电影网站| 国产精品久久久久久户外露出| 成人av先锋影音| 亚洲色图清纯唯美| 91色九色蝌蚪| 一区二区三区免费网站|