本文整理汇总了C++中TestCase::getSampleName方法的典型用法代码示例。如果您正苦于以下问题:C++ TestCase::getSampleName方法的具体用法?C++ TestCase::getSampleName怎么用?C++ TestCase::getSampleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestCase
的用法示例。
在下文中一共展示了TestCase::getSampleName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
// Test cases
if (showTestCases)
{
static int testScroll = 0;
if (imguiBeginScrollArea("Choose Test To Run", width-10-250-10-200, height-10-450, 200, 450, &testScroll))
mouseOverMenu = true;
int testToLoad = -1;
for (int i = 0; i < files.size; ++i)
{
if (imguiItem(files.files[i]))
testToLoad = i;
}
if (testToLoad != -1)
{
char path[256];
strcpy(path, "Tests/");
strcat(path, files.files[testToLoad]);
test = new TestCase;
if (test)
{
// Load the test.
if (!test->load(path))
{
delete test;
test = 0;
}
// Create sample
Sample* newSample = 0;
for (int i = 0; i < g_nsamples; ++i)
{
if (strcmp(g_samples[i].name, test->getSampleName()) == 0)
{
newSample = g_samples[i].create();
if (newSample) strcpy(sampleName, g_samples[i].name);
}
}
if (newSample)
{
delete sample;
sample = newSample;
sample->setContext(&ctx);
showSample = false;
}
// Load geom.
strcpy(meshName, test->getGeomFileName());
meshName[sizeof(meshName)-1] = '\0';
delete geom;
geom = 0;
strcpy(path, "Meshes/");
strcat(path, meshName);
geom = new InputGeom;
if (!geom || !geom->loadMesh(&ctx, path))
{
delete geom;
geom = 0;
showLog = true;
logScroll = 0;
ctx.dumpLog("Geom load log %s:", meshName);
}
示例2: main
//.........这里部分代码省略.........
if (imguiBeginScrollArea("Choose Test To Run", width-10-250-10-200, height-10-450, 200, 450, &testScroll))
mouseOverMenu = true;
vector<string>::const_iterator fileIter = files.begin();
vector<string>::const_iterator filesEnd = files.end();
vector<string>::const_iterator testToLoad = filesEnd;
for (; fileIter != filesEnd; ++fileIter)
{
if (imguiItem(fileIter->c_str()))
{
testToLoad = fileIter;
}
}
if (testToLoad != filesEnd)
{
char path[256];
strcpy(path, "TestCases/");
strcat(path, testToLoad->c_str());
test = new TestCase;
if (test)
{
// Load the test.
if (!test->load(path))
{
delete test;
test = 0;
}
// Create sample
Sample* newSample = 0;
for (int i = 0; i < g_nsamples; ++i)
{
if (strcmp(g_samples[i].name, test->getSampleName()) == 0)
{
newSample = g_samples[i].create();
if (newSample) strcpy(sampleName, g_samples[i].name);
}
}
if (newSample)
{
delete sample;
sample = newSample;
sample->setContext(&ctx);
showSample = false;
}
// Load geom.
strcpy(meshName, test->getGeomFileName());
meshName[sizeof(meshName)-1] = '\0';
delete geom;
geom = 0;
strcpy(path, "Meshes/");
strcat(path, meshName);
geom = new InputGeom;
if (!geom || !geom->loadMesh(&ctx, path))
{
delete geom;
geom = 0;
showLog = true;
logScroll = 0;
ctx.dumpLog("Geom load log %s:", meshName);
}