[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/libamf.all/Makefile.a...
From: |
Rob Savoye |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/libamf.all/Makefile.a... |
Date: |
Sat, 05 Jan 2008 17:44:45 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Rob Savoye <rsavoye> 08/01/05 17:44:45
Modified files:
. : ChangeLog
testsuite/libamf.all: Makefile.am test_el.cpp test_number.cpp
test_sol.cpp
libamf : amf.cpp element.cpp element.h
Log message:
* testsuite/libamf.all/Makefile.am: Remove the old bogus AMF
tests. Things are too different now for these to work without a
lot of effort, and their functionality is covered by the other
tests anyway.
*
testsuiote/libamf.all/test_{number,object,variable,string}.cpp:
Remove as these are now bogus.
* testsuite/libamf.all/test_sol.cpp: Use ::init() instead of the
constructor.
* testsuite/libamf.all/test_el.cpp: Dump the element too.
* libamf/element.{cpp,h}: Add a dump() method.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5320&r2=1.5321
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libamf.all/Makefile.am?cvsroot=gnash&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libamf.all/test_el.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libamf.all/test_number.cpp?cvsroot=gnash&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libamf.all/test_sol.cpp?cvsroot=gnash&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/amf.cpp?cvsroot=gnash&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/element.cpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/element.h?cvsroot=gnash&r1=1.3&r2=1.4
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5320
retrieving revision 1.5321
diff -u -b -r1.5320 -r1.5321
--- ChangeLog 5 Jan 2008 16:22:36 -0000 1.5320
+++ ChangeLog 5 Jan 2008 17:44:43 -0000 1.5321
@@ -1,3 +1,16 @@
+2008-01-05 Rob Savoye <address@hidden>
+
+ * testsuite/libamf.all/Makefile.am: Remove the old bogus AMF
+ tests. Things are too different now for these to work without a
+ lot of effort, and their functionality is covered by the other
+ tests anyway.
+ * testsuiote/libamf.all/test_{number,object,variable,string}.cpp:
+ Remove as these are now bogus.
+ * testsuite/libamf.all/test_sol.cpp: Use ::init() instead of the
+ constructor.
+ * testsuite/libamf.all/test_el.cpp: Dump the element too.
+ * libamf/element.{cpp,h}: Add a dump() method.
+
2008-01-05 Benjamin Wolsey <address@hidden>
* gui/gui.cpp: add messages for unimplemented fullscreen.
Index: testsuite/libamf.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/libamf.all/Makefile.am,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- testsuite/libamf.all/Makefile.am 31 Dec 2007 19:16:53 -0000 1.13
+++ testsuite/libamf.all/Makefile.am 5 Jan 2008 17:44:44 -0000 1.14
@@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-# $Id: Makefile.am,v 1.13 2007/12/31 19:16:53 rsavoye Exp $
+# $Id: Makefile.am,v 1.14 2008/01/05 17:44:44 rsavoye Exp $
AUTOMAKE_OPTIONS = dejagnu
@@ -50,12 +50,8 @@
check_PROGRAMS = \
test_el \
- test_sol
-# test_number
-# test_string
-# test_object
-# test_variable
-# test_lc
+ test_sol \
+ test_lc
test_el_SOURCES = test_el.cpp ../../libamf/element.cpp
test_el_LDADD = $(AM_LDFLAGS)
@@ -64,20 +60,20 @@
test_sol_LDADD = $(AM_LDFLAGS)
test_sol_DEPENDENCIES = $(solfiles)
-# test_lc_SOURCES = test_lc.cpp
-# test_lc_LDADD = $(AM_LDFLAGS)
+test_lc_SOURCES = test_lc.cpp
+test_lc_LDADD = $(AM_LDFLAGS)
-test_number_SOURCES = test_number.cpp
-test_number_LDADD = $(AM_LDFLAGS)
+# test_number_SOURCES = test_number.cpp
+# test_number_LDADD = $(AM_LDFLAGS)
-test_string_SOURCES = test_string.cpp
-test_string_LDADD = $(AM_LDFLAGS)
+# test_string_SOURCES = test_string.cpp
+# test_string_LDADD = $(AM_LDFLAGS)
-test_object_SOURCES = test_object.cpp
-test_object_LDADD = $(AM_LDFLAGS)
+# test_object_SOURCES = test_object.cpp
+# test_object_LDADD = $(AM_LDFLAGS)
-test_variable_SOURCES = test_variable.cpp
-test_variable_LDADD = $(AM_LDFLAGS)
+# test_variable_SOURCES = test_variable.cpp
+# test_variable_LDADD = $(AM_LDFLAGS)
# These are captured AMF object in binary form.
AMFS = \
Index: testsuite/libamf.all/test_el.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/libamf.all/test_el.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- testsuite/libamf.all/test_el.cpp 31 Dec 2007 00:26:49 -0000 1.1
+++ testsuite/libamf.all/test_el.cpp 5 Jan 2008 17:44:44 -0000 1.2
@@ -100,6 +100,7 @@
runtest.fail("Created double element");
}
+ el.dump();
el.clear();
string str = "Hello World!";
@@ -135,6 +136,7 @@
} else {
runtest.fail("Created Undefined element");
}
+
}
static void
Index: testsuite/libamf.all/test_number.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/libamf.all/test_number.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- testsuite/libamf.all/test_number.cpp 15 Dec 2007 06:58:41 -0000
1.10
+++ testsuite/libamf.all/test_number.cpp 5 Jan 2008 17:44:44 -0000
1.11
@@ -35,6 +35,7 @@
extern int optind, getopt(int, char *const *, const char *);
#endif
}
+
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -43,8 +44,8 @@
#include <string>
#include "dejagnu.h"
-
#include "amf.h"
+#include "element.h"
using namespace amf;
using namespace gnash;
@@ -57,7 +58,6 @@
static TestState runtest;
bool test_amf();
-bool test_sol();
int
main(int argc, char *argv[])
@@ -81,54 +81,6 @@
}
test_amf();
- test_sol();
-}
-
-// Test SOL files. These are shared Objects which are basically an AMF object
with
-// a header. These .sol files are used for transferring data, so we want to
make
-// sure they actually work. All numeric data is stored in big endian format.
-bool
-test_sol()
-{
- struct stat st;
-
- string filespec = SRCDIR;
- filespec += "/number.sol";
-
- if (stat(filespec.c_str(), &st) == 0) {
- AMF amf_obj;
- int fd, ret;
- uint8_t *buf;
- amfnum_t *num;
-
- buf = new uint8_t[st.st_size + 1];
-
- memset(buf, 0, st.st_size+1);
- fd = open(filespec.c_str(), O_RDONLY);
- ret = read(fd, buf, st.st_size);
- close(fd);
-
- num = amf_obj.extractNumber(buf);
-
- if ((((char *)num)[6] == -16) && (((char *)num)[7] == 0x3f)) {
- runtest.pass("Extracted Number SOL object");
- } else {
- runtest.fail("Extracted Number SOL object");
- }
-
- void *out = amf_obj.encodeNumber(*num);
-
- if (memcmp(out, buf, 9) == 0) {
- runtest.pass("Encoded SOL Number");
- } else {
- runtest.fail("Encoded SOL Number");
- }
- delete num;
- return true;
- }
-
- runtest.untested("testfile not found");
- return false;
}
bool
@@ -136,8 +88,10 @@
{
AMF amf_obj;
int fd, ret;
- uint8_t buf[AMF_NUMBER_SIZE+1];
- amfnum_t *num;
+ char *buf[AMF_NUMBER_SIZE+1];
+ double num;
+ Element el;
+ boost::uint8_t *ptr;
memset(buf, 0, AMF_NUMBER_SIZE+1);
string filespec = SRCDIR;
@@ -146,22 +100,22 @@
ret = read(fd, buf, AMF_NUMBER_SIZE);
close(fd);
- num = amf_obj.extractNumber(buf);
+// num = amf_obj.extractNumber(buf);
+ ptr = amf_obj.extractVariable(&el, reinterpret_cast<boost::uint8_t
*>(buf));
- if ((((char *)num)[6] == -16) && (((char *)num)[7] == 0x3f)) {
+ if (el.getType() == Element::NUMBER) {
runtest.pass("Extracted Number AMF object");
} else {
runtest.fail("Extracted Number AMF object");
}
- void *out = amf_obj.encodeNumber(*num);
+ void *out = amf_obj.encodeNumber(num);
if (memcmp(out, buf, 9) == 0) {
runtest.pass("Encoded AMF Number");
} else {
runtest.fail("Encoded AMF Number");
}
- delete num;
}
static void
Index: testsuite/libamf.all/test_sol.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/libamf.all/test_sol.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- testsuite/libamf.all/test_sol.cpp 31 Dec 2007 00:26:49 -0000 1.4
+++ testsuite/libamf.all/test_sol.cpp 5 Jan 2008 17:44:44 -0000 1.5
@@ -101,6 +101,7 @@
bool
test_read(std::string &filespec)
{
+ GNASH_REPORT_FUNCTION;
struct stat st;
if (stat(filespec.c_str(), &st) == 0) {
@@ -135,6 +136,8 @@
bool
test_write(std::string &filespec)
{
+ GNASH_REPORT_FUNCTION;
+
SOL sol;
AMF amf_obj;
@@ -144,8 +147,10 @@
double dub = 50.0;
- amf::Element *el = new amf::Element("gain", dub);
-// el->init("gain", dub);
+
+// amf::Element *el = new amf::Element("gain", dub);
+ amf::Element *el = new amf::Element;
+ el->init("gain", dub);
// amf_obj.createElement(&el, "gain", dub);
sol.addObj(el);
if ((el->getName() == "gain") &&
@@ -209,6 +214,7 @@
data = "";
el = new amf::Element("defaultcamera", data);
+ el->init("defaultcamera", data);
sol.addObj(el);
if ((el->getName() == "defaultcamera") &&
(el->getType() == Element::STRING) &&
@@ -220,7 +226,9 @@
}
dub = 100.0;
- el = new amf::Element("defaultklimit", dub);
+ el = new amf::Element;
+// el = new amf::Element("defaultklimit", dub);
+ el->init("defaultklimit", dub);
sol.addObj(el);
if ((el->getName() == "defaultklimit") &&
(el->getType() == Element::NUMBER) &&
@@ -311,7 +319,9 @@
dub = 1.8379389592608646e-304;
swapBytes(&dub, 8);
- el = new amf::Element("localSecPathTime", dub);
+ el = new amf::Element;
+ el->init("localSecPathTime", dub);
+// el = new amf::Element("localSecPathTime", dub);
sol.addObj(el);
if ((el->getName() == "localSecPathTime") &&
(el->getType() == Element::NUMBER) &&
Index: libamf/amf.cpp
===================================================================
RCS file: /sources/gnash/gnash/libamf/amf.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- libamf/amf.cpp 31 Dec 2007 05:53:34 -0000 1.54
+++ libamf/amf.cpp 5 Jan 2008 17:44:44 -0000 1.55
@@ -1075,9 +1075,9 @@
uint8_t *
AMF::encodeVariable(amf::Element *el)
{
-// GNASH_REPORT_FUNCTION;
+ GNASH_REPORT_FUNCTION;
int outsize = el->getName().size() + el->getLength() + 5;
- boost::uint8_t *out = new boost::uint8_t[outsize + 2];
+ boost::uint8_t *out = new boost::uint8_t[outsize + 4];
memset(out, 0, outsize + 2);
boost::uint8_t *tmpptr = out;
Index: libamf/element.cpp
===================================================================
RCS file: /sources/gnash/gnash/libamf/element.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- libamf/element.cpp 1 Jan 2008 10:45:58 -0000 1.3
+++ libamf/element.cpp 5 Jan 2008 17:44:44 -0000 1.4
@@ -414,6 +414,21 @@
return *this;
}
+void
+Element::dump()
+{
+ log_debug("AMF Type is: ", astype_str[_type]);
+ log_debug("AMF Length is: ", _length);
+ if (_name.size()) {
+ log_debug("AMF Name is: ", _name.c_str());
+ }
+#if 0
+ boost::uint8_t *hexint;
+ hexint = new boost::uint8_t[(_length + 3) * 3];
+ hexify((boost::uint8_t *)hexint, _data, _length, false);
+ log_debug("AMF data is: 0x%s", hexint);
+#endif
+}
} // end of amf namespace
Index: libamf/element.h
===================================================================
RCS file: /sources/gnash/gnash/libamf/element.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- libamf/element.h 1 Jan 2008 10:45:58 -0000 1.3
+++ libamf/element.h 5 Jan 2008 17:44:45 -0000 1.4
@@ -116,6 +116,8 @@
void setName(const std::string &name) { _name = name; };
void setName(boost::uint8_t *name) { _name = reinterpret_cast<const char
*>(name); };
// boost::posix_time::ptime to_date();
+ void dump();
+
private:
astype_e _type;
boost::int16_t _length;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog testsuite/libamf.all/Makefile.a...,
Rob Savoye <=