gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r9673: merge support from branch for


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r9673: merge support from branch for maming amf elements from as_values.
Date: Wed, 03 Sep 2008 18:57:44 -0600
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9673
committer: address@hidden
branch nick: trunk
timestamp: Wed 2008-09-03 18:57:44 -0600
message:
  merge support from branch for maming amf elements from as_values.
modified:
  libcore/as_value.cpp
  testsuite/libcore.all/AsValueTest.cpp
    ------------------------------------------------------------
    revno: 9483.1.146
    committer: address@hidden
    branch nick: rtmp
    timestamp: Wed 2008-09-03 18:35:31 -0600
    message:
      add support for converting as_values to Elements
    modified:
      libcore/as_value.cpp
      testsuite/libcore.all/AsValueTest.cpp
=== modified file 'libcore/as_value.cpp'
--- a/libcore/as_value.cpp      2008-09-03 23:46:02 +0000
+++ b/libcore/as_value.cpp      2008-09-04 00:35:31 +0000
@@ -700,8 +700,10 @@
          break;
       }
       case AS_FUNCTION:
+         log_unimpl("Converting an AS function to an element is not 
supported");
          break;
       case MOVIECLIP:
+         log_unimpl("Converting a Movie Clip to an element is not supported");
          break;
       default:
          break;

=== modified file 'testsuite/libcore.all/AsValueTest.cpp'
--- a/testsuite/libcore.all/AsValueTest.cpp     2008-09-03 23:46:02 +0000
+++ b/testsuite/libcore.all/AsValueTest.cpp     2008-09-04 00:35:31 +0000
@@ -234,6 +234,23 @@
             }
         }
     }
+
+    Element *el1 = as1.to_element();
+    Element *fooel = el1->getProperty(0);
+    Element *barel = el1->getProperty(1);
+    if ((el1->getType() == Element::OBJECT_AMF0)
+        && (fooel->getType() == Element::STRING_AMF0)
+        && (strcmp(fooel->getName(), "foo") == 0)
+        && (strcmp(fooel->to_string(), "bar") == 0)
+        && (barel->getType() == Element::NUMBER_AMF0)
+        && (strcmp(barel->getName(), "bar") == 0)
+        && (barel->to_number() == 1.234)
+        ) {
+        runtest.pass("as_value::to_element()");
+    } else {
+        runtest.fail("as_value::to_element()");
+    }
+    
 }
 
 void


reply via email to

[Prev in Thread] Current Thread [Next in Thread]