diff --git a/.gitattributes b/.gitattributes index 23dbab20f4..5d666b64df 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3206,6 +3206,8 @@ packages/fcl-xml/tests/readertest.pp svneol=native#text/plain packages/fcl-xml/tests/readerunit.pp svneol=native#text/plain packages/fcl-xml/tests/template.xml svneol=native#text/plain packages/fcl-xml/tests/testgen.pp svneol=native#text/plain +packages/fcl-xml/tests/testxmlconf.lpi svneol=native#text/plain +packages/fcl-xml/tests/testxmlconf.lpr svneol=native#text/plain packages/fcl-xml/tests/xmlts.pp svneol=native#text/plain packages/fcl-xml/tests/xpathts.pp svneol=native#text/plain packages/fftw/Makefile svneol=native#text/plain diff --git a/packages/fcl-xml/tests/testxmlconf.lpi b/packages/fcl-xml/tests/testxmlconf.lpi new file mode 100644 index 0000000000..c2daccfe37 --- /dev/null +++ b/packages/fcl-xml/tests/testxmlconf.lpi @@ -0,0 +1,64 @@ + + + + + + + + + + + + + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <i18n> + <EnableI18N LFM="False"/> + </i18n> + <VersionInfo> + <StringTable ProductVersion=""/> + </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + </local> + </RunParams> + <Units Count="1"> + <Unit0> + <Filename Value="testxmlconf.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="testxmlconf"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <Target> + <Filename Value="testxmlconf"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/packages/fcl-xml/tests/testxmlconf.lpr b/packages/fcl-xml/tests/testxmlconf.lpr new file mode 100644 index 0000000000..e934f8d11f --- /dev/null +++ b/packages/fcl-xml/tests/testxmlconf.lpr @@ -0,0 +1,31 @@ +program testxmlconf; + +uses xmlconf; + +begin + With TXMLConfig.Create(Nil) do + try + FileName:='test.xml'; + OpenKey('General'); + SetValue('one',1); + SetValue('two',2); + SetValue('extra/name','michael'); + Flush; + finally + Free; + end; + With TXMLConfig.Create(Nil) do + try + FileName:='test.xml'; + OpenKey('General'); + If GetValue('one',0)<>1 then + Writeln('One does not match'); + If GetValue('two',0)<>2 then + Writeln('Two does not match'); + if GetValue('extra/name','')<>'michael' then + Writeln('Name does not match'); + finally + Free; + end; +end. +