Index: modules/file/tests/file.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/file/tests/file.test,v
retrieving revision 1.11
diff -u -p -r1.11 file.test
--- modules/file/tests/file.test	17 Feb 2010 05:39:51 -0000	1.11
+++ modules/file/tests/file.test	21 Feb 2010 03:12:37 -0000
@@ -207,7 +207,7 @@ class FileFieldRevisionTestCase extends 
    */
   function testRevisions() {
     $type_name = 'article';
-    $field_name = 'field_' . strtolower($this->randomName());
+    $field_name = strtolower($this->randomName());
     $this->createFileField($field_name, $type_name);
     $field = field_info_field($field_name);
     $instance = field_info_instance('node', $field_name, $type_name);
@@ -297,7 +297,7 @@ class FileFieldDisplayTestCase extends F
    * Test normal formatter display on node display.
    */
   function testNodeDisplay() {
-    $field_name = 'field_' . strtolower($this->randomName());
+    $field_name = strtolower($this->randomName());
     $type_name = 'article';
     $field_settings = array(
       'display_field' => '1',
@@ -352,7 +352,7 @@ class FileFieldValidateTestCase extends 
    */
   function testRequired() {
     $type_name = 'article';
-    $field_name = 'field_' . strtolower($this->randomName());
+    $field_name = strtolower($this->randomName());
     $this->createFileField($field_name, $type_name, array(), array('required' => '1'));
     $field = field_info_field($field_name);
     $instance = field_info_instance('node', $field_name, $type_name);
@@ -398,7 +398,7 @@ class FileFieldValidateTestCase extends 
    */
   function testFileMaxSize() {
     $type_name = 'article';
-    $field_name = 'field_' . strtolower($this->randomName());
+    $field_name = strtolower($this->randomName());
     $this->createFileField($field_name, $type_name, array(), array('required' => '1'));
     $field = field_info_field($field_name);
     $instance = field_info_instance('node', $field_name, $type_name);
@@ -450,7 +450,7 @@ class FileFieldValidateTestCase extends 
    */
   function testFileExtension() {
     $type_name = 'article';
-    $field_name = 'field_' . strtolower($this->randomName());
+    $field_name = strtolower($this->randomName());
     $this->createFileField($field_name, $type_name);
     $field = field_info_field($field_name);
     $instance = field_info_instance('node', $field_name, $type_name);
@@ -507,7 +507,7 @@ class FileFieldPathTestCase extends File
    * Test normal formatter display on node display.
    */
   function testUploadPath() {
-    $field_name = 'field_' . strtolower($this->randomName());
+    $field_name = strtolower($this->randomName());
     $type_name = 'article';
     $field = $this->createFileField($field_name, $type_name);
     $test_file = $this->getTestFile('text');
Index: modules/image/image.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.test,v
retrieving revision 1.14
diff -u -p -r1.14 image.test
--- modules/image/image.test	14 Feb 2010 20:38:28 -0000	1.14
+++ modules/image/image.test	21 Feb 2010 03:12:37 -0000
@@ -598,7 +598,7 @@ class ImageFieldDisplayTestCase extends 
    * Test image formatters on node display.
    */
   function testImageFieldFormatters() {
-    $field_name = 'field_' . strtolower($this->randomName());
+    $field_name = strtolower($this->randomName());
     $this->createImageField($field_name, 'article');
 
     // Create a new node with an image attached.
@@ -647,7 +647,7 @@ class ImageFieldDisplayTestCase extends 
    * Tests for image field settings.
    */
   function testImageFieldSettings() {
-    $field_name = 'field_' . strtolower($this->randomName());
+    $field_name = strtolower($this->randomName());
     $instance_settings = array(
       'alt_field' => 1,
       'file_extensions' => 'gif jpg jpeg',
@@ -705,7 +705,7 @@ class ImageFieldDisplayTestCase extends 
    */
   function testImageFieldDefaultImage() {
     // Create a new image field.
-    $field_name = 'field_' . strtolower($this->randomName());
+    $field_name = strtolower($this->randomName());
     $this->createImageField($field_name, 'article');
 
     // Create a new node, with no images and verify that no images are
@@ -751,7 +751,7 @@ class ImageFieldDisplayTestCase extends 
     // Clear field info cache so the new default image is detected.
     field_info_cache_clear();
     $field = field_info_field($field_name);
-    $this->assertFalse($field['settings']['default_image'], t('Default image removed from field.'));    
+    $this->assertFalse($field['settings']['default_image'], t('Default image removed from field.'));
   }
 }
 
@@ -771,7 +771,7 @@ class ImageFieldValidateTestCase extends
    * Test min/max resolution settings.
    */
   function testResolution() {
-    $field_name = 'field_' . strtolower($this->randomName());
+    $field_name = strtolower($this->randomName());
     $instance_settings = array(
       'max_resolution' => '100x100',
       'min_resolution' => '50x50',
Index: modules/field/modules/field_sql_storage/field_sql_storage.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/field_sql_storage/field_sql_storage.test,v
retrieving revision 1.17
diff -u -p -r1.17 field_sql_storage.test
--- modules/field/modules/field_sql_storage/field_sql_storage.test	11 Feb 2010 17:44:47 -0000	1.17
+++ modules/field/modules/field_sql_storage/field_sql_storage.test	21 Feb 2010 03:12:37 -0000
@@ -23,7 +23,7 @@ class FieldSqlStorageTestCase extends Dr
 
   function setUp() {
     parent::setUp('field_sql_storage', 'field', 'field_test', 'text');
-    $this->field_name = drupal_strtolower($this->randomName() . '_field_name');
+    $this->field_name = drupal_strtolower($this->randomName());
     $this->field = array('field_name' => $this->field_name, 'type' => 'test_field', 'cardinality' => 4);
     $this->field = field_create_field($this->field);
     $this->instance = array(
@@ -324,51 +324,45 @@ class FieldSqlStorageTestCase extends Dr
    * Test adding and removing indexes while data is present.
    */
   function testFieldUpdateIndexesWithData() {
-    // We do not have a db-agnostic inspection system in core yet, so
-    // for now we can only test this on mysql.
-    if (Database::getConnection()->databaseType() == 'mysql') {
-      // Create a decimal field.
-      $field_name = 'testfield';
-      $field = array('field_name' => $field_name, 'type' => 'text');
-      $field = field_create_field($field);
-      $instance = array('field_name' => $field_name, 'object_type' => 'test_entity', 'bundle' => 'test_bundle');
-      $instance = field_create_instance($instance);
-      $tables = array(_field_sql_storage_tablename($field), _field_sql_storage_revision_tablename($field));
-
-      // Verify the indexes we will create do not exist yet.
-      foreach ($tables as $table) {
-        $indexes = $this->getIndexes($table);
-        $this->assertTrue(empty($indexes['value']), t("No index named value exists in $table"));
-        $this->assertTrue(empty($indexes['value_format']), t("No index named value_format exists in $table"));
-      }
 
-      // Add data so the table cannot be dropped.
-      $entity = field_test_create_stub_entity(0, 0, $instance['bundle']);
-      $entity->{$field_name}[LANGUAGE_NONE][0]['value'] = 'field data';
-      field_attach_insert('test_entity', $entity);
+    // Create a decimal field.
+    $field_name = 'testfield';
+    $field = array('field_name' => $field_name, 'type' => 'text');
+    $field = field_create_field($field);
+    $instance = array('field_name' => $field_name, 'object_type' => 'test_entity', 'bundle' => 'test_bundle');
+    $instance = field_create_instance($instance);
+    $tables = array(_field_sql_storage_tablename($field), _field_sql_storage_revision_tablename($field));
 
-      // Add an index
-      $field = array('field_name' => $field_name, 'indexes' => array('value' => array('value')));
-      field_update_field($field);
-      foreach ($tables as $table) {
-        $indexes = $this->getIndexes($table);
-        $this->assertTrue($indexes["{$field_name}_value"] == array(1 => "{$field_name}_value"), t("Index on value created in $table"));
-      }
+    // Verify the indexes we will create do not exist yet.
+    foreach ($tables as $table) {
+      $this->assertFalse(Database::getConnection()->schema()->indexExists($table, 'value'), t("No index named value exists in $table"));
+      $this->assertFalse(Database::getConnection()->schema()->indexExists($table, 'value_format'), t("No index named value_format exists in $table"));
+    }
 
-      // Add a different index, removing the existing custom one.
-      $field = array('field_name' => $field_name, 'indexes' => array('value_format' => array('value', 'format')));
-      field_update_field($field);
-      foreach ($tables as $table) {
-        $indexes = $this->getIndexes($table);
-        $this->assertTrue($indexes["{$field_name}_value_format"] == array(1 => "{$field_name}_value", 2 => "{$field_name}_format"), t("Index on value_format created in $table"));
-        $this->assertTrue(empty($indexes["{$field_name}_value"]), t("Index on value removed in $table"));
-      }
+    // Add data so the table cannot be dropped.
+    $entity = field_test_create_stub_entity(0, 0, $instance['bundle']);
+    $entity->{$field_name}[LANGUAGE_NONE][0]['value'] = 'field data';
+    field_attach_insert('test_entity', $entity);
 
-      // Verify that the tables were not dropped.
-      $entity = field_test_create_stub_entity(0, 0, $instance['bundle']);
-      field_attach_load('test_entity', array(0 => $entity));
-      $this->assertEqual($entity->{$field_name}[LANGUAGE_NONE][0]['value'], 'field data', t("Index changes performed without dropping the tables"));
+    // Add an index
+    $field = array('field_name' => $field_name, 'indexes' => array('value' => array('value')));
+    field_update_field($field);
+    foreach ($tables as $table) {
+      $this->assertTrue(Database::getConnection()->schema()->indexExists($table, "{$field_name}_value"), t("Index on value created in $table"));
+    }
+
+    // Add a different index, removing the existing custom one.
+    $field = array('field_name' => $field_name, 'indexes' => array('value_format' => array('value', 'format')));
+    field_update_field($field);
+    foreach ($tables as $table) {
+      $this->assertTrue(Database::getConnection()->schema()->indexExists($table, "{$field_name}_value_format"), t("Index on value_format created in $table"));
+      $this->assertFalse(Database::getConnection()->schema()->indexExists($table, "{$field_name}_value"), t("Index on value removed in $table"));
     }
+
+    // Verify that the tables were not dropped.
+    $entity = field_test_create_stub_entity(0, 0, $instance['bundle']);
+    field_attach_load('test_entity', array(0 => $entity));
+    $this->assertEqual($entity->{$field_name}[LANGUAGE_NONE][0]['value'], 'field data', t("Index changes performed without dropping the tables"));
   }
 
   /**
@@ -398,13 +392,4 @@ class FieldSqlStorageTestCase extends Dr
       $this->assertEqual($details[FIELD_LOAD_REVISION][$revision][$column_name], $storage_column_name, t('Column name %value matches the definition in %bin.', array('%value' => $column_name, '%bin' => $revision)));
     }
   }
-
-  function getIndexes($table) {
-    $indexes = array();
-    $result = db_query("SHOW INDEXES FROM {" . $table . "}");
-    foreach ($result as $row) {
-      $indexes[$row->key_name][$row->seq_in_index] = $row->column_name;
-    }
-    return $indexes;
-  }
 }
