~ubuntu-branches/ubuntu/maverick/gnash/maverick

« back to all changes in this revision

Viewing changes to testsuite/libamf.all/test_lc.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2008-10-13 14:29:49 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20081013142949-f6qdvnu4mn05ltdc
Tags: 0.8.4~~bzr9980-0ubuntu1
* new upstream release 0.8.4 (LP: #240325)
* ship new lib usr/lib/gnash/libmozsdk.so.* in mozilla-plugin-gnash
  - update debian/mozilla-plugin-gnash.install
* ship new lib usr/lib/gnash/libgnashnet.so.* in gnash-common
  - update debian/gnash-common.install
* add basic debian/build_head script to build latest CVS head packages.
  - add debian/build_head
* new sound architecture requires build depend on libsdl1.2-dev
  - update debian/control
* head build script now has been completely migrated to bzr (upstream +
  ubuntu)
  - update debian/build_head
* disable kde gui until klash/qt4 has been fixed; keep kde packages as empty
  packages for now.
  - update debian/rules
  - debian/klash.install
  - debian/klash.links
  - debian/klash.manpages
  - debian/konqueror-plugin-gnash.install
* drop libkonq5-dev build dependency accordingly
  - update debian/control
* don't install headers manually anymore. gnash doesnt provide a -dev
  package after all
  - update debian/rules
* update libs installed in gnash-common; libgnashserver-*.so is not available
  anymore (removed); in turn we add the new libgnashcore-*.so
  - update debian/gnash-common.install
* use -Os for optimization and properly pass CXXFLAGS=$(CFLAGS) to configure
  - update debian/rules
* touch firefox .autoreg in postinst of mozilla plugin
  - update debian/mozilla-plugin-gnash.postinst
* link gnash in ubufox plugins directory for the plugin alternative switcher
  - add debian/mozilla-plugin-gnash.links
* suggest ubufox accordingly
  - update debian/control
* add new required build-depends on libgif-dev
  - update debian/control
* add Xb-Npp-Description and Xb-Npp-File as new plugin database meta data
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
//#include <netinet/in.h>
25
25
#include <string>
 
26
#include <cerrno>
26
27
#include <sys/types.h>
27
28
#include <sys/stat.h>
28
29
 
129
130
    
130
131
    //
131
132
    shmaddr = lc.getAddr();
 
133
    if (shmaddr == 0) {
 
134
        runtest.unresolved("LcShm::getAddr()");
 
135
        return;
 
136
    } else {
 
137
        runtest.pass("LcShm::getAddr()");
 
138
    }
 
139
    
132
140
    char *addr = shmaddr + LC_LISTENERS_START;
133
141
    memset(addr, 0, 1024);
134
142
    
209
217
    vector<amf::Element *> els;
210
218
 
211
219
    el = new Element(true, 123.456, 987.654, "IAmReplyingNow");
212
 
    el->dump();
 
220
//    el->dump();
213
221
    els.push_back(el);
 
222
    delete el;    
214
223
 
215
224
#if 0
216
225
    // 
233
242
    els.push_back(el);
234
243
 
235
244
    // Send the AMF objects
236
 
    lc.send(con1, "localhost", els);
 
245
//    lc.send(con1, "localhost", els);
 
246
 
 
247
    delete el;
237
248
}
238
249
 
239
250
void
244
255
    char *shmaddr;
245
256
 
246
257
    string con1 = "lc_reply";
247
 
    if (lc.connect(con1)) {
248
 
        runtest.pass("LcShm::connect()");
249
 
    } else {
250
 
        runtest.fail("LcShm::connect()");
 
258
    if (!lc.connect(con1)) {
 
259
        if (errno == EACCES) {
 
260
            runtest.untested("Couldn't map input file, permission problems!!");
 
261
        } else {
 
262
            runtest.unresolved("LcShm::connect()");
 
263
        }
 
264
        exit(0);
251
265
    }
252
266
 
253
267
    shmaddr = lc.getAddr();
261
275
    if (dataptr != (void*)-1) {
262
276
        memcpy(shmaddr, dataptr, 64528);
263
277
    } else {
264
 
        cerr << "ERROR: couldn't map input file!" << endl;
 
278
        if (errno == EACCES) {
 
279
            runtest.unresolved("Couldn't map input file, permission problems!!");
 
280
        } else {
 
281
            runtest.unresolved("Couldn't map input file!");
 
282
            log_debug("Error was: %s", strerror(errno));
 
283
        }
 
284
        exit(0);
265
285
    }
266
286
 
267
287
    ::close(fd);
333
353
        }
334
354
    }
335
355
 
