本文整理汇总了C++中TestState类的典型用法代码示例。如果您正苦于以下问题:C++ TestState类的具体用法?C++ TestState怎么用?C++ TestState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: TestWriteMethod
void TestWriteMethod()
{
TestState* state = WriteNextStateStart();
state->Write();
state->Write();
state->Write();
WriteNextStateStop();
}
开发者ID:Andux,项目名称:jack2,代码行数:8,代码来源:testAtomic.cpp
示例2: TestReadMethod
void TestReadMethod()
{
TestState* state;
int fCount = 0;
long result[SIZE];
UInt16 cur_index;
UInt16 next_index;
do {
cur_index = GetCurrentIndex();
fCount++;
state = ReadCurrentState();
bool res = state->ReadCopy(result);
next_index = GetCurrentIndex();
if (!res)
printf("TestReadMethod fCount %ld cur %ld next %ld\n", fCount, cur_index, next_index);
}while (cur_index != next_index);
state->Check(result);
}
开发者ID:Andux,项目名称:jack2,代码行数:18,代码来源:testAtomic.cpp
示例3: check_localization_variable
void check_localization_variable( TestState& state ) {
dStorm::input::Traits<dStorm::Localization> traits;
dStorm::Localization loc;
loc.position_x() = 15 * boost::units::si::meter;
ValueVariable<localization::PositionX> v;
try {
v.get(traits);
state.fail( "No error thrown when traits with X coordinate unset were provided to get()" );
} catch (...) {}
DynamicUnit meter_only;
meter_only[ *UnitTable().find("m") ] = 1;
DynamicQuantity fifteen_meters( 15, meter_only );
traits.position_x().is_given = true;
state( v.is_static(traits) == false );
state( v.get(traits) != fifteen_meters );
state( v.get(loc) == fifteen_meters );
}
开发者ID:stevewolter,项目名称:rapidSTORM,代码行数:22,代码来源:localization_variable.cpp
示例4: mem
// make sure when we delete a Buffer, *all* the allocated
// memory goes away. As the only way to do this is to examine
// the malloc buffers in the kernel, this will only work on
// POSIX conforming systems, and probabably only Linux & BSD.
void
test_destruct()
{
// these tests are bogus unless you have both mallinfo()
// and also have memory statistics gathering turned on.
#if defined(HAVE_MALLINFO) && defined(USE_STATS_MEMORY)
Memory mem(5);
mem.addStats(__LINE__); // take a sample
Buffer *buf1, *buf2;
mem.startCheckpoint();
buf1 = new Buffer(NETBUFSIZE);
delete buf1;
if (mem.endCheckpoint()) {
runtest.pass ("Buffer::~Buffer()");
} else {
runtest.fail ("Buffer::~Buffer()");
}
mem.startCheckpoint();
buf2 = new Buffer(124);
delete buf2;
if (mem.endCheckpoint()) {
runtest.pass ("Buffer::~Buffer(size_t)");
} else {
runtest.fail ("Buffer::~Buffer(size_t)");
}
#endif
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:35,代码来源:test_buffer.cpp
示例5: memset
// Make sure we can read and write binary AMF strings
void
test_String(void)
{
AMF amf_obj;
int fd, ret;
char buf[AMF_VIDEO_PACKET_SIZE+1];
// First see if we can read strings. This file is produced by
// using a network packet sniffer, and should be binary correct.
memset(buf, 0, AMF_VIDEO_PACKET_SIZE+1);
fd = open("string1.amf", O_RDONLY);
ret = read(fd, buf, AMF_VIDEO_PACKET_SIZE);
close(fd);
char *str = amf_obj.extractString(buf);
if (strcmp(str, "connect") == 0) {
runtest.pass("Extracted \"connect\" string");
} else {
runtest.fail("Extracted \"connect\" string");
}
// Now make sure we can also create strings. We'll create the same
// string we just read, and make sure they match.
char *connect = "connect";
void *out = amf_obj.encodeElement(AMF::STRING, connect, strlen(connect));
if (memcmp(out, buf, 10) == 0) {
runtest.pass("Encoded \"connect\" string");
} else {
runtest.fail("Encoded \"connect\" string");
}
delete str;
}
开发者ID:jlopez,项目名称:gnash,代码行数:34,代码来源:amftest.cpp
示例6: Buffer
void
test_read(std::string &filespec)
{
GNASH_REPORT_FUNCTION;
struct stat st;
boost::shared_ptr<Buffer> hex1(new Buffer("00 bf 00 00 01 28 54 43 53 4f 00 04 00 00 00 00 00 08 73 65 74 74 69 6e 67 73 00 00 00 00 00 04 67 61 69 6e 00 40 49 00 00 00 00 00 00 00 00 0f 65 63 68 6f 73 75 70 70 72 65 73 73 69 6f 6e 01 00 00 00 11 64 65 66 61 75 6c 74 6d 69 63 72 6f 70 68 6f 6e 65 02 00 0e 2f 64 65 76 2f 69 6e 70 75 74 2f 6d 69 63 00 00 0d 64 65 66 61 75 6c 74 63 61 6d 65 72 61 02 00 00 00 00 0d 64 65 66 61 75 6c 74 6b 6c 69 6d 69 74 00 40 59 00 00 00 00 00 00 00 00 0d 64 65 66 61 75 6c 74 61 6c 77 61 79 73 01 00 00 00 10 63 72 6f 73 73 64 6f 6d 61 69 6e 41 6c 6c 6f 77 01 01 00 00 11 63 72 6f 73 73 64 6f 6d 61 69 6e 41 6c 77 61 79 73 01 01 00 00 18 61 6c 6c 6f 77 54 68 69 72 64 50 61 72 74 79 4c 53 4f 41 63 63 65 73 73 01 01 00 00 0c 74 72 75 73 74 65 64 50 61 74 68 73 03 00 00 09 00 00 0c 6c 6f 63 61 6c 53 65 63 50 61 74 68 02 00 00 00 00 10 6c 6f 63 61 6c 53 65 63 50 61 74 68 54 69 6d 65 00 42 71 6d 14 10 22 e0 00 00"));
if (stat(filespec.c_str(), &st) == 0) {
SOL sol;
sol.readFile(filespec);
vector<boost::shared_ptr<cygnal::Element> > els = sol.getElements();
if (els.size() > 1) {
string str = els[2]->to_string();
// Make sure multiple elements of varying datatypes are checked for.
if ((strcmp(els[0]->getName(), "gain") == 0) &&
(strcmp(els[2]->getName(), "defaultmicrophone") == 0) &&
(str == "/dev/input/mic") &&
(strcmp(els[5]->getName(), "defaultalways") == 0) &&
(strcmp(els[9]->getName(), "trustedPaths") == 0)) {
runtest.pass("Read SOL File");
} else {
runtest.fail("Read SOL file");
}
} else {
runtest.fail("Read SOL file");
}
// sol.dump();
}
}
开发者ID:jlopez,项目名称:gnash,代码行数:32,代码来源:test_sol.cpp
示例7: a
//
// Machinery for delayed images rendering (e.g. Xv with YV12 or VAAPI)
//
void
test_iterators(Renderer *renderer, const std::string &type)
{
cout << "\t"<< type << " iterator tests" << endl;
if (!renderer) {
runtest.unresolved("No renderer to test!");
return;
}
Renderer::RenderImages::iterator fit = renderer->getFirstRenderImage();
Renderer::RenderImages::iterator lit = renderer->getLastRenderImage();
// When there are no images, the first and last are the same obviously
if (fit == lit) {
runtest.pass("getFirstRenderImage()");
} else {
runtest.fail("getFirstRenderImage()");
}
#if 0
geometry::Point2d a(1, 2);
geometry::Point2d c(3, 4);
Renderer::RenderImage image;
image::GnashImage *frame = new image::ImageRGBA(10, 10);
// gnash::GnashVaapiImage *foo = static_cast<gnash::GnashVaapiImage *>(frame);
// gnash::GnashVaapiImageProxy *bar = new gnash::GnashVaapiImageProxy(foo, a.x, a.y, c.x - a.x, c.y - a.y);
std::auto_ptr<image::GnashImage> rgba(frame);
// image.reset(new gnash::GnashVaapiImageProxy(foo, a.x, a.y, c.x - a.x, c.y - a.y));
renderer->addRenderImage(image);
// image.reset(new gnash::GnashVaapiImageProxy(foo, a.x, a.y, c.x - a.x, c.y - a.y));
renderer->addRenderImage(image);
#endif
fit = renderer->getFirstRenderImage();
lit = renderer->getLastRenderImage();
// When there are no images, the first and last are the same obviously
if (fit != lit) {
runtest.pass("addRenderImage()");
} else {
runtest.fail("addRenderImage()");
}
#if 0
typedef boost::shared_ptr<GnashVaapiImageProxy> RenderImage;
typedef std::vector<RenderImage> RenderImages;
// Get first render image
virtual RenderImages::iterator getFirstRenderImage()
{ return _render_images.begin(); }
virtual RenderImages::const_iterator getFirstRenderImage() const
{ return _render_images.begin(); }
// Get last render image
virtual RenderImages::iterator getLastRenderImage()
{ return _render_images.end(); }
virtual RenderImages::const_iterator getLastRenderImage() const
{ return _render_images.end(); }
#endif
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:63,代码来源:testr.cpp
示例8:
void
test_bool(as_value boolval)
{
if (boolval.is_bool()) {
runtest.pass("as_value(bool)");
} else {
runtest.fail("as_value(bool)");
}
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:9,代码来源:AsValueTest.cpp
示例9: Element
void
test_data()
{
LcShm lcs;
// LcShm lcs=LcShm();
char *shmaddr;
const string con1 = "localhost:WeBuildTheseOOOOOOOOOOOOOOOOO";
if (lcs.connect(con1)) {
runtest.pass("LcShm::connect(localhost:lc_reply)");
} else {
runtest.fail("LcShm::connect(localhost:lc_reply)");
}
shmaddr = reinterpret_cast<char*>(lcs.begin()); // for gdb
Element *el;
vector<amf::Element *> els;
#if 0
// Apparently this constructor no longer exists.
el = new Element(true, 123.456, 987.654, "IAmReplyingNow");
// el->dump();
els.push_back(el);
delete el;
#endif
#if 0
//
el = new Element(true);
els.push_back(el);
el = new Element(12.34);
els.push_back(el);
el = new Element(12.34);
els.push_back(el);
string str = "IAmReplyingNow";
el = new Element(str);
els.push_back(el);
#endif
string str = "Volume Level 10 ";
el = new Element(str);
els.push_back(el);
// Send the AMF objects
const std::string localS="localhost";
lcs.send(con1, localS, els);
// system("ipcs");
// system("dumpshm -i");
sleep(3);
delete el;
}
开发者ID:adamh,项目名称:gnash-fork,代码行数:55,代码来源:test_lc.cpp
示例10: pass
void
test_Boolean(void)
{
AMF amf_obj;
bool bo = false;
// Write a number element
void *out = amf_obj.encodeElement(AMF::BOOLEAN, &bo, 0);
if (amf_obj.extractElementHeader(out) == AMF::BOOLEAN) {
runtest.pass("Boolean header correct");
} else {
runtest.fail("Boolean header not correct");
}
if (amf_obj.extractElementLength(out) == 1) {
runtest.pass("Boolean length returned correct");
} else {
runtest.fail("Boolean length returned not correct");
}
if (*((char *)out + 1) == 0) {
pass("Boolean false returned correct");
} else {
runtest.fail("Boolean false returned not correct");
}
bo = true;
out = amf_obj.encodeElement(AMF::BOOLEAN, &bo, 0);
if (*((char *)out + 1) == 1) {
runtest.pass("Boolean true returned correct");
} else {
runtest.fail("Boolean true returned not correct");
}
}
开发者ID:jlopez,项目名称:gnash,代码行数:31,代码来源:amftest.cpp
示例11: open
int
main(int /*argc*/, char** /*argv*/)
{
const char* input = INPUT; // Should be the path to this file
const char* cachename = "NoSeekFileTestCache";
int fd = open(input, O_RDONLY);
int raw = open(input, O_RDONLY);
dup2(fd, 0);
gnash::IOChannel* reader = gnash::noseek_fd_adapter::make_stream(0, cachename);
assert(reader);
compare_reads(reader, raw, "wrapped", "raw");
lseek(raw, 0, SEEK_SET);
reader->seek(0);
compare_reads(reader, raw, "wrapped-rewind", "raw-rewind");
FILE* f = std::fopen(cachename, "r");
std::auto_ptr<gnash::IOChannel> orig = gnash::makeFileChannel(f, false);
lseek(raw, 0, SEEK_SET);
compare_reads(orig.get(), raw, "cache", "raw");
if (sizeof(size_t) != sizeof(std::streamoff)) {
std::streampos pos = std::numeric_limits<size_t>::max();
pos += orig->size() / 2;
// Check that seek() handles integer overflow situations gracefully.
if (orig->seek(pos)) {
runtest.fail("Successfully sought to an invalid position.");
} else {
runtest.pass("Gracefully handled invalid seek.");
}
}
return 0;
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:42,代码来源:NoSeekFileTest.cpp
示例12:
// Each Renderer has an associated display device, currently EGL
// for OpenVG, OpenGLES1, and OpenGLES2. The DirectFB device is
// also available for these three renderers. The EGL device can
// also be run under X11 using the Mesa libraries. Both EGL and
// DirectFB are primarily for framebuffers. While all of the methods
// of each device class are available to the Renderer, most aren't
// exposed with more accesors beyond these for manipulating the
// device setting itself.
void
test_device(Renderer *renderer, const std::string &type)
{
cout << endl << "Testing " << type << " Device" << endl;
#if 0
boost::shared_array<renderer::GnashDevice::dtype_t> devs = renderer->probeDevices();
if (devs) {
runtest.pass("Renderer::probeDevices()");
} else {
runtest.fail("Renderer::probeDevices()");
}
// Be default, there should be no device associated with this
// renderer yet.
if (renderer->getDevice() == GnashDevice::NODEV) {
runtest.pass("Renderer::getDevice()");
} else {
runtest.fail("Renderer::getDevice()");
}
// Set to a device and see if it's axctually set
renderer->setDevice(GnashDevice::X11);
if (renderer->getDevice() == GnashDevice::X11) {
runtest.pass("Renderer::setDevice()");
} else {
runtest.fail("Renderer::setDevice()");
}
// reset to the original value so we don't screw up future tests
renderer->resetDevice();
#endif
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:40,代码来源:testr.cpp
示例13: 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);
}
开发者ID:adamh,项目名称:gnash-fork,代码行数:39,代码来源:test_lc.cpp
示例14: memset
void
test_remove()
{
Network::byte_t *data1 = new Network::byte_t[20];
memset(data1, 0, 20);
Network::byte_t *data2 = new Network::byte_t[20];
memset(data2, 0, 20);
Network::byte_t *data3 = new Network::byte_t[20];
memset(data3, 0, 20);
// populate a buffer with some data
for (size_t i=0; i< 19; i++) {
data1[i] = i + 'a';
}
// Build identical buffer nissing one character
memcpy(data2, data1, 6);
memcpy(data2 + 6, data1 + 7, 20-7);
// Remove a single byte
Network::byte_t byte = 'g';
Buffer buf1(20);
buf1.clear();
buf1.copy(data1, 20);
buf1.remove(byte);
if (memcmp(data2, buf1.reference(), 19) == 0) {
runtest.pass ("Buffer::remove(Network::byte_t)");
} else {
runtest.fail ("Buffer::remove(Network::byte_t)");
}
Buffer buf2(20);
buf2.clear();
buf2.copy(data1, 20);
buf2.remove(6);
if (memcmp(data2, buf2.reference(), 18) == 0) {
runtest.pass ("Buffer::remove(int)");
} else {
runtest.fail ("Buffer::remove(int)");
}
// Remove a range of bytes
memcpy(data3, data1, 6);
memcpy(data3 + 6, data1 + 9, 1);
Buffer buf3(20);
buf3.clear();
buf3.copy(data1, 20);
buf3.remove(6, 8);
if (memcmp(data3, buf3.reference(), 6) == 0) {
runtest.pass ("Buffer::remove(int, int)");
} else {
runtest.fail ("Buffer::remove(int, int)");
}
delete[] data1;
delete[] data2;
delete[] data3;
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:59,代码来源:test_buffer.cpp
示例15: ds
void
test_mem()
{
boost::shared_ptr<cygnal::Buffer> buf1(new cygnal::Buffer(12));
*buf1 = "Hello World";
// drop the null terminator byte we inherit when using a simnple
// string for testing
buf1->resize(buf1->size() - 1);
DiskStream ds("fooBar1", *buf1);
ds.writeToDisk();
ds.close();
struct stat st;
memset(&st, 0, sizeof(struct stat));
if (stat("fooBar1", &st) == 0) {
runtest.pass("DiskStream::writeToDisk()");
} else {
runtest.fail("DiskStream::writeToDisk()");
}
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:22,代码来源:test_diskstream.cpp
示例16:
void
test_find()
{
// Make some data for the buffers
Network::byte_t *data = new Network::byte_t[10];
for (size_t i=0; i<10; i++) {
data[i] = i + 'a';
}
Buffer buf1, buf2, buf3;
Network::byte_t *ptr1 = buf1.reference();
// populate the buffer
buf1.copy(data, 10);
delete[] data;
// See if we can find a character
Network::byte_t *fptr = std::find(buf1.begin(), buf1.end(), 'c');
if (fptr == (ptr1 + 2)) {
runtest.pass ("Buffer::find(Network::byte_t)");
} else {
runtest.fail ("Buffer::find(Network::byte_t)");
}
const char *sub = "fgh";
#if 0
Network::byte_t *ptr2 = const_cast<Network::byte_t *>(reinterpret_cast<const Network::byte_t *>(sub));
#endif
fptr = std::search(buf1.begin(), buf1.end(), sub, sub+3);
if (fptr == (ptr1 + 5)) {
runtest.pass ("Buffer::find(Network::byte_t *, size_t)");
} else {
runtest.fail ("Buffer::find(Network::byte_t *, size_t)");
}
// cygnal::Buffer::init(unsigned int)
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:37,代码来源:test_buffer.cpp
示例17: resize
void
test_resize()
{
Buffer buf;
#ifdef HAVE_MALLINFO
if (memdebug) {
mem->addStats(__LINE__); // take a sample
}
#endif
if (buf.size() == cygnal::NETBUFSIZE) {
runtest.pass ("Buffer::size(NETBUFSIZE)");
} else {
runtest.fail ("Buffer::size(NETBUFSIZE)");
}
#ifdef HAVE_MALLINFO
if (memdebug) {
mem->addStats(__LINE__); // take a sample
}
#endif
buf.resize(112);
#ifdef HAVE_MALLINFO
if (memdebug) {
mem->addStats(__LINE__); // take a sample
}
#endif
if (buf.size() == 112) {
runtest.pass ("Buffer::resize(112)");
} else {
runtest.fail ("Buffer::resize(112)");
}
#ifdef HAVE_MALLINFO
if (memdebug) {
mem->addStats(__LINE__); // take a sample
}
#endif
string str = "Hello World";
buf = str;
buf.resize(5);
if (memcmp(buf.begin(), str.c_str(), 5) == 0) {
runtest.pass ("Buffer resize(5)");
} else {
runtest.fail ("Buffer resize(5)");
}
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:46,代码来源:test_buffer.cpp
示例18: note
// Each header consists of the following:
//
// * UTF string (including length bytes) - name
// * Boolean - specifies if understanding the header is `required'
// * Long - Length in bytes of header
// * Variable - Actual data (including a type code)
void
test_Header(void){
AMF amf_obj;
amfutf8_t name, headname;
amfnum_t num;
void *element;
amfhead_t *head;
note("Test the Header");
num = 123456789;
char *test = "NumberTest";
name.length = strlen(test);
name.data = test;
element = amf_obj.encodeElement(AMF::NUMBER, &num, 0);
head = amf_obj.encodeHeader(&name, true, sizeof(amfnum_t), &num);
char *ptr = ((char *)head) + 2;
if ((strncmp(ptr, test, name.length) == 0) && (ntohs(*(short *)head) == name.length)) {
runtest.pass("Header name correct");
} else {
runtest.fail("Header name not correct");
}
ptr = ((char *)head) + 2 + name.length + 1;
if (*ptr == AMF::NUMBER) {
runtest.pass("Header Object type correct");
} else {
runtest.fail("Header Object type not correct");
}
ptr++;
if (*ptr == htonl(num)) {
runtest.pass("Header Object data correct");
} else {
runtest.fail("Header Object data not correct");
}
}
开发者ID:jlopez,项目名称:gnash,代码行数:46,代码来源:amftest.cpp
示例19: 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;
//.........这里部分代码省略.........
开发者ID:BrandRegard,项目名称:gnash,代码行数:101,代码来源:testr.cpp
示例20: list
void
test_listen()
{
LcShm lc;
char *shmaddr;
string con1 = "localhost:lc_reply";
if (lc.connect("lc_reply")) {
runtest.pass("LcShm::connect()");
} else {
runtest.fail("LcShm::connect()");
}
//
shmaddr = reinterpret_cast<char*>(lc.begin());
if (shmaddr == 0) {
runtest.unresolved("LcShm::begin()");
return;
} else {
runtest.pass("LcShm::begin()");
}
char *addr = shmaddr + LC_LISTENERS_START;
memset(addr, 0, 1024);
lc.close();
// Now reconnect to the memory segment, and see if our name
// is set.
if (lc.connect(con1)) {
runtest.pass("LcShm::connect()");
} else {
runtest.fail("LcShm::connect()");
}
if (strcmp(addr, "localhost:lc_reply") == 0) {
runtest.pass("LcShm::addListener(lc_reply)");
} else {
runtest.fail("LcShm::addListener(lc_reply)");
}
string con2 = "localhost:lc_name1";
if (lc.connect(con2)) {
runtest.pass("LcShm::connect(lc_name1)");
} else {
runtest.fail("LcShm::connect(lc_name1)");
}
if (strcmp(addr, "localhost:lc_reply") == 0) {
runtest.pass("LcShm::addListener(lc_reply)");
} else {
runtest.fail("LcShm::addListener(lc_reply)");
}
// Aftyer removing a listener, everything gets moved up
// in the table. The last element gets zero'd out, so
// we don't have duplicate entries.
lc.removeListener(con1);
if ((strcmp(addr, "localhost:lc_name1") == 0)
&& (addr[con1.size() + 1] == 0)
&& (addr[con1.size() + 2] == 0)
&& (addr[con1.size() + 3] == 0)) {
runtest.pass("LcShm::removeListener(lc_reply)");
} else {
runtest.fail("LcShm::removeListener(lc_reply)");
}
Listener list(reinterpret_cast<uint8_t *>(shmaddr));
vector<string>::const_iterator it;
auto_ptr< vector<string> > listeners ( list.listListeners() );
if (listeners->size() == 0) {
cout << "Nobody is listening" << endl;
} else {
for (it=listeners->begin(); it!=listeners->end(); it++) {
string str = *it;
if ((str[0] != ':') || (dbglogfile.getVerbosity() > 0)) {
cout << " Listeners: " << str << endl;
}
}
}
}
开发者ID:adamh,项目名称:gnash-fork,代码行数:83,代码来源:test_lc.cpp
注:本文中的TestState类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论