Пример #1
0
Файл: test.c Проект: 0xc0170/cox
//!
//! \details Test sequence assertion.
//! \note If ulDelay is -1,then this will not break until sequence token is 
//! finished! if ulDelay is not -1,then it will be wait delay time.ulDelay
//! is 0,show that there will be no delay!
//!
//! \return None.
//
//*****************************************************************************
xtBoolean
_TestAssertSequenceBreak(char *pcExpected, unsigned long ulDelay)
{
    char *cp = g_pcTokensBuffer;
    unsigned long ulTemp = ulDelay;
    do
    {
        while (cp < g_pcTok)
        {
            if (*cp++ != *pcExpected++)
            {
                return _TestFail();
            }
        }
        SysCtlDelay(1);
        if (*pcExpected == '\0')
        {
            ClearTokens();
            return xfalse;
        }
        if (ulDelay == 0xFFFFFFFF)
        {
            ulTemp = 1;
        }
        else if(ulDelay != 0)
        {
            ulTemp--;
        }
    } while(ulTemp);
    return _TestFail();
}
Пример #2
0
void cSkindesignerSkinPreview::Set(void) {
    SetPluginMenu(0, skindesignerapi::mtText);
    ClearTokens();
    Clear();

    cSkinRepo *skinRepo = config.GetSkinRepo(currentSkin);
    if (!skinRepo) {
        esyslog("skindesigner: no valid skin repository found for skin %s", currentSkin.c_str());
        return;
    }

    AddStringToken("menuheader", *cString::sprintf("%s: %s \"%s\"", trVDR("Preview"), tr("Skin"), currentSkin.c_str()));
    AddStringToken("skinname", currentSkin);
    AddStringToken("author", skinRepo->Author());

    stringstream plainText;
    plainText << *cString::sprintf("%s: %s \"%s\"", trVDR("Preview"), tr("Skin"), currentSkin.c_str()) << "\n\n";
    plainText << tr("Author") << ": " << skinRepo->Author() << "\n";

    plainText << tr("Used Fonts") << ": \n";
    vector<string> specialFonts = skinRepo->SpecialFonts();
    for (vector<string>::iterator it = specialFonts.begin(); it != specialFonts.end(); it++) {
        map<string,string> usedFonts;
        usedFonts.insert(pair<string,string>("fonts[name]", *it));
        usedFonts.insert(pair<string,string>("fonts[installed]", CheckFontInstalled(*it)));
        AddLoopToken("fonts", usedFonts);
        plainText << *it << "\n";
    }
    
    plainText << tr("Supported Plugins") << ": \n";
    vector<string> supportedPlugins = skinRepo->SupportedPlugins();
    for (vector<string>::iterator it = supportedPlugins.begin(); it != supportedPlugins.end(); it++) {
        map<string,string> plugins;
        plugins.insert(pair<string,string>("plugins[name]", *it));
        AddLoopToken("plugins", plugins);
        plainText << *it << "\n";
    }

    SetText(plainText.str().c_str());

    vector< pair < string, string > > screenshots = skinRepo->Screenshots();
    int i = 0;
    for (vector< pair < string, string > >::iterator it = screenshots.begin(); it != screenshots.end(); it++) {
        string url = it->second;
        string imgType = ".jpg";
        if (url.find(".png") != string::npos)
            imgType = ".png";
        stringstream tempName;
        tempName << "/tmp/screenshot_" << currentSkin << "_" << i++ << imgType;
        dsyslog("skindesigner: download screenshot name %s url %s", tempName.str().c_str(), url.c_str());
        CurlGetUrlFile(url.c_str(), tempName.str().c_str());
        map<string,string> img;
        img.insert(pair<string,string>("screenshots[desc]", it->first));
        img.insert(pair<string,string>("screenshots[path]", tempName.str()));
        AddLoopToken("screenshots", img);
    }
}
Пример #3
0
Файл: test.c Проект: 0xc0170/cox
//*****************************************************************************
//
//! \brief Execute the test.
//!
//! \param psTest is the point of the test case.
//!
//! \details Test suite execution.
//!
//! \return None.
//
//*****************************************************************************
static void 
ExecuteTest(const tTestCase *psTest)
{
    //
    // Initialization
    //
    ClearTokens();
    g_bLocalFail = xfalse;

    if (psTest->Setup != 0)
    {
        psTest->Setup();
    }

    psTest->Execute();

    if (psTest->TearDown != 0)
    {
        psTest->TearDown();
    }
}
Пример #4
0
// AtomMask::ResetMask()
void AtomMask::ResetMask() {
  Natom_ = 0;
  Selected_.clear();
  ClearTokens();
}