Commit 884f6f26 authored by norvell's avatar norvell
Browse files

Fix for format identification to pick the earliest match in the test case

parent aa9ca52d
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -41,8 +41,8 @@ if __name__ == "__main__":
    count = {'PASS':0,'FAIL':0,'ERROR':0}

    # Formats, categories and MLD histogram limits
    formats = {'**Unidentified format**':r'.*','Stereo':r'stereo', 'ISM':r'ISM', 'Multichannel':r'Multi-channel', 
               'MASA':r'MASA','SBA':r'SBA', 'OSBA':r'OSBA', 'OMASA':r'OMASA','Renderer':r'renderer'}
    formats = {'Stereo':r'stereo', 'ISM':r'ISM', 'Multichannel':r'Multi-channel',
               'MASA':r'MASA','SBA':r'SBA', 'OSBA':r'OSBA', 'OMASA':r'OMASA','Renderer':r'renderer','**Unidentified format**':r'.*'}
    categories = {'Normal operation':r'.*', 'DTX':r'DTX', 'PLC':r'%', 'Bitrate switching':r'br sw|bitrate switching', 'JBM':r'JBM' }
    limits = [0,5,10,20,math.inf]

@@ -72,7 +72,8 @@ if __name__ == "__main__":
            properties_values = [str(properties_found.get(p)) for p in PROPERTIES]

            # Identify format and category (mode of operation)
            fmt = [f for f in formats if re.search(formats[f], fulltestname, re.IGNORECASE)][-1]
            # For the format, favor the earliest match in the test case name
            fmt = min([(f, re.search(formats[f], fulltestname, re.IGNORECASE).end()) for f in formats if re.search(formats[f], fulltestname, re.IGNORECASE)] , key=lambda x: x[1])[0]
            cat = [c for c in categories if re.search(categories[c], fulltestname, re.IGNORECASE)][-1]

            # For ERROR cases, both a FAIL and an ERROR result is generated.