mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Parser tests, part 5
This commit is contained in:
@@ -227,7 +227,7 @@ namespace SabreTools.DatFiles.Formats
|
|||||||
// Add all infos to the info list
|
// Add all infos to the info list
|
||||||
switch (reader.Name.ToLowerInvariant())
|
switch (reader.Name.ToLowerInvariant())
|
||||||
{
|
{
|
||||||
case "info":
|
default:
|
||||||
var info = new OfflineListInfo
|
var info = new OfflineListInfo
|
||||||
{
|
{
|
||||||
Name = reader.Name.ToLowerInvariant(),
|
Name = reader.Name.ToLowerInvariant(),
|
||||||
@@ -240,10 +240,6 @@ namespace SabreTools.DatFiles.Formats
|
|||||||
|
|
||||||
reader.Read();
|
reader.Read();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
reader.Read();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ namespace SabreTools.Test.DatTools
|
|||||||
[InlineData(null, (DatFormat)0x00, 0)]
|
[InlineData(null, (DatFormat)0x00, 0)]
|
||||||
[InlineData("test-logiqx.xml", DatFormat.Logiqx, 6)]
|
[InlineData("test-logiqx.xml", DatFormat.Logiqx, 6)]
|
||||||
//[InlineData(null, DatFormat.LogiqxDeprecated, 0)] // Not parsed separately
|
//[InlineData(null, DatFormat.LogiqxDeprecated, 0)] // Not parsed separately
|
||||||
//[InlineData(null, DatFormat.SoftwareList, 0)]
|
[InlineData("test-softwarelist.xml", DatFormat.SoftwareList, 5)]
|
||||||
[InlineData("test-listxml.xml", DatFormat.Listxml, 20)]
|
[InlineData("test-listxml.xml", DatFormat.Listxml, 20)]
|
||||||
//[InlineData(null, DatFormat.OfflineList, 0)]
|
[InlineData("test-offlinelist.xml", DatFormat.OfflineList, 1)]
|
||||||
//[InlineData(null, DatFormat.SabreXML, 0)]
|
//[InlineData(null, DatFormat.SabreXML, 0)]
|
||||||
[InlineData("test-openmsx.xml", DatFormat.OpenMSX, 3)]
|
[InlineData("test-openmsx.xml", DatFormat.OpenMSX, 3)]
|
||||||
[InlineData("test-cmp.dat", DatFormat.ClrMamePro, 6)]
|
[InlineData("test-cmp.dat", DatFormat.ClrMamePro, 6)]
|
||||||
|
|||||||
68
SabreTools.Test/TestData/test-offlinelist.xml
Normal file
68
SabreTools.Test/TestData/test-offlinelist.xml
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<dat xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="datas.xsd">
|
||||||
|
<configuration>
|
||||||
|
<datName>Internal DAT Name</datName>
|
||||||
|
<datVersion>1</datVersion>
|
||||||
|
<system>Arcade</system>
|
||||||
|
<screenshotsWidth>224</screenshotsWidth>
|
||||||
|
<screenshotsHeight>224</screenshotsHeight>
|
||||||
|
<infos>
|
||||||
|
<title visible="false" inNamingOption="true" default="false"/>
|
||||||
|
<location visible="true" inNamingOption="true" default="true"/>
|
||||||
|
<publisher visible="true" inNamingOption="true" default="true"/>
|
||||||
|
<sourceRom visible="true" inNamingOption="true" default="true"/>
|
||||||
|
<romSize visible="true" inNamingOption="true" default="true"/>
|
||||||
|
<releaseNumber visible="true" inNamingOption="true" default="false"/>
|
||||||
|
<imageNumber visible="true" inNamingOption="false" default="false"/>
|
||||||
|
<languageNumber visible="true" inNamingOption="true" default="false"/>
|
||||||
|
<comment visible="true" inNamingOption="true" default="false"/>
|
||||||
|
<romCRC visible="true" inNamingOption="true" default="false"/>
|
||||||
|
<im1CRC visible="false" inNamingOption="false" default="false"/>
|
||||||
|
<im2CRC visible="false" inNamingOption="false" default="false"/>
|
||||||
|
<languages visible="true" inNamingOption="true" default="true"/>
|
||||||
|
</infos>
|
||||||
|
<canOpen>
|
||||||
|
<extension>.bin</extension>
|
||||||
|
<extension>.rom</extension>
|
||||||
|
</canOpen>
|
||||||
|
<newDat>
|
||||||
|
<datVersionURL>127.0.0.1</datVersionURL>
|
||||||
|
<datURL fileName="DatName.zip">127.0.0.1/DatName.zip</datURL>
|
||||||
|
<imURL>127.0.0.1/img/</imURL>
|
||||||
|
</newDat>
|
||||||
|
<search>
|
||||||
|
<to value="location" default="true" auto="true"/>
|
||||||
|
<to value="romSize" default="true" auto="false">
|
||||||
|
<find operation="<" value="524288">< 4Mbits</find>
|
||||||
|
<find operation="=" value="524288">4Mbits</find>
|
||||||
|
<find operation="=" value="1048576">8Mbits</find>
|
||||||
|
<find operation="=" value="2097152">16Mbits</find>
|
||||||
|
<find operation="=" value="4194304">32Mbits</find>
|
||||||
|
<find operation="=" value="8388608">64Mbits</find>
|
||||||
|
<find operation="=" value="16777216">128Mbits</find>
|
||||||
|
</to>
|
||||||
|
<to value="languages" default="true" auto="true"/>
|
||||||
|
</search>
|
||||||
|
<romTitle>%u - %n</romTitle>
|
||||||
|
</configuration>
|
||||||
|
<games>
|
||||||
|
<game>
|
||||||
|
<imageNumber>1</imageNumber>
|
||||||
|
<releaseNumber>1</releaseNumber>
|
||||||
|
<title>Game! (Version 1)</title>
|
||||||
|
<saveType>Default</saveType>
|
||||||
|
<romSize>1024</romSize>
|
||||||
|
<publisher>Publisher</publisher>
|
||||||
|
<location>1</location>
|
||||||
|
<sourceRom>Source</sourceRom>
|
||||||
|
<language>256</language>
|
||||||
|
<files>
|
||||||
|
<romCRC extension=".bin">DEBEADEF</romCRC>
|
||||||
|
</files>
|
||||||
|
<im1CRC>deadbeef</im1CRC>
|
||||||
|
<im2CRC>beefdead</im2CRC>
|
||||||
|
<comment>Not a real release, sorry</comment>
|
||||||
|
<duplicateId>0</duplicateId>
|
||||||
|
</game>
|
||||||
|
</games>
|
||||||
|
</dat>
|
||||||
25
SabreTools.Test/TestData/test-softwarelist.xml
Normal file
25
SabreTools.Test/TestData/test-softwarelist.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
|
||||||
|
<!-- Omitting license information and comments normally here -->
|
||||||
|
|
||||||
|
<softwarelist name="softwarelist" description="Test Software List">
|
||||||
|
<software name="game1" cloneof="game2" supported="partial">
|
||||||
|
<description>Game! (Version 1)</description>
|
||||||
|
<year>1980</year>
|
||||||
|
<publisher>Publisher</publisher>
|
||||||
|
<info name="name" value="value" />
|
||||||
|
<sharedfeat name="name" value="value" />
|
||||||
|
<part name="part" interface="interface">
|
||||||
|
<feature name="name" value="value" />
|
||||||
|
<dataarea name="name" size="1024" width="16" endianness="big">
|
||||||
|
<rom name="rom.bin" size="1024" crc="deadbeef" sha1="ca39a3ee5e6b4b0d3255bfef95601890afd80709" offset="0x0000" value="value" status="good" loadflag="load16_byte" />
|
||||||
|
</dataarea>
|
||||||
|
<diskarea name="diskarea">
|
||||||
|
<disk name="disk" sha1="aa39a3ee5e6b4b0d3255bfef95601890afd80709" status="good" writable="no" />
|
||||||
|
</diskarea>
|
||||||
|
<dipswitch name="dipswitch" tag="tag" mask="mask">
|
||||||
|
<dipvalue name="dipvalue" value="value" default="yes" />
|
||||||
|
</dipswitch>
|
||||||
|
</part>
|
||||||
|
</software>
|
||||||
|
</softwarelist>
|
||||||
Reference in New Issue
Block a user