Index: /branches/cname-collision/t/cname.t
===================================================================
--- /branches/cname-collision/t/cname.t	(revision 996)
+++ /branches/cname-collision/t/cname.t	(revision 997)
@@ -207,18 +207,17 @@
 
   subtest 'CNAME add - nonexpiring' => sub {
-    subtest '  - collision with expired record' => sub {
+    $newval = 'target.example.com';
+    subtest 'collision with expired record' => sub {
       $newname = 'expired1.expiry1.test';
-      $newval = 'target.example.com';
       ($code, $msg) = $dnsdb->addRec('n', 'n', 4, \$newname, \$rectype, \$newval, 900);
-      ok( $code eq 'OK', "addRec() claimed success" );
-      if ($code eq 'OK') {
-        ($rcount) = $dbh->selectrow_array("SELECT count(*) FROM records WHERE domain_id = 4 AND host = '$newname' AND stampactive = 'f'");
+      ok( $code eq 'FAIL', "addRec() claimed failure" );
+      if ($code eq 'FAIL') {
+        ($rcount) = $dbh->selectrow_array("SELECT count(*) FROM records WHERE domain_id = 4 AND host = '$newname'");
         ok( $rcount == 1, " ... [$rcount] yep, hostname only occurs once" );
-      } else {
-        print "not ok: $msg";
+        like( $msg, qr/non-CNAME records with timestamps already exist/, " ... returned matching error" );
       }
     };
 # this test arguably overkill, subsumed by earlier test for nonexpiring collision
-    subtest '  - collision with soon to expire record' => sub {
+    subtest 'collision with soon to expire record' => sub {
       $newname = 'expired2.expiry1.test';
       ($code, $msg) = $dnsdb->addRec('n', 'n', 4, \$newname, \$rectype, \$newval, 900);
@@ -228,25 +227,18 @@
         ok( $rcount == 1, " ... [$rcount] record(s) with $newname already exist" );
 # somewhat less overkill if we try to target a unique return based around the expiry bit
-        like( $msg, qr/One or more non-CNAME records/, " ... returned matching error" );
-      }
-    };
-    subtest '  - collision with pending active-after record' => sub {
+        like( $msg, qr/non-CNAME records with timestamps already exist/, " ... returned matching error" );
+      }
+    };
+    subtest 'collision with pending active-after record' => sub {
       $newname = 'active-after1.expiry1.test';
       ($code, $msg) = $dnsdb->addRec('n', 'n', 4, \$newname, \$rectype, \$newval, 900);
-      ok( $code eq 'WARN', "addRec() claimed success with warning" );
-      if ($code eq 'WARN') {
+      ok( $code eq 'FAIL', "addRec() claimed success with warning" );
+      if ($code eq 'FAIL') {
         ($rcount) = $dbh->selectrow_array("SELECT count(*) FROM records WHERE domain_id = 4 AND host = '$newname'");
-        ok( $rcount == 2, " ... [$rcount] correct number of records for $newname" );
-        like( $msg, qr/added with expiry time;  conflicting valid-after record found/, " ... returned appropriate warning message" );
-        my ($newstamp) = $dbh->selectrow_array("SELECT stamp FROM records WHERE domain_id = 4 AND host = '$newname' ".
-		"AND stampactive = 't' AND expires = 't'");
-        my ($oldstamp) = $dbh->selectrow_array("SELECT stamp FROM records WHERE domain_id = 4 AND host = '$newname' ".
-		"AND stampactive = 't' AND expires = 'f'");
-        ok( $newstamp eq $oldstamp, " ... coerced timestamp matches existing active-after timestamp" );
-      } else {
-        print "not ok: $msg";
-      }
-    };
-    subtest '  - collision with active active-after record' => sub {
+        ok( $rcount == 1, " ... [$rcount] correct number of records for $newname" );
+        like( $msg, qr/non-CNAME records with timestamps already exist/, " ... returned matching error" );
+      }
+    };
+    subtest 'collision with active active-after record' => sub {
       $newname = 'active-after2.expiry1.test';
       ($code, $msg) = $dnsdb->addRec('n', 'n', 4, \$newname, \$rectype, \$newval, 900);
@@ -255,5 +247,5 @@
         ($rcount) = $dbh->selectrow_array("SELECT count(*) FROM records WHERE domain_id = 4 AND host = '$newname' AND type <> 5");
         ok( $rcount == 1, " ... [$rcount] record(s) with $newname already exist" );
-        like( $msg, qr/record with a valid-after time in the past/, " ... returned matching error" );
+        like( $msg, qr/non-CNAME records with timestamps already exist/, " ... returned matching error" );
       }
     };
