本文整理汇总了C++中TestState::untested方法的典型用法代码示例。如果您正苦于以下问题:C++ TestState::untested方法的具体用法?C++ TestState::untested怎么用?C++ TestState::untested使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestState
的用法示例。
在下文中一共展示了TestState::untested方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exit
void
load_data()
{
LcShm lc;
char *shmaddr;
string con1 = "lc_reply";
if (!lc.connect(con1)) {
if (errno == EACCES) {
runtest.untested("Couldn't map input file, permission problems!!");
} else {
runtest.unresolved("LcShm::connect()");
}
exit(0);
}
shmaddr = reinterpret_cast<char*>(lc.begin());
// if (memcmp(shmaddr, con1.c_str():
// Since this is a test case, populate the memory with known good data
string srcdir = SRCDIR;
srcdir += "/segment.raw";
int fd = ::open(srcdir.c_str(), O_RDONLY);
void *dataptr = mmap(0, 64528, PROT_READ, MAP_SHARED, fd, 0);
if (dataptr != (void*)-1) {
memcpy(shmaddr, dataptr, 64528);
} else {
if (errno == EACCES) {
runtest.unresolved("Couldn't map input file, permission problems!!");
} else {
runtest.unresolved("Couldn't map input file!");
log_debug("Error was: %s", strerror(errno));
}
exit(0);
}
::close(fd);
}
示例2: tpixtow
void
test_geometry(Renderer *renderer, const std::string &type)
{
cout << "\t" << type << " geometry tests" << endl;
if (!renderer) {
runtest.unresolved("No renderer to test!");
return;
}
int x = 10;
int y = 10;
geometry::Point2d nz(200, 0);
geometry::Point2d z(x, y);
geometry::Range2d<int> pixelbounds;
geometry::Range2d<int> worldbounds;
Timer tpixtow("pixel_to_world(int, int)");
z = renderer->pixel_to_world(x, y);
tpixtow.stop();
if ((z.x >= 199) || (z.y >= 199)) {
runtest.pass(std::string("pixel_to_world(int, int) ") + tpixtow.elapsed());
} else {
runtest.fail(std::string("pixel_to_world(int, int) ") + tpixtow.elapsed());
}
#if 0
Timer tpixtow2("pixel_to_world(pixelbounds)");
worldbounds = renderer->pixel_to_world(pixelbounds);
tpixtow2.stop();
if (worldbounds.isNull()) {
runtest.pass(std::string("pixel_to_world(geometry::Range2d<int>) ") + tpixtow2.elapsed());
} else {
runtest.fail(std::string("pixel_to_world(geometry::Range2d<int>) ") + tpixtow2.elapsed());
}
#else
runtest.untested("pixel_to_world(geometry::Range2d<int>)");
#endif
Timer twtop("world_to_pixel(geometry::Range2d<int>)");
pixelbounds = renderer->world_to_pixel(worldbounds);
twtop.stop();
if (pixelbounds.isNull()) {
runtest.pass(std::string("world_to_pixel(geometry::Range2d<int>) ") + twtop.elapsed());
} else {
runtest.fail(std::string("world_to_pixel(geometry::Range2d<int>) ") + twtop.elapsed());
}
SWFRect bounds;
Timer tbounds1("bounds_in_clipping_area(SWFRect)");
bool ret = renderer->bounds_in_clipping_area(bounds);
tbounds1.stop();
if (ret) {
runtest.pass(std::string("bounds_in_clipping_area(SWFRect) ") + tbounds1.elapsed());
} else {
runtest.fail(std::string("bounds_in_clipping_area(SWFRect) ") + tbounds1.elapsed());
}
InvalidatedRanges ranges;
Timer tbounds2("bounds_in_clipping_area(InvalidatedRanges)");
ret = renderer->bounds_in_clipping_area(ranges);
tbounds2.stop();
if (!ret) {
runtest.pass(std::string("bounds_in_clipping_area(InvalidatedRanges) ") + tbounds2.elapsed());
} else {
runtest.fail(std::string("bounds_in_clipping_area(InvalidatedRanges) ") + tbounds2.elapsed());
}
Timer tbounds3("bounds_in_clipping_area(geometry::Range2d<int>)");
ret = renderer->bounds_in_clipping_area(pixelbounds);
tbounds3.stop();
if (!ret) {
runtest.pass(std::string("bounds_in_clipping_area(geometry::Range2d<int>) ") + tbounds3.elapsed());
} else {
runtest.fail(std::string("bounds_in_clipping_area(geometry::Range2d<int>) ") + tbounds3.elapsed());
}
}
示例3: color
void
test_renderer(Renderer *renderer, const std::string &type)
{
cout << "Testing " << type << " Renderer" << endl;
// Timer trend("Renderer Tests", true);
if (!renderer) {
runtest.unresolved("No renderer to test!");
return;
}
if (renderer > 0) {
runtest.pass("Got Renderer");
} else {
runtest.fail("Couldn't get Renderer");
}
if (!renderer->description().empty()) {
if (renderer->description() == type) {
runtest.pass("description is correct");
} else {
runtest.fail("description is wrong");
}
} else {
runtest.fail("Couldn't get description!");
}
#if 0
if (renderer->getBitsPerPixel()) {
runtest.pass("getBitsPerPixel()");
} else {
runtest.fail("getBitsPerPixel()");
}
#endif
image::GnashImage *frame1 = new image::ImageRGBA(10, 12);
std::auto_ptr<image::GnashImage> im1(frame1);
CachedBitmap *cb = renderer->createCachedBitmap(im1);
if (cb) {
image::GnashImage &gi = cb->image();
if ((gi.width() == 10) && (gi.height() == 12)) {
runtest.pass("createCachedBitmap()");
} else {
runtest.fail("createCachedBitmap()");
}
} else {
runtest.unresolved("createCachedBitmap()");
}
#if 0
// FIXME: initTestBuffer() is going away, replaced by the fake
// framebuffer code.
// Initializes the renderer for off-screen rendering used by the testsuite.
if (renderer->initTestBuffer(10, 10)) {
runtest.pass("initTestBuffer()");
} else {
runtest.fail("initTestBuffer()");
}
#endif
/// @coords an array of 16-bit signed integer coordinates. Even indices
/// (and 0) are x coordinates, while uneven ones are y coordinates.
/// @vertex_count the number of x-y coordinates (vertices).
/// @color the color to be used to draw the line strip.
/// @mat the SWFMatrix to be used to transform the vertices.
boost::uint16_t x = 10;
boost::uint16_t y = 10;
boost::uint16_t h = 10;
std::vector<point> box = boost::assign::list_of
(point(x, y))
(point(x, y + h));
rgba color(0, 0, 0, 255);
SWFMatrix mat;
mat.set_scale_rotation(1, 3, 0);
Timer tdrawline("drawline");
renderer->drawLine(box, color, mat);
tdrawline.stop();
// if (1) {
// runtest.pass("drawLine()");
// } else {
// runtest.fail("drawLine()");
// }
runtest.unresolved(std::string("drawLine() ") + tdrawline.elapsed());
//drawVideoFrame(image::GnashImage* frame, const Transform& xform, const SWFRect* bounds, bool smooth);
#if 0
image::GnashImage *frame;
const Transform xform;
const SWFRect bounds;
bool smooth;
Timer tdrawvideo("drawVideoFrame");
renderer->drawVideoFrame(frame, xform, bounds, smooth);
tdrawvideo.stop();
#endif
runtest.untested("drawVideoFrame()");
point *corners = 0;
//.........这里部分代码省略.........
示例4:
int
main(int argc, char *argv[])
{
// FIXME: for now, always run verbose till this supports command line args
dbglogfile.setVerbosity();
rawfb::RawFBDevice rfb;
if (!rfb.initDevice(argc, argv)) {
runtest.fail("RawFBDevice:InitDevice()");
} else {
runtest.pass("RawFBDevice:InitDevice()");
}
bool ret = rfb.attachWindow(rfb.getHandle());
if (rfb.getFBMemory()) {
runtest.pass("RawFBDevice::attachWindow()");
} else {
runtest.fail("RawFBDevice::attachWindow()");
}
#ifdef ENABLE_DOUBLE_BUFFERING
if (rfb.getOffscreenBuffer()) {
runtest.pass("RawFBDevice::getOffscreenBuffer()");
} else {
runtest.fail("RawFBDevice::getOffscreenBuffer()");
}
#else
runtest.untested("RawFBDevice::getOffscreenBuffer()");
#endif
if (ret && rfb.getStride()) {
runtest.pass("RawFBDevice::getStride()");
} else {
runtest.fail("RawFBDevice::getStride()");
}
if (ret && rfb.getWidth()) {
runtest.pass("RawFBDevice::getWidth()");
} else {
runtest.fail("RawFBDevice::getWidth()");
}
if (ret && rfb.getHeight()) {
runtest.pass("RawFBDevice::getHeight()");
} else {
runtest.fail("DirecTFBDevice::getHeight()");
}
if (ret && rfb.isSingleBuffered()) {
runtest.pass("RawFBDevice::is*Buffered()");
} else {
runtest.fail("RawFBDevice::is*Buffered()");
}
if (ret && rfb.getDepth()) {
runtest.pass("RawFBDevice::getDepth()");
} else {
runtest.fail("RawFBDevice::getDepth()");
}
if (ret && rfb.getRedSize() > 0) {
runtest.pass("RawFBDevice::getRedSize()");
} else {
runtest.fail("RawFBDevice::getRedSize()");
}
if (ret && rfb.getGreenSize() > 0) {
runtest.pass("RawFBDevice::getGreenSize()");
} else {
runtest.fail("RawFBDevice::getGreenSize()");
}
if (ret && rfb.getBlueSize() > 0) {
runtest.pass("RawFBDevice::getBlueSize()");
} else {
runtest.fail("RawFBDevice::getBlueSize()");
}
#if 0
if (rfb.setGrayscaleLUT8()) {
runtest.pass("RawFBDevice::setGrayscaleLUT8()");
} else {
runtest.fail("RawFBDevice::setGrayscaleLUT8()");
}
#endif
// AGG uses these to calculate the poixel format
#ifdef RENDERER_AGG
if (ret && rfb.getRedOffset() > 0) {
runtest.pass("RawFBDevice::getRedOffset()");
} else {
runtest.fail("RawFBDevice::getRedOffset()");
}
if (ret && rfb.getGreenOffset() > 0) {
runtest.pass("RawFBDevice::getGreenOffset()");
} else {
runtest.fail("RawFBDevice::getGreenOffset()");
}
//.........这里部分代码省略.........
示例5: mallinfo
//.........这里部分代码省略.........
diff = mem.diffStats();
// cerr << "Memory::Memory: " << diff << endl;
if ((diff >= 8) || (diff <= 16)) {
runtest.pass("Memory::Memory");
} else {
runtest.fail("Memory::Memory");
}
if (mem.diffStamp() > 0) {
runtest.pass("Memory::diffStamp()");
} else {
runtest.fail("Memory::diffStamp()");
}
if (mem.diffStats() > 0) {
runtest.pass("Memory::diffStats()");
} else {
runtest.fail("Memory::diffStats()");
}
char *x = new char[120];
mem.addStats(__LINE__); // take a sample
diff = mem.diffStats();
// cerr << "Buffer allocation: " << diff << endl;
if ((diff >= 104) && (diff <= 136)) {
runtest.pass("Buffer allocation");
} else {
runtest.fail("Buffer allocation");
}
vector<string> sv;
sv.push_back("Hello World");
mem.addStats(__LINE__); // take a sample
diff = mem.diffStats();
// cerr << "First string allocated: " << diff << endl;
if ((diff >= 40) && (diff <= 48)) {
runtest.pass("First string allocated");
} else {
runtest.fail("First string allocated");
}
sv.push_back("Aloha");
delete x;
mem.addStats(__LINE__); // take a sample
diff = mem.diffStats();
// cerr << "Second string allocated: " << diff << endl;
if ((diff >= -104) && (diff <= -96)) {
runtest.pass("Second string allocated");
} else {
runtest.fail("Second string allocated");
}
sv.push_back("Guten Tag");
mem.addStats(__LINE__); // take a sample
diff = mem.diffStats();
// cerr << "Third string allocated: " << diff << endl;
if ((diff >= 40) && (diff <= 48)){
runtest.pass("Third string allocated");
} else {
runtest.fail("Third string allocated");
}
mem.startCheckpoint();
test_leak();
if (mem.endCheckpoint()) {
runtest.fail("leak");
} else {
runtest.pass("leak");
}
mem.addStats(__LINE__); // take a sample
if (mem.diffStats() == 32) {
runtest.pass("test_leak");
} else {
runtest.fail("test_leak");
}
mem.startCheckpoint();
test_noleak();
mem.addStats(__LINE__); // take a sample
if (mem.endCheckpoint()) {
runtest.pass("noleak");
} else {
runtest.fail("noleak");
}
diff = mem.diffStats();
if ((diff >= 0) && (diff <= 8)) {
runtest.pass("test_noleak");
} else {
runtest.fail("test_noleak");
}
mem.endStats();
// mem.dump();
mem.analyze();
#else
runtest.untested("No support for mallinfo()");
#endif // end of HAVE_MALLINFO
}
示例6: open
void
test_egl(EGLDevice &egl, GnashDevice::rtype_t rtype, int argc, char *argv[])
{
bool hwinit = false;
if (EGLDevice::getRenderableTypes()) {
runtest.pass("EGLDevice::getRenderableTypes()");
} else {
runtest.fail("EGLDevice::getRenderableTypes()");
}
// This is a utility method for converting integer error codes to
// something human readable for debugging.
string result = "EGL_BAD_CONFIG";
if (egl.getErrorString(EGL_BAD_CONFIG) == result) {
runtest.pass("EGLDevice::getErrorString()");
} else {
runtest.fail("EGLDevice::getErrorString()");
}
if (egl.initDevice(argc, argv)) {
runtest.pass("EGLDevice::initDevice()");
hwinit = true;
} else {
runtest.fail("EGLDevice::initDevice()");
}
if (hwinit) {
if (egl.bindClient(rtype)) {
runtest.pass("EGLDevice::bindClient()");
} else {
runtest.fail("EGLDevice::bindClient()");
}
} else {
runtest.untested("EGLDevice::bindClient()");
}
// egl.printEGLConfig();
// If there are more than zero configurations, something beyond
// initializing is working
if (hwinit) {
if (egl.queryEGLConfig()) {
runtest.pass("EGLDevice::queryEGLConfig()");
} else {
runtest.fail("EGLDevice::queryEGLConfig()");
}
} else {
runtest.untested("EGLDevice::queryEGLConfig()");
}
// Init'ing to zero uses the root screen as the display. Otherwise
// the argument should be an EGLNativeWindowType.
int win = 0;
#ifdef ENABLE_FAKE_FRAMEBUFFER
win = open("/tmp/fbe_buffer", O_RDWR);
#else
# ifdef BUILD_RAWFB_DEVICE
win = open("/dev/fb0", O_RDWR);
# endif
# ifdef BUILD_X11_DEVICE
x11::X11Device x11(egl.getNativeVisual());
win = x11.getHandle();
# endif
#endif
if (egl.attachWindow(win)) {
runtest.pass("EGLDevice::attachWindow()");
} else {
runtest.fail("EGLDevice::attachWindow()");
hwinit = false;
}
if (hwinit) {
if (egl.supportsRenderer(rtype)) {
runtest.pass("EGLDevice::supportsRenderer()");
} else {
runtest.fail("EGLDevice::supportsRenderer()");
}
} else {
runtest.untested("EGLDevice::supportsRenderer()");
}
// pixel formats are either 8,8,8 or 5,6,5
if (hwinit) {
if ((egl.getRedSize() == 8) || (egl.getRedSize() == 5)) {
runtest.pass("EGLDevice::getRedSize()");
} else {
runtest.fail("EGLDevice::getRedSize()");
}
} else {
runtest.untested("EGLDevice::getRedSize()");
}
if (hwinit) {
if ((egl.getGreenSize() == 8) || (egl.getGreenSize() == 6)) {
runtest.pass("EGLDevice::getGreenSize()");
} else {
runtest.fail("EGLDevice::getGreenSize()");
}
} else {
//.........这里部分代码省略.........