Index: twisted/test/test_address.py
===================================================================
--- twisted/test/test_address.py	(revision 0)
+++ twisted/test/test_address.py	(revision 0)
@@ -0,0 +1,74 @@
+import re
+
+from twisted.trial import unittest
+from twisted.internet.address import IPv4Address, UNIXAddress
+from twisted.internet.interfaces import IClientEndpoint, IServerEndpoint
+
+
+class AddressTestCaseMixin(object):
+    def test_BuildEndpoint(self):
+        """Test that the IAddress.buildEndpoint returns a provider of both
+        IClientEndpoint and IServerEndpoint"""
+        addr = self.buildAddress()
+        ep = addr.buildEndpoint()
+        self.assertTrue(IClientEndpoint.providedBy(ep))
+        self.assertTrue(IServerEndpoint.providedBy(ep))
+
+    def test_AddressComparison(self):
+        """Test that two different address instances, sharing the same 
+        properties are considered equal."""
+        self.assertEquals(self.buildAddress(), self.buildAddress())
+
+    def test_StringRepresentation(self):
+        """Test that when addresses are converted to strings, they adhere to a 
+        standard pattern. Not sure if it's worth it, but seemed like a bit of 
+        fun and demonstrates an inconsistency with UNIXAddress.__str__
+        """
+        addr = self.buildAddress()
+        pattern = "".join([
+           "^",
+           "([^\(]+Address)", # class name,
+           "\(",       # opening bracket,
+           "([^)]+)",  # arguments,
+           "\)",       # closing bracket,
+           "$"
+        ])
+        m = re.match(pattern, str(addr))
+        self.assertNotEqual(None, m, 
+                            "%s does not match the standard __str__ pattern " 
+                            "ClassName(arg1, arg2, etc)" % str(addr))
+        self.assertEqual(addr.__class__.__name__, m.group(1))
+        
+        args = [x.strip() for x in m.group(2).split(",")]
+        self.assertEqual(len(args), len(self.addressArgSpec))
+        def checkArg(arg, argSpec):
+            self.assertEqual(argSpec[1] % getattr(addr, argSpec[0]), arg)
+        map(checkArg, args, self.addressArgSpec)
+
+
+class IPv4AddressTestCaseMixin(AddressTestCaseMixin):
+    def setUpClass(self):
+        self.addressArgSpec = (("type", "%s"), ("host", "%r"), ("port", "%d"))
+
+
+class IPv4AddressTCPTestCase(unittest.TestCase, IPv4AddressTestCaseMixin):
+    def buildAddress(self):
+        return IPv4Address("TCP", "127.0.0.1", 0)
+
+
+class IPv4AddressUDPTestCase(unittest.TestCase, IPv4AddressTestCaseMixin):
+    def buildAddress(self):
+        return IPv4Address("UDP", "127.0.0.1", 0)
+    
+    def test_BuildEndpoint(self):
+        pass
+    test_BuildEndpoint.skip = "UDP Endpoints are not yet supported"
+
+
+class UNIXAddressTestCase(unittest.TestCase, AddressTestCaseMixin):
+    def setUpClass(self):
+        self._socketAddress = self.mktemp()
+        self.addressArgSpec = (("name", "%r"),)
+        
+    def buildAddress(self):
+        return UNIXAddress(self._socketAddress)
Index: twisted/internet/address.py
===================================================================
--- twisted/internet/address.py	(revision 18181)
+++ twisted/internet/address.py	(working copy)
@@ -40,7 +40,7 @@
         if self.type == "TCP":
             return TCPEndpoint(self.host, self.port)
         else:
-            raise NotImplementedError
+            raise NotImplementedError, "UDP Endpoints are not yet implemented"
 
     def __getitem__(self, index):
         warnings.warn("IPv4Address.__getitem__ is deprecated.  Use attributes instead.",
@@ -96,14 +96,20 @@
         if isinstance(other, tuple):
             return tuple(self) == other
         elif isinstance(other, UNIXAddress):
-            try:
-                return os.path.samefile(self.name, other.name)
-            except OSError:
-                pass
+            # First do the simple thing and check to see if the names are the 
+            # same. If not, and the paths exist, check to see if they point to 
+            # the same file.
+            if self.name == other.name:
+                return True
+            else:
+                try:
+                    return os.path.samefile(self.name, other.name)
+                except OSError:
+                    pass
         return False
 
     def __str__(self):
-        return 'UNIXSocket(%r)' % (self.name,)
+        return 'UNIXAddress(%r)' % (self.name,)
 
 
 # These are for buildFactory backwards compatability due to
