本文整理汇总了C++中CORRADE_SKIP函数的典型用法代码示例。如果您正苦于以下问题:C++ CORRADE_SKIP函数的具体用法?C++ CORRADE_SKIP怎么用?C++ CORRADE_SKIP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CORRADE_SKIP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CORRADE_SKIP
void FramebufferGLTest::constructMove() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
Framebuffer a({{32, 16}, {128, 256}});
const Int id = a.id();
MAGNUM_VERIFY_NO_ERROR();
CORRADE_VERIFY(id > 0);
Framebuffer b(std::move(a));
CORRADE_COMPARE(a.id(), 0);
CORRADE_COMPARE(b.id(), id);
CORRADE_COMPARE(b.viewport(), Range2Di({32, 16}, {128, 256}));
Framebuffer c({{128, 256}, {32, 16}});
const Int cId = c.id();
c = std::move(b);
MAGNUM_VERIFY_NO_ERROR();
CORRADE_VERIFY(cId > 0);
CORRADE_COMPARE(b.id(), cId);
CORRADE_COMPARE(c.id(), id);
CORRADE_COMPARE(c.viewport(), Range2Di({32, 16}, {128, 256}));
}
示例2: CORRADE_SKIP
void BufferGLTest::map() {
#ifdef MAGNUM_TARGET_GLES
if(!Context::current().isExtensionSupported<Extensions::GL::OES::mapbuffer>())
CORRADE_SKIP(Extensions::GL::OES::mapbuffer::string() + std::string(" is not supported"));
#endif
Buffer buffer;
constexpr char data[] = {2, 7, 5, 13, 25};
buffer.setData(data, BufferUsage::StaticDraw);
#ifndef MAGNUM_TARGET_GLES
char* contents = buffer.map<char>(Buffer::MapAccess::ReadWrite);
#else
char* contents = buffer.map<char>(Buffer::MapAccess::WriteOnly);
#endif
MAGNUM_VERIFY_NO_ERROR();
CORRADE_VERIFY(contents);
#ifndef MAGNUM_TARGET_GLES2
CORRADE_COMPARE(contents[2], 5);
#endif
contents[3] = 107;
CORRADE_VERIFY(buffer.unmap());
MAGNUM_VERIFY_NO_ERROR();
/** @todo How to verify the contents in ES? */
#ifndef MAGNUM_TARGET_GLES
Containers::Array<char> changedContents = buffer.data<char>();
CORRADE_COMPARE(changedContents.size(), 5);
CORRADE_COMPARE(changedContents[3], 107);
#endif
}
示例3: CORRADE_SKIP
void FramebufferGLTest::invalidate() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
Renderbuffer color;
#ifndef MAGNUM_TARGET_GLES2
color.setStorage(RenderbufferFormat::RGBA8, Vector2i(128));
#else
color.setStorage(RenderbufferFormat::RGBA4, Vector2i(128));
#endif
Renderbuffer stencil;
stencil.setStorage(RenderbufferFormat::StencilIndex8, Vector2i(128));
Framebuffer framebuffer({{}, Vector2i(128)});
framebuffer.attachRenderbuffer(Framebuffer::ColorAttachment(0), color)
.attachRenderbuffer(Framebuffer::BufferAttachment::Stencil, stencil);
MAGNUM_VERIFY_NO_ERROR();
framebuffer.invalidate({Framebuffer::InvalidationAttachment::Depth, Framebuffer::ColorAttachment(0)});
MAGNUM_VERIFY_NO_ERROR();
}
示例4: CORRADE_SKIP
void AbstractQueryGLTest::constructMove() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not supported."));
#endif
SampleQuery a;
const Int id = a.id();
MAGNUM_VERIFY_NO_ERROR();
CORRADE_VERIFY(id > 0);
SampleQuery b(std::move(a));
CORRADE_COMPARE(a.id(), 0);
CORRADE_COMPARE(b.id(), id);
SampleQuery c;
const Int cId = c.id();
c = std::move(b);
MAGNUM_VERIFY_NO_ERROR();
CORRADE_VERIFY(cId > 0);
CORRADE_COMPARE(b.id(), cId);
CORRADE_COMPARE(c.id(), id);
}
示例5: CORRADE_SKIP
void SampleQueryGLTest::wrap() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not available."));
#endif
GLuint id;
#ifndef MAGNUM_TARGET_GLES2
glGenQueries(1, &id);
#else
glGenQueriesEXT(1, &id);
#endif
/* Releasing won't delete anything */
{
auto query = SampleQuery::wrap(id, SampleQuery::Target::AnySamplesPassed, ObjectFlag::DeleteOnDestruction);
CORRADE_COMPARE(query.release(), id);
}
/* ...so we can wrap it again */
SampleQuery::wrap(id, SampleQuery::Target::AnySamplesPassed);
#ifndef MAGNUM_TARGET_GLES2
glDeleteQueries(1, &id);
#else
glDeleteQueriesEXT(1, &id);
#endif
}
示例6: CORRADE_SKIP
void TextureGLTest::subImageBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
constexpr UnsignedByte zero[4*4*4] = {};
constexpr UnsignedByte subData[] = { 0x00, 0x01, 0x02, 0x03,
0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b,
0x0c, 0x0d, 0x0e, 0x0f };
RectangleTexture texture;
texture.setImage(TextureFormat::RGBA8,
ImageReference2D(ColorFormat::RGBA, ColorType::UnsignedByte, Vector2i(4), zero));
texture.setSubImage(Vector2i(1),
BufferImage2D(ColorFormat::RGBA, ColorType::UnsignedByte, Vector2i(2), subData, BufferUsage::StaticDraw));
MAGNUM_VERIFY_NO_ERROR();
BufferImage2D image(ColorFormat::RGBA, ColorType::UnsignedByte);
texture.image(image, BufferUsage::StaticRead);
const auto imageData = image.buffer().data<UnsignedByte>();
MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector2i(4));
CORRADE_COMPARE_AS(std::vector<UnsignedByte>(imageData.begin(), imageData.end()), (std::vector<UnsignedByte>{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0,
0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}), TestSuite::Compare::Container);
}
示例7: defined
void Test::hierarchy() {
#if defined(CORRADE_TARGET_NACL_NEWLIB) || defined(CORRADE_TARGET_EMSCRIPTEN)
CORRADE_SKIP("Dependency hierarchy is meaningful only for dynamic plugins");
#else
PluginManager::Manager<AbstractAnimal> manager(PLUGINS_DIR);
CORRADE_COMPARE(manager.load("Chihuahua"), LoadState::Loaded);
CORRADE_COMPARE(manager.loadState("Dog"), LoadState::Loaded);
CORRADE_COMPARE(*manager.metadata("Chihuahua")->name(), "The smallest dog in the world.");
CORRADE_COMPARE(manager.metadata("Chihuahua")->depends().size(), 1);
CORRADE_COMPARE(manager.metadata("Chihuahua")->depends()[0], "Dog");
CORRADE_COMPARE(manager.metadata("Dog")->usedBy().size(), 1);
CORRADE_COMPARE(manager.metadata("Dog")->usedBy()[0], "Chihuahua");
{
std::unique_ptr<AbstractAnimal> animal = manager.instance("Chihuahua");
CORRADE_VERIFY(animal);
CORRADE_VERIFY(animal->hasTail()); // inherited from dog
CORRADE_COMPARE(animal->legCount(), 4); // this too
CORRADE_COMPARE(animal->name(), "Rodriguez");
/* Try to unload plugin when another is depending on it */
CORRADE_COMPARE(manager.unload("Dog"), LoadState::Required);
}
/* After deleting instance, unload chihuahua plugin, then try again */
CORRADE_COMPARE(manager.unload("Chihuahua"), LoadState::NotLoaded);
CORRADE_COMPARE(manager.unload("Dog"), LoadState::NotLoaded);
CORRADE_VERIFY(manager.metadata("Dog")->usedBy().empty());
#endif
}
示例8: CORRADE_SKIP
void FramebufferGLTest::invalidateSub() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
Renderbuffer color;
#ifndef MAGNUM_TARGET_GLES2
color.setStorage(RenderbufferFormat::RGBA8, Vector2i(128));
#else
color.setStorage(RenderbufferFormat::RGBA4, Vector2i(128));
#endif
Renderbuffer depth;
depth.setStorage(RenderbufferFormat::DepthComponent16, Vector2i(128));
Framebuffer framebuffer({{}, Vector2i(128)});
framebuffer.attachRenderbuffer(Framebuffer::ColorAttachment(0), color)
.attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depth);
MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::ReadDraw), Framebuffer::Status::Complete);
framebuffer.invalidate({Framebuffer::InvalidationAttachment::Depth, Framebuffer::ColorAttachment(0)},
{{32, 16}, {79, 64}});
MAGNUM_VERIFY_NO_ERROR();
}
示例9: CORRADE_SKIP
void FramebufferGLTest::multipleColorOutputs() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::NV::draw_buffers>())
CORRADE_SKIP(Extensions::GL::NV::draw_buffers::string() + std::string(" is not available."));
#endif
Texture2D color1;
#ifndef MAGNUM_TARGET_GLES2
color1.setStorage(1, TextureFormat::RGBA8, Vector2i(128));
#else
color1.setStorage(1, TextureFormat::RGBA, Vector2i(128));
#endif
Texture2D color2;
#ifndef MAGNUM_TARGET_GLES2
color2.setStorage(1, TextureFormat::RGBA8, Vector2i(128));
#else
color2.setStorage(1, TextureFormat::RGBA, Vector2i(128));
#endif
Renderbuffer depth;
depth.setStorage(RenderbufferFormat::DepthComponent16, Vector2i(128));
Framebuffer framebuffer({{}, Vector2i(128)});
framebuffer.attachTexture(Framebuffer::ColorAttachment(0), color1, 0)
.attachTexture(Framebuffer::ColorAttachment(1), color2, 0)
.attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depth)
.mapForDraw({{0, Framebuffer::ColorAttachment(1)},
{1, Framebuffer::ColorAttachment(0)}});
#ifdef MAGNUM_TARGET_GLES2
if(Context::current()->isExtensionSupported<Extensions::GL::NV::read_buffer>())
#endif
{
#ifdef MAGNUM_TARGET_GLES2
Debug() << "Using" << Extensions::GL::NV::read_buffer::string();
#endif
framebuffer.mapForRead(Framebuffer::ColorAttachment(1));
}
MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::ReadDraw), Framebuffer::Status::Complete);
}
示例10: CORRADE_SKIP
void MultisampleTextureGLTest::construct2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 is not supported.");
#endif
{
MultisampleTexture2D texture;
MAGNUM_VERIFY_NO_ERROR();
CORRADE_VERIFY(texture.id() > 0);
}
MAGNUM_VERIFY_NO_ERROR();
}
示例11: CORRADE_VERIFY
void DirectoryTest::readNonSeekable() {
#ifdef __unix__ /* (OS X doesn't have /proc) */
/** @todo Test more thoroughly than this */
const auto data = Directory::read("/proc/loadavg");
CORRADE_VERIFY(!data.empty());
#else
CORRADE_SKIP("Not implemented on this platform.");
#endif
}
示例12: CORRADE_SKIP
void AbstractObjectGLTest::labelNoOp() {
if(Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>())
CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is supported."));
Buffer buffer;
buffer.setLabel("MyBuffer");
CORRADE_COMPARE(buffer.label(), "");
MAGNUM_VERIFY_NO_ERROR();
}
示例13: CORRADE_SKIP
void MultisampleTextureGLTest::storage2DArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported."));
#endif
MultisampleTexture2DArray texture;
texture.setStorage(4, TextureFormat::RGBA8, {16, 16, 5});
MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(texture.imageSize(), Vector3i(16, 16, 5));
MAGNUM_VERIFY_NO_ERROR();
}
示例14: CORRADE_SKIP
void ContextGLTest::isExtensionDisabled() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::APPLE::vertex_array_object>())
CORRADE_SKIP(Extensions::GL::APPLE::vertex_array_object::string() + std::string(" extension should be supported, can't test"));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>())
CORRADE_SKIP(Extensions::GL::ARB::explicit_attrib_location::string() + std::string(" extension should be supported, can't test"));
/* This is not disabled anywhere */
CORRADE_VERIFY(!Context::current()->isExtensionDisabled<Extensions::GL::APPLE::vertex_array_object>());
/* This is disabled in GL < 3.2 to work around GLSL compiler bugs */
CORRADE_VERIFY(Context::current()->isExtensionDisabled<Extensions::GL::ARB::explicit_attrib_location>(Version::GL310));
CORRADE_VERIFY(!Context::current()->isExtensionDisabled<Extensions::GL::ARB::explicit_attrib_location>(Version::GL320));
#else
CORRADE_SKIP("No useful extensions to test on OpenGL ES");
#endif
}
示例15: CORRADE_SKIP
void DebugOutputGLTest::setCallback() {
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>())
CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported"));
/* Need to be careful, because the test runner is using debug output too */
DebugOutput::setDefaultCallback();
MAGNUM_VERIFY_NO_ERROR();
}