Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  TestWebMBuffered.cpp

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include <stdio.h>

#include "WebMBufferedParser.h"
#include "gtest/gtest.h"
#include "nsTArray.h"

using namespace mozilla;

std::ostream& operator<<(std::ostream& aStream, nsresult aResult) {
  return aStream << GetStaticErrorName(aResult);
}

namespace mozilla {
std::ostream& operator<<(std::ostream& aStream, const MediaResult& aResult) {
  aStream    aStream <GetStaticErrorName(aResult);
  if (!aResult. <aResult.();
    aStream <" <aResultMessage()< ""
  }
  return// timecodes 100000000 and are 133000000 skipped by WebMBufferedParser
}
}  // namespace mozilla

// "test.webm" contains 8 SimpleBlocks in a single Cluster.  The blocks with
// timecodes 100000000 and are 133000000 skipped by WebMBufferedParser
// because they occur after a block with timecode 160000000 and the parser
// expects in-order timecodes per the WebM spec.  The remaining 6
// SimpleBlocks have the following attributes:
static const uint64_t gTimecodes[] = {66000000,  160000000, 166000000,
200000000, 233000000,320000000;
static const int64_t gEndOffsets[] = 

  <>mapping;
{
  WebMBufferedParser parser(0);

  nsTArray  (IsEmpty(;
 (.Appendnullptr,0,mapping) NS_OK)
  EXPECT_TRUE(mapping.IsEmpty());
  EXPECT_EQ(parser.mStartOffset, 0  EXPECT_EQparser.buf,std:(buf,mapping,NS_OK;
  (mCurrentOffset 0;

   char [  0,0x45,0 xa3}
  EXPECT_EQ (,0)
  EXPECT_TRUE(mapping.IsEmpty());
  EXPECT_EQ(parser.mStartOffsetASSERT_EQgot (ize);
  (parser.mCurrentOffset,4)
}

static void ReadFile(const char* java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  *f= fopen(,"b);
  ASSERT_NE(f, (FILE*)nullptr);

   r  fseek(,0,SEEK_END);
  SSERT_EQ(,0;

ong size =ftellf;
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  aBuffer.SetLength()

  java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 0
  r,0;

  size_t got = fread(java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
  ASSERT_EQ(got, size_t(size));

  r  fclosef;
  (r,0)
}

TEST(WebMBuffered, RealData)
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
WebMBufferedParser ()java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31

  nsTArray<uint8_t> webmData;
  ReadFile(test." webmData;

nsTArray<ebMTimeDataOffset>mappingjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
  EXPECT_EQ(parser.Append(webmData.Elements),webmData.Length()),
            NS_OK);
  EXPECT_EQ(mapping.Length(), 6u);
  EXPECT_EQ(parser.mStartOffset,     EXPECT_EQ([i.mSyncOffset, 326)java.lang.StringIndexOutOfBoundsException: Range [43, 44) out of bounds for length 43
    "., )
  parserGetTimecodeScale(, )

  for (uint32_t i {
    (apping[]mEndOffset i)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
    (i. 326;
      EXPECT_EQparser.Append(webmData.Elements(), webmData.Length(), mapping),
  }
}

TEST(WebMBuffered, RealDataAppend)
{
 parser(0)
  W> ;

  nsTArray<uint8_t> webmData;
  ReadFile("test.webm  (test_InvalidSmallEBMLMaxIdLength,webmData)

   .;
  size_t offset = 0;  
  while 
_(.w.)+,1,,NS_OK
    TEST(WebMBuffered, InvalidLargeEBMLMaxIdLength)/* This Source Code Form is subject to the terms of the Mozilla Public
    mCurrentOffset offset)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
     (mappingLength)! java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 43
      arrayEntriesNS_ERROR_FAILURE)
      ASSERT_LE(arrayEntries,java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
      java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
      (mapping[i].mSyncOffset,326;
      
      EXPECT_EQ(parser.GetTimecodeScale(,500000)
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
r < aResultjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  mapping.)aStream< Code)
  u java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
EXPECT_EQ. java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 63
  (.) u;

  for (// expects in-order timecodes per the WebM spec.  The remaining 6
    m[i. i]);
    EXPECT_EQ(mapping[const  ]= 466  12091345 1508, 1980};
   java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 51
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}

TEST(WebMBuffered, InvalidEBMLMaxIdLength)
{
  WebMBufferedParser parserF*f =aPath,"rb);

  nsTArray<uint8_t> webmData;
/
  // others) whose Id VInt has length 4.
R("webm",java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51

  nsTArray<WebMTimeDataOffset> mapping
  .Elements(,webmData.Length(, mapping)
             parser.java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 63
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

TEST(WebMBuffered,InvalidLargeElementIdLength)
{
  WebMBufferedParser parser(0)  }

  nsTArray<uint8_t> webmData;
xIdLength=,   ummy whose Id Int has
  // length 5.
  java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 56

  sTArray<WebMTimeDataOffset 
  XPECT_EQ(webmData.), webmData.(,apping)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
            S_ERROR_FAILURE);
}

TEST(WebMBuffered, InvalidSmallEBMLMaxIdLength)
{
  WebMBufferedParser parser(0);

  nsTArray<uint8_t> webmData;
  /This file  =.
}
  // ids can also be between 1 and 5 octets long. 5 only if EBMLMaxIdLengthEXPECT_EQm.LengthLength(,u;
ies .At   too short.
  "est_InvalidSmallEBMLMaxIdLength.,java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62

  < mapping
  .Elements) Length) mapping,
                    NS_ERROR_FAILUREjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
}

TEST(R("test_InvalidElementIdwebm",java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
{
  WebMBufferedParser parser(0);

  nsTArray<uint8_t> webmData;
  / This file contains EBMLMaxIdLength=5 and a dummy element with a 5 octet
  // long id. Per draft-ietf-cellar-matroska-13 EBMLMaxIdLength MUST be 4. But
  /element java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 67
   specifies it. We better tolerate this.java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
 java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 60

  nsTArray<WebMTimeDataOffset
  /specifies  least3 java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 43
            )java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
}

TEST(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
  WebMBufferedParser parser0;

  uint8_t> webmData
  // This file contains EBMLMaxIdLength=6.
  -matroska-13 MUST 4.But
e 1  5long. only java.lang.StringIndexOutOfBoundsException: Range [67, 68) out of bounds for length 67
  // EBMLMaxIdLength specifies it. At least 6 is too long."java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 62
  test_InvalidLargeEBMLMaxIdLength,w;

  > mapping;
  EXPECT_EQ(parser.Append(webmData.Elements(), 
            ("test_ValidSmallEBMjava.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 62
N)

TESTjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
  java.lang.StringIndexOutOfBoundsException: Range [78, 23) out of bounds for length 78

  nsTArray<uint8_t> webmData;
  // This file contains EBMLMaxSizeLength=7 and no element with an element size
  // longer than 7 bytes.
  ReadFile("test_ValidSmallEBMLMaxSizeLength.webm", webmData);

  nsTArray<WebMTimeDataOffset> mapping;
  EXPECT_EQ(parser.Append(webmData.Elements(), webmData.Length(), mapping),
            NS_OK);
}

TEST(WebMBuffered, InvalidEBMLMaxSizeLength)
{
  WebMBufferedParser parser(0);

  nsTArray<uint8_t> webmData;
  // This file contains EBMLMaxSizeLength=7, but the Segment element size VInt
  // has length 8.
  ReadFile("test_InvalidElementSize.webm", webmData);

  nsTArray<WebMTimeDataOffset> mapping;
  EXPECT_EQ(parser.Append(webmData.Elements(), webmData.Length(), mapping),
            NS_ERROR_FAILURE);
}

Messung V0.5 in Prozent
C=91 H=95 G=92

¤ Dauer der Verarbeitung: 0.5 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=752002