336
 
    boost::uint8_t *ptr = lc.parseHeader(reinterpret_cast<boost::uint8_t *>(shmaddr));
337
 
    vector<amf::Element *> ellist = lc.parseBody(ptr);
 
356
//    boost::uint8_t *ptr = lc.parseHeader(reinterpret_cast<boost::uint8_t *>(shmaddr));
 
357
//    vector<amf::Element *> ellist = lc.parseBody(ptr);
338
358
//    cout << "# of AMF Elements in file: " << ellist.size() << endl;
339
359
//    lc.dump();
340
360
    lc.close();
 
361
 
 
362
    // cleanup
 
363
//    delete ptr;
341
364
}
342
365
 
343
366
void
356
379
    sol.addObj(el);
357
380
    if ((el.name == "gain") &&
358
381
        (el.type == AMF::NUMBER) &&
359
 
        (memcmp(el.data, &dub, AMF_NUMBER_SIZE) == 0) &&
 
382
        (memcmp(el.data, &dub, AMF0_NUMBER_SIZE) == 0) &&
360
383
        (*((double *)el.data) == dub) &&
361
 
        (el.length == AMF_NUMBER_SIZE)) {
 
384
        (el.length == AMF0_NUMBER_SIZE)) {
362
385
        runtest.pass("gain set");
363
386
    } else {
364
387
        runtest.fail("gain set");
428
451
    sol.addObj(el);
429
452
    if ((el.name == "defaultklimit") &&
430
453
        (el.type == AMF::NUMBER) &&
431
 
        (memcmp(el.data, &dub, AMF_NUMBER_SIZE) == 0) &&
 
454
        (memcmp(el.data, &dub, AMF0_NUMBER_SIZE) == 0) &&
432
455
        (*((double *)el.data) == dub) &&
433
 
        (el.length == AMF_NUMBER_SIZE)) {
 
456
        (el.length == AMF0_NUMBER_SIZE)) {
434
457
        runtest.pass("defaultklimit set");
435
458
    } else {
436
459
        runtest.fail("defaultklimit set");
517
540
    sol.addObj(el);
518
541
    if ((el.name == "localSecPathTime") &&
519
542
        (el.type == AMF::NUMBER) &&
520
 
        (memcmp(el.data, &dub, AMF_NUMBER_SIZE) == 0) &&
 
543
        (memcmp(el.data, &dub, AMF0_NUMBER_SIZE) == 0) &&
521
544
        (*((double *)el.data) == dub) &&
522
 
        (el.length == AMF_NUMBER_SIZE)) {
 
545
        (el.length == AMF0_NUMBER_SIZE)) {
523
546
        runtest.pass("localSecPathTime set");
524
547
    } else {
525
548
        runtest.fail("localSecPathTime set");
526
549
    }
527
550
 
528
 
    sol.dump();
 
551
//    sol.dump();
529
552
    // now write the data to disk
530
553
    sol.writeFile(filespec, "settings");
531
554
#endif
586
609
    
587
610
#endif // }
588
611
 
 
612
// FIXME: more tests! Here's all the methods:
 
613
//
 
614
// gnash::LcShm::parseHeader(unsigned char*)
 
615
// gnash::LcShm::formatHeader(std::string const&, std::string const&, bool)
 
616
// gnash::LcShm::dump()
 
617
// gnash::LcShm::send(std::string const&, std::string const&, std::vector<amf::Element*, std::allocator<amf::Element*> >&)
 
618
// gnash::LcShm::close()
 
619
// gnash::LcShm::connect(std::string const&)
 
620
// gnash::LcShm::connect(int)
 
621
// gnash::LcShm::parseBody(unsigned char*)
 
622
// gnash::LcShm::LcShm(unsigned char*)
 
623
// gnash::LcShm::LcShm(int)
 
624
// gnash::LcShm::LcShm()
 
625
// gnash::LcShm::LcShm(unsigned char*)
 
626
// gnash::LcShm::LcShm(int)
 
627
// gnash::LcShm::LcShm()
 
628
// gnash::LcShm::~LcShm()
 
629
// gnash::LcShm::~LcShm()
 
630
// gnash::Listener::addListener(std::string const&)
 
631
// gnash::Listener::findListener(std::string const&)
 
632
// gnash::Listener::listListeners()
 
633
// gnash::Listener::removeListener(std::string const&)
 
634
// gnash::Listener::Listener(unsigned char*)
 
635
// gnash::Listener::Listener()
 
636
// gnash::Listener::Listener(unsigned char*)
 
637
// gnash::Listener::Listener()
 
638
// gnash::Listener::~Listener()
 
639
// gnash::Listener::~Listener()