Parser tests, part 3

This commit is contained in:
Matt Nadareski
2020-12-20 21:18:02 -08:00
parent da5d1631c6
commit 0cf44980a9
5 changed files with 74 additions and 5 deletions

View File

@@ -118,7 +118,7 @@ namespace SabreTools.DatFiles.Formats
case "description":
Header.Description ??= itemVal;
break;
case "dersion":
case "version":
Header.Version ??= itemVal;
break;
case "date":

View File

@@ -11,10 +11,9 @@ namespace SabreTools.Test.DatTools
{
// TODO: Create files for each of these
// TODO: Ensure that all stress all bits of reading
// TODO: Add total count? Might be a good metric if everything read
[Theory]
[InlineData(null, (DatFormat)0x00, 0)]
//[InlineData(null, DatFormat.Logiqx, 0)]
[InlineData("test-logiqx.xml", DatFormat.Logiqx, 6)]
//[InlineData(null, DatFormat.LogiqxDeprecated, 0)] // Not parsed separately
//[InlineData(null, DatFormat.SoftwareList, 0)]
//[InlineData(null, DatFormat.Listxml, 0)]
@@ -23,7 +22,7 @@ namespace SabreTools.Test.DatTools
[InlineData("test-openmsx.xml", DatFormat.OpenMSX, 3)]
[InlineData("test-cmp.dat", DatFormat.ClrMamePro, 6)]
//[InlineData(null, DatFormat.RomCenter, 0)]
//[InlineData(null, DatFormat.DOSCenter, 0)]
[InlineData("test-doscenter.dat", DatFormat.DOSCenter, 1)]
[InlineData("test-attractmode.txt", DatFormat.AttractMode, 1)]
//[InlineData(null, DatFormat.MissFile, 0)] // Parsing is not supported
//[InlineData(null, DatFormat.CSV, 0)]

View File

@@ -2,7 +2,7 @@ clrmamepro (
name "Internal DAT Name"
description "Internal DAT Name"
rootdir "root"
category "games"
category "Games"
version "1.0"
date "1900-01-01"
author "Unknown"

View File

@@ -0,0 +1,14 @@
doscenter (
name "Internal DAT Name"
description "Internal DAT Name"
version "1.0"
date "1900-01-01"
author "Unknown"
homepage "127.0.0.1"
comment "Not real data, sorry"
)
game (
name "game1.zip"
file ( name "rom.bin" size 1024 crc DEADBEEF date 1980-01-01 12:00 )
)

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE datafile PUBLIC "-//Logiqx//DTD ROM Management Datafile//EN" "http://www.logiqx.com/Dats/datafile.dtd">
<datafile build="1.0" debug="yes">
<header>
<name>Internal DAT Name</name>
<description>Internal DAT Name</description>
<rootdir>root</rootdir>
<category>Games</category>
<version>1.0</version>
<date>1900-01-01</date>
<author>Unknown</author>
<email>email@email.email</email>
<homepage>localhost</homepage>
<url>127.0.0.1</url>
<comment>Not real data, sorry</comment>
<type>SuperDAT</type>
<clrmamepro header="match.xml" forcemerging="split" forcenodump="ignore" forcepacking="unzip" />
<romcenter plugin="arcade" rommode="split" biosmode="split" samplemode="split" lockrommode="no" lockbiosmode="no" locksamplemode="no" />
</header>
<dir name="topdir">
<machine name="game1" sourcefile="blah.c" board="newboard" rebuildto="game1" runnable="partial" cloneof="game2" romof="game2" sampleof="game2" isbios="yes" isdevice="no" ismechanical="yes">
<comment>Not a real game, sorry</comment>
<description>Game! (Version 1)</description>
<year>1980</year>
<manufacturer>Manufacturer</manufacturer>
<publisher>Publisher</publisher>
<category>Arcade</category>
<trurip>
<titleid>0001</titleid>
<publisher>Publisher</publisher>
<developer>Developer</developer>
<year>1980</year>
<genre>Action</genre>
<subgenre>Adventure</subgenre>
<ratings>5</ratings>
<score>100</score>
<players>4</players>
<enabled>Yes</enabled>
<crc>DEADBEEF</crc>
<source>Official</source>
<cloneof>game2</cloneof>
<relatedto>game3</relatedto>
</trurip>
<disk name="disk" md5="a41d8cd98f00b204e9800998ecf8427e" sha1="aa39a3ee5e6b4b0d3255bfef95601890afd80709" merge="disk2" status="good" />
<media name="media" md5="b41d8cd98f00b204e9800998ecf8427e" sha1="ba39a3ee5e6b4b0d3255bfef95601890afd80709" sha256="aa7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad" spamsum="QXXY" />
<rom name="rom.bin" size="1024" crc="deadbeef" md5="c41d8cd98f00b204e9800998ecf8427e" sha1="ca39a3ee5e6b4b0d3255bfef95601890afd80709" sha256="ca7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad" sha384="ab00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7" sha512="cdaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f" spamsum="QXXZ" merge="rom2.bin" status="good" date="1980-01-01" inverted="true" />
</machine>
<game name="game2">
<archive name="archive" />
<biosset name="biosset" description="Described" default="yes" />
<release name="release" region="World" Language="English" date="1900-01-01" default="yes" />
</game>
</dir>
</datafile>