### Eclipse Workspace Patch 1.0
#P simpletest
Index: tests/functional/dblog.test
===================================================================
RCS file: /cvs/drupal/contributions/modules/simpletest/tests/functional/dblog.test,v
retrieving revision 1.1
diff -u -r1.1 dblog.test
--- tests/functional/dblog.test	2 Apr 2008 22:33:48 -0000	1.1
+++ tests/functional/dblog.test	5 Apr 2008 18:28:07 -0000
@@ -218,12 +218,10 @@
     $this->drupalLogout();
     // Fetch row ids in watchdog that relate to the user.
     $result = db_query('SELECT wid FROM {watchdog} WHERE uid = %d', $user->uid);
-    for ($i = 0; $i < mysqli_num_rows($result); $i++) {
-      $ids[] = db_result($result);
-    }
-    if (isset($ids)) {
-      $count_before = count($ids);
+    while ($row = db_fetch_array($result)) {
+      $ids[] = $row['wid'];
     }
+    $count_before = (isset($ids)) ? count($ids) : 0;
     $this->assertTrue($count_before > 0, t('DBLog contains @count records for @name', array('@count' => $count_before, '@name' => $user->name)));
     // Delete user.
     user_delete(array(), $user->uid);
@@ -233,12 +231,10 @@
     // Fetch row ids in watchdog that previously related to the deleted user.
     $result = db_query('SELECT wid FROM {watchdog} WHERE uid = 0 AND wid IN (%s)', implode(', ', $ids));
     unset($ids);
-    for ($i = 0; $i < mysqli_num_rows($result); $i++) {
-      $ids[] = db_result($result);
-    }
-    if (isset($ids)) {
-      $count_after = count($ids);
+    while ($row = db_fetch_array($result)) {
+      $ids[] = $row['wid'];
     }
+    $count_after = (isset($ids)) ? count($ids) : 0;
     $this->assertTrue($count_after == $count_before, t('DBLog contains @count records for @name that now have uid = 0', array('@count' => $count_before, '@name' => $user->name)));
     unset($ids);
     // Fetch row ids in watchdog that relate to the user.
