rockbox/firmware/test/fat
Marcin Bukat 18c016b4e0 Fix test fat failing on 64bit system (second bit of FS#12646)
We use unsigned long/long in number of places in fat.c. When this
is used to cast 32bit fat field it fails on 64bit systems.
This patch introduces explicit types (uint16_t, uint32_t) only
in places which influence how fat structures are interpreted.

Change-Id: I0be44d0b355f9de20b4deb221698d095f55d4bde
Reviewed-on: http://gerrit.rockbox.org/232
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
Reviewed-by: Torne Wuff <torne@wolfpuppy.org.uk>
2012-05-08 13:00:56 +02:00
..
ata-sim.c Made the fat test code compile again. 2011-02-28 10:48:58 +00:00
autoconf.h Added dummy autoconf.h for fat test. 2011-02-28 10:51:45 +00:00
main.c Fix fat test program not compiling (FS#12646). 2012-05-08 13:00:14 +02:00
Makefile Fix test fat failing on 64bit system (second bit of FS#12646) 2012-05-08 13:00:56 +02:00
README Made the fat test code compile again. 2011-02-28 10:48:58 +00:00
test.sh Made the fat test code compile again. 2011-02-28 10:48:58 +00:00
test16.sh

This code is for testing the Rockbox fat code on a dummy drive image file.

Dummy image
-----------
Here's how to create a 1 gig dummy drive image in linux:

# dd if=/dev/hda of=disk.img bs=1M count=1024

You can then format disk.img as a FAT32 partition:

# mkdosfs -F 32 disk.img

To mount the image, your linux kernel must include the loopback device:

# mount -o loop disk.img /mnt/image

Now copy some test data to the disk, umount it and start testing.

The test script mounts the disk image in order to initialize it will a number
of dummy files. Since users are no longer allowed to mount loopback devices,
you can either run the test script as root (not recommended) or add a line to
your fstab file:

/path/to/disk.img /mnt/dummy vfat loop,users,noauto 0 0


Test code
---------
The files in this dir build the 'fat' program. It will read 'disk.img' and
treat is as a real disk, thanks to the ata-sim.c module.

Modify the main.c source code to make it perform the tests you want.