If you are using rewrite directives (SEO URLS) you need to edit your htaccess and change the RewriteBase to
############################################
## you can put here your magento root folder
## path relative to web root
RewriteBase /test/
Then manually rename the 'var/cache' folder and make sure it gets recreated when you try and reload the index.php
Edit:
here is a smple local.xml file
<config>
<global>
<install>
<date><![CDATA[Wed, 11 Feb 2015 12:25:38 +0000]]></date>
</install>
<crypt>
<key><![CDATA[bf0accb767a157c6da44eca568a92142]]></key>
</crypt>
<disable_local_modules>false</disable_local_modules>
<resources>
<db>
<table_prefix><![CDATA[]]></table_prefix>
</db>
<default_setup>
<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[root]]></username>
<password><![CDATA[root]]></password>
<dbname><![CDATA[local_magento_com]]></dbname>
<initStatements><![CDATA[SET NAMES utf8]]></initStatements>
<model><![CDATA[mysql4]]></model>
<type><![CDATA[pdo_mysql]]></type>
<pdoType><![CDATA[]]></pdoType>
<active>1</active>
</connection>
</default_setup>
</resources>
<session_save><![CDATA[files]]></session_save>
</global>
<admin>
<routers>
<adminhtml>
<args>
<frontName><![CDATA[admin]]></frontName>
</args>
</adminhtml>
</routers>
</admin>
</config>