gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r9597: Use older version of the test


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r9597: Use older version of the test case that actually compiles.
Date: Fri, 15 Aug 2008 11:03:45 -0600
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9597
committer: address@hidden
branch nick: trunk
timestamp: Fri 2008-08-15 11:03:45 -0600
message:
  Use older version of the test case that actually compiles.
modified:
  testsuite/libnet.all/test_rtmp.cpp
=== modified file 'testsuite/libnet.all/test_rtmp.cpp'
--- a/testsuite/libnet.all/test_rtmp.cpp        2008-08-02 22:57:37 +0000
+++ b/testsuite/libnet.all/test_rtmp.cpp        2008-08-15 17:03:45 +0000
@@ -31,7 +31,6 @@
 #include <fcntl.h>
 #include <iostream>
 #include <string>
-#include <deque>
 
 #include "as_object.h"
 #include "dejagnu.h"
@@ -70,7 +69,6 @@
 static void test_results();
 static void test_system();
 static void test_client();
-static void test_split();
 
 LogFile& dbglogfile = LogFile::getDefaultInstance();
 
@@ -178,256 +176,10 @@
     test_system();
     test_client();
     test_results();
-    test_split();
 //    test_types();
 }
 
 void
-test_split()
-{
-    GNASH_REPORT_FUNCTION;
-    
-    RTMPClient client;
-    bool notest = false;
-    RTMP::rtmp_head_t *rthead = 0;
-    CQue *que;
-
-    // Test a buffer that contains two packets for the same channel and
-    // the same message body. This should result in a single RTMP
-    // message.
-    Buffer *buf1 = hex2mem("04 00 00 00 00 00 b8 14 01 00 00 00 02 00 08 6f 6e 
53 74 61 74 75 73 00 00 00 00 00 00 00 00 00 05 03 00 05 6c 65 76 65 6c 02 00 
06 73 74 61 74 75 73 00 04 63 6f 64 65 02 00 14 4e 65 74 53 74 72 65 61 6d 2e 
50 6c 61 79 2e 52 65 73 65 74 00 0b 64 65 73 63 72 69 70 74 69 6f 6e 02 00 2d 
50 6c 61 79 69 6e 67 20 61 6e 64 20 72 65 73 65 74 74 69 6e 67 20 67 61 74 65 
30 36 5f 74 61 62 6c 61 6e 5f 62 63 75 65 75 5f 30 31 2e c4 00 07 64 65 74 61 
69 6c 73 02 00 16 67 61 74 65 30 36 5f 74 61 62 6c 61 6e 5f 62 63 75 65 75 5f 
30 31 00 08 63 6c 69 65 6e 74 69 64 00 41 bf e4 78 30 00 00 00 00 00 09");
-    RTMP::queues_t *queues1 = client.split(buf1, 128);
-    if (queues1 == 0) {
-        notest = true;
-    } else {
-        if (queues1->size() == 0) {
-            notest = true;
-        }
-    }
-    
-    if (notest) {
-        runtest.untested("RTMP::split(2 packets size)");
-    } else {
-        if (queues1->size() == 1) {
-            runtest.pass("RTMP::split(2 packets size)");
-        } else {
-            runtest.fail("RTMP::split(2 packets size)");
-            notest = true;
-        }
-    }
-
-    Buffer *tmpbuf = 0;
-    if (notest) {
-        runtest.untested("RTMP::split(1st packet header) of 2");
-    } else {
-        que = queues1->front();
-        tmpbuf = que->pop();
-//        tmpbuf->dump();
-        queues1->pop_front();
-        if (*tmpbuf->reference() == 0x4) {
-            runtest.pass("RTMP::split(1st packet header) of 2");
-        } else {
-            runtest.fail("RTMP::split(1st packet header) of 2" );
-            notest = true;
-        }
-    }
-
-    if (notest) {
-        runtest.untested("RTMP::split(1st packet header) of 2");        
-    } else {
-        if ((queues1->size() == 0) && (client[4].size() == 0)) {
-            runtest.pass("RTMP::split() 1st queue empty");
-        } else {
-            runtest.fail("RTMP::split() 1st queue empty" );
-        }
-    }
-
-    // Test a bigger buffer with more messages in it.
-    // This one is a ChunkSize->Ping->Invoke->Ping.
-    Buffer *buf2 = hex2mem("02 00 00 00 00 00 04 01 00 00 00 00 00 00 00 80 02 
00 00 00 00 00 06 04 00 00 00 00 00 04 00 00 00 01 04 00 00 00 00 00 b8 14 01 
00 00 00 02 00 08 6f 6e 53 74 61 74 75 73 00 00 00 00 00 00 00 00 00 05 03 00 
05 6c 65 76 65 6c 02 00 06 73 74 61 74 75 73 00 04 63 6f 64 65 02 00 14 4e 65 
74 53 74 72 65 61 6d 2e 50 6c 61 79 2e 52 65 73 65 74 00 0b 64 65 73 63 72 69 
70 74 69 6f 6e 02 00 2d 50 6c 61 79 69 6e 67 20 61 6e 64 20 72 65 73 65 74 74 
69 6e 67 20 67 61 74 65 30 36 5f 74 61 62 6c 61 6e 5f 62 63 75 65 75 5f 30 31 
2e 02 00 00 00 00 00 06 04 00 00 00 00 00 00 00 00 00 01 c4 00 07 64 65 74 61 
69 6c 73 02 00 16 67 61 74 65 30 36 5f 74 61 62 6c 61 6e 5f 62 63 75 65 75 5f 
30 31 00 08 63 6c 69 65 6e 74 69 64 00 41 d8 fb 78 56 00 00 00 00 00 09");
-    RTMP::queues_t *queues2 = client.split(buf2, 128);
-    if (queues2 == 0) {
-        notest = true;
-    } else {
-        if (queues2->size() == 0) {
-            notest = true;
-        }
-    }
-    
-    if (notest) {
-        runtest.fail("RTMP::split(5 packets into 4)");
-    } else {
-        if (queues2->size() == 4) {
-            runtest.pass("RTMP::split(5 packets into 4)");
-            notest = false;
-        } else {
-            runtest.fail("RTMP::split(5 packets into 4)");
-        }
-    }
-    
-    if (notest) {
-        runtest.untested("RTMP::split(1st packet header of 4)");
-    } else {
-        que = queues2->front();
-        tmpbuf = que->pop();
-//        tmpbuf->dump();
-        queues2->pop_front();
-        rthead = client.decodeHeader(tmpbuf);
-        if ((*tmpbuf->reference() == 0x2) && (rthead->type <= 
RTMP::CHUNK_SIZE)) {
-            runtest.pass("RTMP::split(1st packet header) of 4");
-        } else {
-            runtest.fail("RTMP::split(1st packet header) of 4");
-        }
-    }
-    
-    if (notest) {
-        runtest.untested("RTMP::split(2nd packet header) of 4");
-    } else {
-        que = queues2->front();
-        tmpbuf = que->pop();
-//        tmpbuf->dump();
-        queues2->pop_front();
-        rthead = client.decodeHeader(tmpbuf);
-        if ((*tmpbuf->reference() == 0x2) && (rthead->type <= RTMP::PING)) {
-            runtest.pass("RTMP::split(2nd packet header) of 4");
-        } else {
-            runtest.fail("RTMP::split(2nd packet header) of 4");
-        }
-    }
-
-    if (notest) {
-        runtest.untested("RTMP::split(3rd packet header) of 4");
-    } else {
-        que = queues2->front();
-        tmpbuf = que->pop();
-        queues2->pop_front();
-        rthead = client.decodeHeader(tmpbuf);
-        if ((*tmpbuf->reference() == 04) && (rthead->type <= RTMP::INVOKE)) {
-            runtest.pass("RTMP::split(3rd packet header) of 4");
-        } else {
-            runtest.fail("RTMP::split(3rd packet header) of 4");
-//            tmpbuf->dump();
-        }
-    }
-    
-    if (notest) {
-        runtest.untested("RTMP::split(4th packet header) of 4");
-    } else {
-        que = queues2->front();
-        tmpbuf = que->pop();
-        queues2->pop_front();
-        rthead = client.decodeHeader(tmpbuf);
-        if ((*tmpbuf->reference() == 0x2) && (rthead->type <= RTMP::PING)) {
-            runtest.pass("RTMP::split(4th packet header) of 4");
-        } else {
-            runtest.fail("RTMP::split(4th packet header) of 4");
-//            tmpbuf->dump();
-        }
-    }
-
-    if (notest) {
-        runtest.untested("RTMP::split() 2nd queue empty" );
-    } else {
-        if ((queues2->size() == 0) && (client[2].size() == 0)
-            && (client[4].size() == 0)) {
-            runtest.pass("RTMP::split() 2nd queue empty");
-        } else {
-            runtest.fail("RTMP::split() 2nd queue empty" );
-        }
-    }
-
-// Try a much more complex packet, similar to the previous one, but with more
-// intermixed packets for other channels. This also has a packet with a zero 
body
-// size, which needs to be handled correctly.
-//    
...............onStatus.............level...status..code...NetStream.Play.Start..description..'Started
 playing 
gate06_tablan_bcueu_01...clie......'address@hidden;...../..rP.....K.......m......,......%......................B........M.<.$.....`.......i..9..C..J..........%..........G....2Np."address@hidden;.ntid.A..xV.....
-    Buffer *buf3 = hex2mem("05 00 00 00 00 00 90 14 01 00 00 00 02 00 08 6f 6e 
53 74 61 74 75 73 00 00 00 00 00 00 00 00 00 05 03 00 05 6c 65 76 65 6c 02 00 
06 73 74 61 74 75 73 00 04 63 6f 64 65 02 00 14 4e 65 74 53 74 72 65 61 6d 2e 
50 6c 61 79 2e 53 74 61 72 74 00 0b 64 65 73 63 72 69 70 74 69 6f 6e 02 00 27 
53 74 61 72 74 65 64 20 70 6c 61 79 69 6e 67 20 67 61 74 65 30 36 5f 74 61 62 
6c 61 6e 5f 62 63 75 65 75 5f 30 31 2e 00 08 63 6c 69 65 07 00 00 00 00 00 27 
09 01 00 00 00 14 00 78 46 0f 14 0f 14 3f 6a ff ff 00 08 9f 40 10 9f f8 8b 3f 
fd b2 4f fb 5d c0 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 08 
01 00 00 00 08 00 00 00 00 01 3b 08 01 00 00 00 2f ff fb 72 50 00 00 00 00 00 
4b 00 00 00 00 07 e0 09 6d 00 00 00 00 00 01 2c 00 00 00 00 1f 80 25 b4 00 00 
00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff fc 0c 87 42 80 ec c8 b0 0e 90 
c2 12 4d 90 3c 18 24 16 01 88 03 e1 60 1a 1a a0 1a 09 9c 1a 69 a1 10 39 06 8d 
43 02 c3 4a 12 0b 00 c8 1f 0b 00 d8 16 00 25 9f ff ff fe c1 a0 00 00 ff 8a 47 
80 80 0e 1e 32 4e 70 f1 22 ed 31 60 40 f8 02 00 00 00 00 00 04 01 00 00 00 00 
00 00 01 3b c5 6e 74 69 64 00 41 d8 fb 78 56 00 00 00 00 00 09");
-    RTMP::queues_t *queues3 = client.split(buf3, 128);
-    if (queues3 == 0) {
-        notest = true;
-    } else {
-        if (queues3->size() == 0) {
-            notest = true;
-        }
-    }
-    
-    if (notest) {
-        runtest.untested("RTMP::split(6 complex packets into )");
-    } else {
-        if (queues3->size() == 4) {
-            runtest.pass("RTMP::split(6 complex packets into 4)");
-            notest = false;
-        } else {
-            runtest.fail("RTMP::split(6 complex packets into 4)");
-        }
-    }
-
-    if (notest) {
-        runtest.untested("RTMP::split(1st packet header) of 6");
-    } else {
-        que = queues3->front();
-        tmpbuf = que->pop();
-        queues3->pop_front();
-        rthead = client.decodeHeader(tmpbuf);
-        if ((*tmpbuf->reference() == 0x05)  && (rthead->type <= RTMP::INVOKE)) 
{
-            runtest.pass("RTMP::split(1st packet header) of 6");
-        } else {
-            runtest.fail("RTMP::split(1st packet header) of 6");
-//            tmpbuf->dump();
-        }
-    }
-    
-    if (notest) {
-        runtest.untested("RTMP::split(2nd packet header) of 6");
-    } else {
-        que = queues3->front();
-        tmpbuf = que->pop();
-        queues3->pop_front();
-        rthead = client.decodeHeader(tmpbuf);
-        if ((*tmpbuf->reference() == 0x07)  && (rthead->type <= 
RTMP::VIDEO_DATA)) {
-            runtest.pass("RTMP::split(2nd packet header) of 6");
-        } else {
-            runtest.fail("RTMP::split(2nd packet header) of 6");
-//            tmpbuf->dump();
-        }
-    }
-
-    if (notest) {
-        runtest.untested("RTMP::split(3rd packet header) of 6");
-    } else {
-        que = queues3->front();
-        tmpbuf = que->pop();
-        queues3->pop_front();
-        rthead = client.decodeHeader(tmpbuf);
-        if ((*tmpbuf->reference() == 0x08)  && (rthead->type <= 
RTMP::AUDIO_DATA)) {
-            runtest.pass("RTMP::split(3rd packet header) of 6");
-        } else {
-            runtest.fail("RTMP::split(3rd packet header) of 6");
-//            tmpbuf->dump();
-        }
-    }
-    
-    if (notest) {
-        runtest.untested("RTMP::split(4th packet header) of 6");
-    } else {
-        que = queues3->front();
-        tmpbuf = que->pop();
-        queues3->pop_front();
-        rthead = client.decodeHeader(tmpbuf);
-        if ((*tmpbuf->reference() == 0x02)  && (rthead->type <= 
RTMP::CHUNK_SIZE)) {
-            runtest.pass("RTMP::split(4th packet header) of 6");
-        } else {
-            runtest.fail("RTMP::split(4th packet header) of 6");
-//            tmpbuf->dump();
-        }
-    }
-    
-//    delete que1;
-
-//     delete buf2;
-//     delete que2;
-}
-
-void
 test_system()
 {
     GNASH_REPORT_FUNCTION;
@@ -472,16 +224,6 @@
         runtest.fail("Decoded RTMP Ping Client message");
     }    
 
-    // SERVER message
-//     Buffer *hex1 = hex2mem("02 00 00 00 00 00 04 05 00 00 00 00 00 13 12 
d0");
-//     Buffer *hex1 = hex2mem("00 13 12 d0");
-//     RTMPMsg *msg1 = client.decodeMsgBody(hex1);
-    
-    // Client message
-//     Buffer *hex2 = hex2mem("02 00 00 00 00 00 05 06 00 00 00 00 00 13 12 d0 
02");
-//     Buffer *hex2 = hex2mem("00 13 12 d0 02");
-//     RTMPMsg *msg2 = client.decodeMsgBody(hex2);
-
 #if 0
     for (double dub=0; dub<=200; dub ++) {
         Element el11;
@@ -569,28 +311,6 @@
      } else {
          runtest.fail("Encoded RTMP header(size 1)");
      }
-
-// 43 00 00 00 00 00 15 14 02 00 08 6f 6e 42 57 44    onBWDone
-// 6f 6e 65 00 40 00 00 00 00 00 00 00 05
-
-     Buffer *buf5 = hex2mem("43 00 00 00 00 00 19 14");
-     Buffer *head5 = server.encodeHeader(0x3, RTMP::HEADER_8, 0x19, 
RTMP::INVOKE,
-                                         RTMPMsg::FROM_CLIENT);
-//     head5->dump();
-//     cerr << hexify(head5->begin(), 8, false) << endl;
-     if ((memcmp(buf5->reference(), head5->reference(), 8) == 0)) {
-         runtest.pass("Encoded RTMP header(size 8)");
-     } else {
-         runtest.fail("Encoded RTMP header(size 8)");
-     }
-     RTMP::rtmp_head_t *header3 = client.decodeHeader(buf5);
-     if ((header3->channel == 0x3) && (header3->head_size == 8)
-         && (header3->bodysize == 0x19) && (header3->type ==  RTMP::INVOKE)) {
-         runtest.pass("Decoded RTMP header(size 8)");
-     } else {
-         runtest.fail("Decoded RTMP header(size 8)");
-     }
-
      
      // cleanup after ourselves
      delete buf1;
@@ -625,9 +345,9 @@
     if (msg1) {
         std::vector<amf::Element *> hell = msg1->getElements();
         std::vector<amf::Element *> props = hell[0]->getProperties();        
-         printf("FIXME: %d, %d, %s:%s\n", props.size(), msg1->getStatus(),
-                props[3]->getName(), props[3]->to_string());
-//        msg1->dump();
+//         printf("FIXME: %d, %d, %s:%s\n", props.size(), msg1->getStatus(),
+//                props[3]->getName(), props[3]->to_string());
+//         msg1->dump();
         if ((msg1->getStatus() ==  RTMPMsg::NC_CONNECT_SUCCESS)
             && (msg1->getMethodName() == "_result")
             && (msg1->getStreamID() == 1)
@@ -641,7 +361,7 @@
     }
     delete msg1;
 
-    Buffer *buf2 = rtmpserv.encodeResult(1.0, RTMPMsg::NC_CONNECT_SUCCESS);
+    Buffer *buf2 = rtmpserv.encodeResult(RTMPMsg::NC_CONNECT_SUCCESS);
 //    cerr << hexify(buf2->begin(), 122, true) << endl;
     if ((memcmp(hex2->reference(), buf2->reference(), 122) == 0)) {
         runtest.pass("Encoded RTMP result(NC_CONNECT_SUCCESS)");
@@ -683,135 +403,49 @@
 //     }
 //     delete buf4;
 
-// onStatus
-// level
-//     status
-//     code
-//         NetStream.Play.Reset
-//     description
-//         Playing and resetting address@hidden
-//     details
-//         address@hidden
-//     clientid
-//         dsLgYohb
-//    Buffer *hex4 = hex2mem("02 00 08 6f 6e 53 74 61 74 75 73 00 00 00 00 00 
00 00 00 00 05 03 00 05 6c 65 76 65 6c 02 00 06 73 74 61 74 75 73 00 04 63 6f 
64 65 02 00 14 4e 65 74 53 74 72 65 61 6d 2e 50 6c 61 79 2e 52 65 73 65 74 00 
0b 64 65 73 63 72 69 70 74 69 6f 6e 02 00 2a 50 6c 61 79 69 6e 67 20 61 6e 64 
20 72 65 73 65 74 74 69 6e 67 20 50 44 5f 45 6e 67 6c 69 73 68 5f 4c 6f 77 40 
32 30 30 31 2e 00 07 64 65 74 61 69 6c 73 02 00 13 50 44 5f 45 6e 67 6c 69 73 
68 5f 4c 6f 77 40 32 30 30 31 00 08 63 6c 69 65 6e 74 69 64 02 00 08 64 73 4c 
67 59 6f 68 62 00 00 09");
-// Rearrange the order of code and description
-    Buffer *hex4 = hex2mem("02 00 08 6f 6e 53 74 61 74 75 73 00 00 00 00 00 00 
00 00 00 05 03 00 05 6c 65 76 65 6c 02 00 06 73 74 61 74 75 73 00 0b 64 65 73 
63 72 69 70 74 69 6f 6e 02 00 2a 50 6c 61 79 69 6e 67 20 61 6e 64 20 72 65 73 
65 74 74 69 6e 67 20 50 44 5f 45 6e 67 6c 69 73 68 5f 4c 6f 77 40 32 30 30 31 
2e 00 04 63 6f 64 65 02 00 14 4e 65 74 53 74 72 65 61 6d 2e 50 6c 61 79 2e 52 
65 73 65 74 00 07 64 65 74 61 69 6c 73 02 00 13 50 44 5f 45 6e 67 6c 69 73 68 
5f 4c 6f 77 40 32 30 30 31 00 08 63 6c 69 65 6e 74 69 64 02 00 08 64 73 4c 67 
59 6f 68 62 00 00 09");
-    RTMPMsg *msg4 = rtmpserv.decodeMsgBody(hex4);
-
-    Element *cid = new Element;
-    cid->makeString("dsLgYohb");
-    
-    Buffer *enc4 = rtmpserv.encodeResult(0.0, RTMPMsg::NS_PLAY_RESET,
-                          "address@hidden", cid);
-//    msg4->dump();
-//    std::vector<amf::Element *> hell4 = msg4->getElements();
-    if ((msg4->getStatus() ==  RTMPMsg::NS_PLAY_RESET)
-        && (msg4->getMethodName() == "onStatus")
-        && (msg4->getStreamID() == 0)
-        && (msg4->size() == 1)) {
-        runtest.pass("Decoded RTMP onStatus(Play Reset)");
-    } else {
-        runtest.fail("Decoded RTMP onStatus(Play Reset)");
-    }
-    if ((memcmp(hex4->reference(), enc4->reference(), enc4->size()) == 0)) {
-        runtest.pass("Encoded RTMPClient::encodeResult(Play Reset)");
-    } else {
-        runtest.fail("Encoded RTMPClient::encodeResult(Play Reset)");
-    }
-
-    delete hex4;
-    delete msg4;
-    delete enc4;
-    
-// onStatus
-// code
-//     NetStream
-// Data.Start
-        Buffer *hex5 = hex2mem("02 00 08 6f 6e 53 74 61 74 75 73 03 00 04 63 
6f 64 65 02 00 14 4e 65 74 53 74 72 65 61 6d 2e 44 61 74 61 2e 53 74 61 72 74 
00 00 09");
-    RTMPMsg *msg5 = rtmpserv.decodeMsgBody(hex5);
-//    msg5->dump();
-//    cout << msg5->getStreamID() << endl;
-//    std::vector<amf::Element *> hell4 = msg4->getElements();
-    if ((msg5->getStatus() ==  RTMPMsg::NS_DATA_START)
-        && (msg5->getMethodName() == "onStatus")
-        && (msg5->getStreamID() == -1)
-        && (msg5->size() == 1)) {
-        runtest.pass("Decoded RTMP onStatus(Data Start)");
-    } else {
-        runtest.fail("Decoded RTMP onStatus(Data Start)");
-    }
-    delete hex5;
-    delete msg5;
-
-// onStatus
-//     level
-//     status
-//     code
-//         NetStream.Play.Start
-//     description
-//         Started playing address@hidden
-//     details
-//         address@hidden
-    Buffer *hex6 = hex2mem("02 00 08 6f 6e 53 74 61 74 75 73 00 00 00 00 00 00 
00 00 00 05 03 00 05 6c 65 76 65 6c 02 00 06 73 74 61 74 75 73 00 04 63 6f 64 
65 02 00 14 4e 65 74 53 74 72 65 61 6d 2e 50 6c 61 79 2e 53 74 61 72 74 00 0b 
64 65 73 63 72 69 70 74 69 6f 6e 02 00 24 53 74 61 72 74 65 64 20 70 6c 61 79 
69 6e 67 20 50 44 5f 45 6e 67 6c 69 73 68 5f 4c 6f 77 40 32 30 30 31 2e 00 07 
64 65 74 61 69 6c 73 02 00 13 50 44 5f 45 6e 67 6c 69 73 68 5f 4c 6f 77 40 32 
30 30 31 00 08 63 6c 69 65 6e 74 69 64 02 00 08 64 73 4c 67 59 6f 68 62 00 00 
09");
-    RTMPMsg *msg6 = rtmpserv.decodeMsgBody(hex6);
-//    msg6->dump();
-//    std::vector<amf::Element *> hell4 = msg4->getElements();
-    if ((msg6->getStatus() ==  RTMPMsg::NS_PLAY_START)
-        && (msg6->getMethodName() == "onStatus")
-        && (msg6->getStreamID() == 0)
-        && (msg6->size() == 1)) {
-        runtest.pass("Decoded RTMP onStatus(Play Start)");
-    } else {
-        runtest.fail("Decoded RTMP onStatus(Play Start)");
-    }
-    delete hex6;
-    delete msg6;
-
-// ..............._error.?......... 
..level...error..code...NetConnection.Connect.Rejected..description..A[ 
Server.Reject ] : Virtual host _defa.ultVHost_ is not available....
-    Buffer *hex7 = hex2mem("02 00 06 5f 65 72 72 6f 72 00 3f f0 00 00 00 00 00 
00 05 03 00 05 6c 65 76 65 6c 02 00 05 65 72 72 6f 72 00 04 63 6f 64 65 02 00 
1e 4e 65 74 43 6f 6e 6e 65 63 74 69 6f 6e 2e 43 6f 6e 6e 65 63 74 2e 52 65 6a 
65 63 74 65 64 00 0b 64 65 73 63 72 69 70 74 69 6f 6e 02 00 41 5b 20 53 65 72 
76 65 72 2e 52 65 6a 65 63 74 20 5d 20 3a 20 56 69 72 74 75 61 6c 20 68 6f 73 
74 20 5f 64 65 66 61 c3 75 6c 74 56 48 6f 73 74 5f 20 69 73 20 6e 6f 74 20 61 
76 61 69 6c 61 62 6c 65 2e 00 00 09");
-    RTMPMsg *msg7 = rtmpserv.decodeMsgBody(hex7);
-    if ((msg7->getStatus() ==  RTMPMsg::NC_CONNECT_REJECTED)
-        && (msg7->getMethodName() == "_error")
-        && (msg7->size() == 1)) {
-        runtest.pass("Decoded RTMP _error(NC_CONNECT_REJECTED");
-    } else {
-        runtest.fail("Decoded RTMP _error(NC_CONNECT_REJECTED)");
-    }
-
-    delete hex7;
-    delete msg7;
-
-//.onStatus.............level...error..code...NetStream.Play.StreamNotFound..description..6Failed
 to play gate06_tablan_bcueu_; .stream not 
found...details...gate06_tablan_bcueu_..clientid.A.;..
-    Buffer *hex8 = hex2mem("02 00 08 6f 6e 53 74 61 74 75 73 00 00 00 00 00 00 
00 00 00 05 03 00 05 6c 65 76 65 6c 02 00 05 65 72 72 6f 72 00 04 63 6f 64 65 
02 00 1d 4e 65 74 53 74 72 65 61 6d 2e 50 6c 61 79 2e 53 74 72 65 61 6d 4e 6f 
74 46 6f 75 6e 64 00 0b 64 65 73 63 72 69 70 74 69 6f 6e 02 00 36 46 61 69 6c 
65 64 20 74 6f 20 70 6c 61 79 20 67 61 74 65 30 36 5f 74 61 62 6c 61 6e 5f 62 
63 75 65 75 5f 3b 20 c4 73 74 72 65 61 6d 20 6e 6f 74 20 66 6f 75 6e 64 2e 00 
07 64 65 74 61 69 6c 73 02 00 14 67 61 74 65 30 36 5f 74 61 62 6c 61 6e 5f 62 
63 75 65 75 5f 00 08 63 6c 69 65 6e 74 69 64 00 41 d8 3b b4 e4 00 00 00 00 00 
09");
-    RTMPMsg *msg8 = rtmpserv.decodeMsgBody(hex8);
-//    msg4->dump();
-//    std::vector<amf::Element *> hell4 = msg4->getElements();
-    if ((msg8->getStatus() ==  RTMPMsg::NS_PLAY_STREAMNOTFOUND)
-        && (msg8->getMethodName() == "onStatus")
-        && (msg8->size() == 1)) {
-        runtest.pass("Decoded RTMP onStatus(Play Stream Not Found)");
-    } else {
-        runtest.fail("Decoded RTMP onStatus(Play Stream Not Found)");
-    }
-    delete hex8;
-    delete msg8;
-
-
-//.....onStatus.............level...status..code...NetStream.Play.Stop..description..%Stopped
 playing 
gate06_tablan_bcueu_...details....gate06_tablan_bcueu_..clientid.A.;.......reason......
     
-    Buffer *hex9 = hex2mem("02 00 08 6f 6e 53 74 61 74 75 73 00 00 00 00 00 00 
00 00 00 05 03 00 05 6c 65 76 65 6c 02 00 06 73 74 61 74 75 73 00 04 63 6f 64 
65 02 00 13 4e 65 74 53 74 72 65 61 6d 2e 50 6c 61 79 2e 53 74 6f 70 00 0b 64 
65 73 63 72 69 70 74 69 6f 6e 02 00 25 53 74 6f 70 70 65 64 20 70 6c 61 79 69 
6e 67 20 67 61 74 65 30 36 5f 74 61 62 6c 61 6e 5f 62 63 75 65 75 5f 2e 00 07 
64 65 74 61 69 6c 73 c4 02 00 14 67 61 74 65 30 36 5f 74 61 62 6c 61 6e 5f 62 
63 75 65 75 5f 00 08 63 6c 69 65 6e 74 69 64 00 41 d8 3b b4 e4 00 00 00 00 06 
72 65 61 73 6f 6e 02 00 00 00 00 09");
-    RTMPMsg *msg9 = rtmpserv.decodeMsgBody(hex9);
-//    msg4->dump();
-//    std::vector<amf::Element *> hell4 = msg4->getElements();
-    if ((msg9->getStatus() ==  RTMPMsg::NS_PLAY_STOP)
-        && (msg9->getMethodName() == "onStatus")
-        && (msg9->size() == 1)) {
-        runtest.pass("Decoded RTMP onStatus(Play Stream Stop)");
-    } else {
-        runtest.fail("Decoded RTMP onStatus(Play Stream Stop)");
-    }
-    delete hex9;
-    delete msg9;
+    
+#if 0
+//    const char *x4 = "";
+    Buffer *hex4 = hex2mem("");
+    Buffer *buf4 = rtmpserv.encodeResult(RTMPMsg::NC_CONNECT_REJECTED);
+    if ((memcmp(hex4->reference(), buf4->reference(), buf4->size()) == 0)) {
+        runtest.pass("Encoded RTMP result(NC_CONNECT_REJECTED");
+    } else {
+        runtest.fail("Encoded RTMP result(NC_CONNECT_REJECTED)");
+    }
+    delete buf4;
+    
+//    const char *x5 = "";
+    Buffer *hex5 = hex2mem("");
+    Buffer *buf5 = rtmpserv.encodeResult(RTMPMsg::NC_CONNECT_APPSHUTDOWN);
+    if ((memcmp(hex5->reference(), buf5->reference(), buf5->size()) == 0)) {
+        runtest.pass("Encoded RTMP result(NC_CONNECT_APPSHUTDOWN)");
+    } else {
+        runtest.fail("Encoded RTMP result(NC_CONNECT_APPSHUTDOWN)");
+    }
+    delete buf5;
+    
+//    const char *x6 = "";
+    Buffer *hex6 = hex2mem("");
+    Buffer *buf6 = 
rtmpserv.encodeResult(RTMPMsg::NC_CONNECT_INVALID_APPLICATION);
+    if ((memcmp(hex6->reference(), buf6->reference(), buf6->size()) == 0)) {
+        runtest.pass("Encoded RTMP result(NC_CONNECT_INVALID_APPLICATION)");
+    } else {
+        runtest.fail("Encoded RTMP result(NC_CONNECT_INVALID_APPLICATION)");
+    }
+    delete buf6;
+    
+//    const char *x7 = "";
+    Buffer *hex7 = hex2mem("");
+    Buffer *buf7 = rtmpserv.encodeResult(RTMPMsg::NC_CONNECT_CLOSED);
+    if ((memcmp(hex7->reference(), buf7->reference(), buf7->size()) == 0)) {
+        runtest.pass("Encoded RTMP result(NC_CONNECT_INVALID_CLOSED)");
+    } else {
+        runtest.fail("Encoded RTMP result(NC_CONNECT_INVALID_CLOSED)");
+    }
+    delete buf7;
+#endif
+
 }
 
 void
@@ -844,8 +478,8 @@
     delete buf1;
     delete buf2;
     
-    buf1 = hex2mem("02 00 04 70 6c 61 79 00 00 00 00 00 00 00 00 00 05 02 00 
16 67 61 74 65 30 36 5f 74 61 62 6c 616e 5f 62 63 75 65 75 5f 30 31");
-    buf2 = rtmp.encodeStreamOp(0, RTMP::STREAM_PLAY, false, 
"gate06_tablan_bcueu_01");
+    buf1 = hex2mem("02 00 04 70 6c 61 79 00 00 00 00 00 00 00 00 00 05 01 00");
+    buf2 = rtmp.encodeStreamOp(0, RTMP::STREAM_PLAY, false);
     if ((memcmp(buf1->reference(), buf2->reference(), buf1->size()) == 0)) {
         runtest.pass("Encoded RTMPClient::encodeStreamOp(RTMP::STREAM_PLAY)");
     } else {
@@ -907,24 +541,9 @@
     }
     delete buf1;
     delete buf2;
+
 }
 
-// FLV data header
-//
-// onMetaData
-// duration
-// width
-// height
-// videodatarate
-// framerate
-// videocodecid
-// audiodatarate
-// audiodelay
-// audiocodecid
-// canSeek
-// ToEnd
-//"02 00 0a 6 6e 4d 65 74 61 44 61 74 61 08 00 00 00 0a 00 08 64 75 72 61 74 
69 6f 6e 00 40 ad 04 14 7a e1 47 ae 00 05 77 69 64 74 68 00 40 74 00 00 00 00 
00 00 00 06 68 65 69 67 68 74 00 40 6e 00 00 00 00 00 00 0d 76 69 64 65 6f 64 
61 74 61 72 61 74 65 00 40 72 c0 00 00 00 00 00 00 09 66 72 61 6d 65 72 61 74 
65 00 40 39 00 00 00 00 00 00 00 0c 76 69 64 65 6f 63 6f 64 65 63 69 64 00 40 
10 00 00 00 00 00 00 00 0d 61 75 64 69 6f 64 61 74 61 72 61 74 65 00 40 58 00 
00 00 00 00 00 00 0a 61 75 64 69 6f 64 65 6c 61 79 00 3f a3 74 bc 6a 7e f9 db 
00 0c 61 75 64 69 6f 63 6f 64 65 63 69 64 00 40 00 00 00 00 00 00 00 00 0c 63 
61 6e 53 65 65 6b 54 6f 45 6e 64 01 01 00 00 09"
-
 static void
 usage (void)
 {
@@ -946,22 +565,24 @@
 
 #endif
 
+// 03 00 00 04 00 01 1f 14 00 00 00 00 02 00 07 63   ...............c
+// 6f 6e 6e 65 63 74 00 3f f0 00 00 00 00 00 00 03   onnect.?........
+// 00 03 61 70 70 02 00 08 6f 66 6c 61 44 65 6d 6f   ..app...oflaDemo
+// 00 08 66 6c 61 73 68 56 65 72 02 00 0c 4c 4e 58   ..flashVer...LNX
+// 20 39 2c 30 2c 33 31 2c 30 00 06 73 77 66 55 72    9,0,31,0..swfUr
+// 6c 02 00 33 68 74 74 70 3a 2f 2f 6c 6f 63 61 6c   l..3http://local
+// 68 6f 73 74 2f 73 6f 66 74 77 61 72 65 2f 67 6e   host/software/gn
+// 61 73 68 2f 74 65 73 74 73 2f 6f 66 6c 61 5f 64   ash/tests/ofla_d
+// 65 6d 6f 2e 73 77 66 00 05 74 63 55 c3 72 6c 02   emo.swf..tcU.rl.
+// 00 19 72 74 6d 70 3a 2f 2f 6c 6f 63 61 6c 68 6f   ..rtmp://localho
+// 73 74 2f 6f 66 6c 61 44 65 6d 6f 00 04 66 70 61   st/oflaDemo..fpa
+// 64 01 00 00 0b 61 75 64 69 6f 43 6f 64 65 63 73   d....audioCodecs
+// 00 40 83 38 00 00 00 00 00 00 0b 76 69 64 65 6f   address@hidden
+// 43 6f 64 65 63 73 00 40 5f 00 00 00 00 00 00 00   address@hidden
+// 0d 76 69 64 65 6f 46 75 6e 63 74 69 6f 6e 00 3f   .videoFunction.?
+// f0 00 00 00 00 00 00 00 07 70 61 67 65 55 72 6c   .........pageUrl
+// 02 00 26 68 74 74 70 3a 2f 2f 6c 6f 63 c3 61 6c   ..&http://loc.al
+// 68 6f 73 74 2f 73 6f 66 74 77 61 72 65 2f 67 6e   host/software/gn
+// 61 73 68 2f 74 65 73 74 73 2f 00 00 09
+
     
-// T 193.2.4.161:1935 -> 192.168.1.103:34693 [AP]
-//   03 00 00 00 00 00 9e 14    00 00 00 00 02 00 06 5f    ..............._
-//   65 72 72 6f 72 00 3f f0    00 00 00 00 00 00 05 03    error.?.........
-//   00 05 6c 65 76 65 6c 02    00 05 65 72 72 6f 72 00    ..level...error.
-//   04 63 6f 64 65 02 00 1e    4e 65 74 43 6f 6e 6e 65    .code...NetConne
-//   63 74 69 6f 6e 2e 43 6f    6e 6e 65 63 74 2e 52 65    ction.Connect.Re
-//   6a 65 63 74 65 64 00 0b    64 65 73 63 72 69 70 74    jected..descript
-//   69 6f 6e 02 00 41 5b 20    53 65 72 76 65 72 2e 52    ion..A[ Server.R
-//   65 6a 65 63 74 20 5d 20    3a 20 56 69 72 74 75 61    eject ] : Virtua
-//   6c 20 68 6f 73 74 20 5f    64 65 66 61 c3 75 6c 74    l host _defa.ult
-//   56 48 6f 73 74 5f 20 69    73 20 6e 6f 74 20 61 76    VHost_ is not av
-//   61 69 6c 61 62 6c 65 2e    00 00 09                   ailable....     
-// #
-
-// T 193.2.4.161:1935 -> 192.168.1.103:34693 [AP]
-//   03 00 00 00 00 00 12 14    00 00 00 00 02 00 05 63    ...............c
-//   6c 6f 73 65 00 00 00 00    00 00 00 00 00 05          lose..........  
-// #


reply via email to

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