mtd/fs/jffs2/ecos/tests jffs2_1.c, 1.3, 1.4 jffs2_2.c, 1.2,
1.3 jffs2_3.c, 1.2, 1.3
gleixner at infradead.org
gleixner at infradead.org
Mon Nov 7 06:16:08 EST 2005
- Previous message: mtd/Documentation/jffs3 Makefile,1.2,1.3
- Next message: mtd/boot Makefile, 1.4, 1.5 local.h, 1.1, 1.2 main.c, 1.1,
1.2 makerom.c, 1.1, 1.2 misc.c, 1.1, 1.2 sbc_gxx_boot.c, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/mtd/fs/jffs2/ecos/tests
In directory phoenix.infradead.org:/tmp/cvs-serv29274/fs/jffs2/ecos/tests
Modified Files:
jffs2_1.c jffs2_2.c jffs2_3.c
Log Message:
[MTD / JFFS2] Clean up trailing white spaces
Index: jffs2_1.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/ecos/tests/jffs2_1.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- jffs2_1.c 3 Aug 2005 20:39:00 -0000 1.3
+++ jffs2_1.c 7 Nov 2005 11:14:44 -0000 1.4
@@ -47,12 +47,12 @@
// Purpose: Test fileio system
// Description: This test uses the testfs to check out the initialization
// and basic operation of the fileio system
-//
-//
-//
-//
-//
-//
+//
+//
+//
+//
+//
+//
//
//####DESCRIPTIONEND####
//
@@ -127,16 +127,16 @@
int err;
DIR *dirp;
int num=0;
-
+
diag_printf("<INFO>: reading directory %s\n",name);
-
+
dirp = opendir( name );
if( dirp == NULL ) SHOW_RESULT( opendir, -1 );
for(;;)
{
struct dirent *entry = readdir( dirp );
-
+
if( entry == NULL )
break;
num++;
@@ -153,9 +153,9 @@
strcat(fullname, "/" );
}
else fullname[0] = 0;
-
+
strcat(fullname, entry->d_name );
-
+
err = stat( fullname, &sbuf );
if( err < 0 )
{
@@ -196,9 +196,9 @@
err = access( name, F_OK );
if( err < 0 && errno != EACCES ) SHOW_RESULT( access, err );
-
+
for( i = 0; i < IOSIZE; i++ ) buf[i] = i%256;
-
+
fd = open( name, O_WRONLY|O_CREAT );
if( fd < 0 ) SHOW_RESULT( open, fd );
@@ -206,9 +206,9 @@
{
ssize_t len = size;
if ( len > IOSIZE ) len = IOSIZE;
-
+
wrote = write( fd, buf, len );
- if( wrote != len ) SHOW_RESULT( write, wrote );
+ if( wrote != len ) SHOW_RESULT( write, wrote );
size -= wrote;
}
@@ -228,24 +228,24 @@
int i;
int err;
size_t size = 0;
-
+
diag_printf("<INFO>: create maximal file %s\n",name);
err = access( name, F_OK );
if( err < 0 && errno != EACCES ) SHOW_RESULT( access, err );
-
+
for( i = 0; i < IOSIZE; i++ ) buf[i] = i%256;
-
+
fd = open( name, O_WRONLY|O_CREAT );
if( fd < 0 ) SHOW_RESULT( open, fd );
do
{
wrote = write( fd, buf, IOSIZE );
- if( wrote < 0 ) SHOW_RESULT( write, wrote );
+ if( wrote < 0 ) SHOW_RESULT( write, wrote );
size += wrote;
-
+
} while( wrote == IOSIZE );
diag_printf("<INFO>: file size == %d\n",size);
@@ -267,7 +267,7 @@
off_t pos = 0;
diag_printf("<INFO>: check file %s\n",name);
-
+
err = access( name, F_OK );
if( err != 0 ) SHOW_RESULT( access, err );
@@ -288,7 +288,7 @@
(unsigned long)pos,i,buf[i],i%256);
CYG_TEST_FAIL("Data read not equal to data written\n");
}
-
+
pos += done;
}
@@ -313,13 +313,13 @@
err = access( name2, F_OK );
if( err != 0 ) SHOW_RESULT( access, err );
-
+
fd1 = open( name1, O_WRONLY|O_CREAT );
if( fd1 < 0 ) SHOW_RESULT( open, fd1 );
fd2 = open( name2, O_RDONLY );
if( fd2 < 0 ) SHOW_RESULT( open, fd2 );
-
+
for(;;)
{
done = read( fd2, buf, IOSIZE );
@@ -338,7 +338,7 @@
err = close( fd2 );
if( err < 0 ) SHOW_RESULT( close, err );
-
+
}
//==========================================================================
@@ -359,13 +359,13 @@
err = access( name1, F_OK );
if( err != 0 ) SHOW_RESULT( access, err );
-
+
fd1 = open( name1, O_RDONLY );
if( fd1 < 0 ) SHOW_RESULT( open, fd1 );
fd2 = open( name2, O_RDONLY );
if( fd2 < 0 ) SHOW_RESULT( open, fd2 );
-
+
for(;;)
{
done1 = read( fd1, buf1, IOSIZE );
@@ -376,7 +376,7 @@
if( done1 != done2 )
diag_printf("Files different sizes\n");
-
+
if( done1 == 0 ) break;
for( i = 0; i < done1; i++ )
@@ -392,7 +392,7 @@
err = close( fd2 );
if( err < 0 ) SHOW_RESULT( close, err );
-
+
}
//==========================================================================
@@ -403,7 +403,7 @@
char *ret;
ret = getcwd( cwdbuf, sizeof(cwdbuf));
- if( ret == NULL ) SHOW_RESULT( getcwd, ret );
+ if( ret == NULL ) SHOW_RESULT( getcwd, ret );
if( strcmp( cwdbuf, cwd ) != 0 )
{
@@ -426,13 +426,13 @@
// --------------------------------------------------------------
err = mount( CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1, "/", "jffs2" );
- if( err < 0 ) SHOW_RESULT( mount, err );
+ if( err < 0 ) SHOW_RESULT( mount, err );
err = chdir( "/" );
if( err < 0 ) SHOW_RESULT( chdir, err );
checkcwd( "/" );
-
+
listdir( "/", true, -1, &existingdirents );
if ( existingdirents < 2 )
CYG_TEST_FAIL("Not enough dir entries\n");
@@ -459,11 +459,11 @@
if( err < 0 ) SHOW_RESULT( chdir, err );
checkcwd( "/bar" );
-
- diag_printf("<INFO>: rename /foo bundy\n");
+
+ diag_printf("<INFO>: rename /foo bundy\n");
err = rename( "/foo", "bundy" );
if( err < 0 ) SHOW_RESULT( rename, err );
-
+
listdir( "/", true, existingdirents+2, NULL );
listdir( "" , true, 4, NULL );
@@ -477,47 +477,47 @@
copyfile( LONGNAME1, LONGNAME2 );
listdir( "", false, 6, NULL );
-
- diag_printf("<INFO>: unlink " LONGNAME1 "\n");
+
+ diag_printf("<INFO>: unlink " LONGNAME1 "\n");
err = unlink( LONGNAME1 );
if( err < 0 ) SHOW_RESULT( unlink, err );
- diag_printf("<INFO>: unlink " LONGNAME2 "\n");
+ diag_printf("<INFO>: unlink " LONGNAME2 "\n");
err = unlink( LONGNAME2 );
if( err < 0 ) SHOW_RESULT( unlink, err );
-
-
+
+
// --------------------------------------------------------------
- diag_printf("<INFO>: unlink fee\n");
+ diag_printf("<INFO>: unlink fee\n");
err = unlink( "/fee" );
if( err < 0 ) SHOW_RESULT( unlink, err );
- diag_printf("<INFO>: unlink fum\n");
+ diag_printf("<INFO>: unlink fum\n");
err = unlink( "fum" );
if( err < 0 ) SHOW_RESULT( unlink, err );
- diag_printf("<INFO>: unlink /bar/bundy\n");
+ diag_printf("<INFO>: unlink /bar/bundy\n");
err = unlink( "/bar/bundy" );
if( err < 0 ) SHOW_RESULT( unlink, err );
- diag_printf("<INFO>: cd /\n");
+ diag_printf("<INFO>: cd /\n");
err = chdir( "/" );
if( err < 0 ) SHOW_RESULT( chdir, err );
checkcwd( "/" );
-
- diag_printf("<INFO>: rmdir /bar\n");
+
+ diag_printf("<INFO>: rmdir /bar\n");
err = rmdir( "/bar" );
if( err < 0 ) SHOW_RESULT( rmdir, err );
-
+
listdir( "/", false, existingdirents, NULL );
// --------------------------------------------------------------
diag_printf("<INFO>: mount /jffs2 \n");
err = mount( CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1, "/jffs2", "jffs2" );
- if( err < 0 ) SHOW_RESULT( mount, err );
+ if( err < 0 ) SHOW_RESULT( mount, err );
createfile( "/jffs2/tinky", 456 );
copyfile( "/jffs2/tinky", "/jffs2/laalaa" );
@@ -525,13 +525,13 @@
checkfile( "/jffs2/laalaa");
comparefiles( "/jffs2/tinky", "/jffs2/laalaa" );
- diag_printf("<INFO>: cd /jffs2\n");
+ diag_printf("<INFO>: cd /jffs2\n");
err = chdir( "/jffs2" );
if( err < 0 ) SHOW_RESULT( chdir, err );
checkcwd( "/jffs2" );
-
- diag_printf("<INFO>: mkdir noonoo\n");
+
+ diag_printf("<INFO>: mkdir noonoo\n");
err = mkdir( "noonoo", 0 );
if( err < 0 ) SHOW_RESULT( mkdir, err );
@@ -542,7 +542,7 @@
if( err < 0 ) SHOW_RESULT( chdir, err );
checkcwd( "/jffs2/noonoo" );
-
+
createfile( "tinky", 678 );
checkfile( "tinky" );
@@ -554,9 +554,9 @@
/*for(i=0;i<2048;i++) {
- diag_printf("<INFO>: churningchurningchurning................................ITERATION = %d\n", i);
+ diag_printf("<INFO>: churningchurningchurning................................ITERATION = %d\n", i);
createfile( "churningchurningchurning", 4096 );
- diag_printf("<INFO>: unlink churningchurningchurning\n");
+ diag_printf("<INFO>: unlink churningchurningchurning\n");
err = unlink( "churningchurningchurning" );
if( err < 0 ) SHOW_RESULT( unlink, err );
}*/
@@ -568,24 +568,24 @@
// --------------------------------------------------------------
- diag_printf("<INFO>: unlink tinky\n");
+ diag_printf("<INFO>: unlink tinky\n");
err = unlink( "tinky" );
if( err < 0 ) SHOW_RESULT( unlink, err );
- diag_printf("<INFO>: unlink dipsy\n");
+ diag_printf("<INFO>: unlink dipsy\n");
err = unlink( "dipsy" );
if( err < 0 ) SHOW_RESULT( unlink, err );
- diag_printf("<INFO>: unlink po\n");
+ diag_printf("<INFO>: unlink po\n");
err = unlink( "po" );
if( err < 0 ) SHOW_RESULT( unlink, err );
- diag_printf("<INFO>: cd ..\n");
+ diag_printf("<INFO>: cd ..\n");
err = chdir( ".." );
if( err < 0 ) SHOW_RESULT( chdir, err );
checkcwd( "/jffs2" );
-
- diag_printf("<INFO>: rmdir noonoo\n");
+
+ diag_printf("<INFO>: rmdir noonoo\n");
err = rmdir( "noonoo" );
if( err < 0 ) SHOW_RESULT( rmdir, err );
@@ -593,16 +593,16 @@
err = mkdir( "x", 0 );
if( err < 0 ) SHOW_RESULT( mkdir, err );
-
+
err = mkdir( "x/y", 0 );
if( err < 0 ) SHOW_RESULT( mkdir, err );
-
+
err = mkdir( "x/y/z", 0 );
if( err < 0 ) SHOW_RESULT( mkdir, err );
err = mkdir( "x/y/z/w", 0 );
if( err < 0 ) SHOW_RESULT( mkdir, err );
-
+
diag_printf("<INFO>: cd /jffs2/x/y/z/w\n");
err = chdir( "/jffs2/x/y/z/w" );
if( err < 0 ) SHOW_RESULT( chdir, err );
@@ -612,7 +612,7 @@
err = chdir( ".." );
if( err < 0 ) SHOW_RESULT( chdir, err );
checkcwd( "/jffs2/x/y/z" );
-
+
diag_printf("<INFO>: cd .\n");
err = chdir( "." );
if( err < 0 ) SHOW_RESULT( chdir, err );
@@ -628,45 +628,45 @@
if( err < 0 ) SHOW_RESULT( chdir, err );
checkcwd( "/jffs2" );
- diag_printf("<INFO>: rmdir x/y/z/w\n");
+ diag_printf("<INFO>: rmdir x/y/z/w\n");
err = rmdir( "x/y/z/w" );
if( err < 0 ) SHOW_RESULT( rmdir, err );
- diag_printf("<INFO>: rmdir x/y/z\n");
+ diag_printf("<INFO>: rmdir x/y/z\n");
err = rmdir( "x/y/z" );
if( err < 0 ) SHOW_RESULT( rmdir, err );
- diag_printf("<INFO>: rmdir x/y\n");
+ diag_printf("<INFO>: rmdir x/y\n");
err = rmdir( "x/y" );
if( err < 0 ) SHOW_RESULT( rmdir, err );
- diag_printf("<INFO>: rmdir x\n");
+ diag_printf("<INFO>: rmdir x\n");
err = rmdir( "x" );
if( err < 0 ) SHOW_RESULT( rmdir, err );
-
+
// --------------------------------------------------------------
-
- diag_printf("<INFO>: unlink tinky\n");
+
+ diag_printf("<INFO>: unlink tinky\n");
err = unlink( "tinky" );
if( err < 0 ) SHOW_RESULT( unlink, err );
- diag_printf("<INFO>: unlink laalaa\n");
+ diag_printf("<INFO>: unlink laalaa\n");
err = unlink( "laalaa" );
if( err < 0 ) SHOW_RESULT( unlink, err );
- diag_printf("<INFO>: cd /\n");
+ diag_printf("<INFO>: cd /\n");
err = chdir( "/" );
if( err < 0 ) SHOW_RESULT( chdir, err );
checkcwd( "/" );
-
- diag_printf("<INFO>: umount /jffs2\n");
+
+ diag_printf("<INFO>: umount /jffs2\n");
err = umount( "/jffs2" );
- if( err < 0 ) SHOW_RESULT( umount, err );
-
- diag_printf("<INFO>: umount /\n");
+ if( err < 0 ) SHOW_RESULT( umount, err );
+
+ diag_printf("<INFO>: umount /\n");
err = umount( "/" );
- if( err < 0 ) SHOW_RESULT( umount, err );
-
+ if( err < 0 ) SHOW_RESULT( umount, err );
+
CYG_TEST_PASS_FINISH("jffs2_1");
}
Index: jffs2_2.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/ecos/tests/jffs2_2.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- jffs2_2.c 30 Jul 2005 15:25:46 -0000 1.2
+++ jffs2_2.c 7 Nov 2005 11:14:44 -0000 1.3
@@ -47,12 +47,12 @@
// Purpose: Test fseek on a filesystem
// Description: This test uses the ramfs to check out the fseek
// operation on a filesystem.
-//
-//
-//
-//
-//
-//
+//
+//
+//
+//
+//
+//
//
//####DESCRIPTIONEND####
//
@@ -88,17 +88,17 @@
FILE *stream;
long pos;
int i;
-
+
CYG_TEST_INIT();
// --------------------------------------------------------------
- CYG_TEST_INFO("mount /");
+ CYG_TEST_INFO("mount /");
err = mount( CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1, "/", "jffs2" );
- if( err < 0 ) SHOW_RESULT( mount, err );
-
- CYG_TEST_INFO("creating /fseek");
+ if( err < 0 ) SHOW_RESULT( mount, err );
+
+ CYG_TEST_INFO("creating /fseek");
stream = fopen("/fseek","w+");
if (!stream) {
diag_printf("FAIL: fopen() returned NULL, %s\n", strerror(errno));
@@ -109,26 +109,26 @@
for (i = 0; i < sizeof(buf); i++) {
buf[i] = i % 256;
}
-
- CYG_TEST_INFO("writing test pattern");
+
+ CYG_TEST_INFO("writing test pattern");
err=fwrite(buf,sizeof(buf), 1, stream);
if ( err < 0 ) SHOW_RESULT( fwrite, err );
-
+
/* The current position should be the same size as the buffer */
pos = ftell(stream);
-
+
if (pos < 0) SHOW_RESULT( ftell, pos );
if (pos != sizeof(buf))
diag_printf("<FAIL>: ftell is not telling the truth.");
-
- CYG_TEST_INFO("fseek()ing to beginning and writing");
+
+ CYG_TEST_INFO("fseek()ing to beginning and writing");
/* Seek back to the beginning of the file */
err = fseek(stream, 0, SEEK_SET);
if ( err < 0 ) SHOW_RESULT( fseek, err );
pos = ftell(stream);
-
+
if (pos < 0) SHOW_RESULT( ftell, pos );
if (pos != 0) CYG_TEST_FAIL("ftell is not telling the truth");
@@ -142,12 +142,12 @@
/* Check the pointer is at 4 */
pos = ftell(stream);
-
+
if (pos < 0) SHOW_RESULT( ftell, pos );
if (pos != 4) CYG_TEST_FAIL("ftell is not telling the truth");
CYG_TEST_INFO("closing file");
-
+
/* Close the file, open it up again and read it back */
err = fclose(stream);
if (err != 0) SHOW_RESULT( fclose, err );
@@ -160,12 +160,12 @@
err = fread(buf1,sizeof(buf1),1, stream);
if (err != 1) SHOW_RESULT( fread, err );
-
+
CYG_TEST_INFO("Comparing contents");
if (memcmp(buf, buf1, sizeof(buf1))) {
CYG_TEST_FAIL("File contents inconsistent");
}
-
+
CYG_TEST_INFO("closing file");
err = fclose(stream);
@@ -183,16 +183,16 @@
if ( err < 0 ) SHOW_RESULT( fseek, err );
pos = ftell(stream);
-
+
if (pos < 0) SHOW_RESULT( ftell, pos );
if (pos != (2*sizeof(buf))) CYG_TEST_FAIL("ftell is not telling the truth");
-
- CYG_TEST_INFO("writing test pattern");
+
+ CYG_TEST_INFO("writing test pattern");
err=fwrite(buf,sizeof(buf), 1, stream);
if ( err < 0 ) SHOW_RESULT( fwrite, err );
-
+
pos = ftell(stream);
-
+
if (pos < 0) SHOW_RESULT( ftell, pos );
if (pos != (3*sizeof(buf))) CYG_TEST_FAIL("ftell is not telling the truth");
@@ -205,10 +205,10 @@
if (!stream) {
diag_printf("<FAIL>: fopen() returned NULL, %s\n", strerror(errno));
}
-
+
err = fread(buf1,sizeof(buf1),1, stream);
if (err != 1) SHOW_RESULT( fread, err );
-
+
CYG_TEST_INFO("Comparing contents");
if (memcmp(buf, buf1, sizeof(buf1))) {
CYG_TEST_FAIL("File contents inconsistent");
@@ -216,15 +216,15 @@
err = fread(buf1,sizeof(buf1),1, stream);
if (err != 1) SHOW_RESULT( fread, err );
-
+
for (i = 0; i< sizeof(buf); i++) {
if (buf1[i] != 0)
CYG_TEST_FAIL("Hole does not contain zeros");
}
-
+
err = fread(buf1,sizeof(buf1),1, stream);
if (err != 1) SHOW_RESULT( fread, err );
-
+
if (memcmp(buf, buf1, sizeof(buf1))) {
CYG_TEST_FAIL("File contents inconsistent");
}
@@ -234,10 +234,10 @@
/* Close the file */
err = fclose(stream);
if (err != 0) SHOW_RESULT( fclose, err );
-
- CYG_TEST_INFO("umount /");
+
+ CYG_TEST_INFO("umount /");
err = umount( "/" );
- if( err < 0 ) SHOW_RESULT( umount, err );
-
+ if( err < 0 ) SHOW_RESULT( umount, err );
+
CYG_TEST_PASS_FINISH("jffs2_2");
}
Index: jffs2_3.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/ecos/tests/jffs2_3.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- jffs2_3.c 30 Jul 2005 15:25:46 -0000 1.2
+++ jffs2_3.c 7 Nov 2005 11:14:44 -0000 1.3
@@ -44,7 +44,7 @@
// Purpose: Test garbage collect on a filesystem
// Description: This test creates and deletes files in order
// to test the garbage collection code.
-//
+//
//####DESCRIPTIONEND####
//
//==========================================================================
@@ -80,22 +80,22 @@
char name[16];
cyg_uint32 j;
int fd, err;
-
+
sprintf(name,"test%07d",i);
fd = creat(name, S_IRWXU);
if (fd == -1) SHOW_RESULT( creat, fd );
-
+
for (j=1; j < NELEM(buffer); j++) {
buffer[j] = rand();
}
-
+
buffer[0] = 0;
buffer[0] = cyg_posix_crc32((unsigned char *)buffer, sizeof(buffer));
-
+
err = write(fd, buffer, sizeof(buffer));
if (err == -1) SHOW_RESULT( write, err );
-
+
err = close(fd);
if (err == -1) SHOW_RESULT( close, err );
}
@@ -104,7 +104,7 @@
{
char name[16];
int err;
-
+
sprintf(name,"test%07d",i);
err = unlink(name);
@@ -117,18 +117,18 @@
int err, fd;
cyg_int32 buffer[1020];
cyg_uint32 crc;
-
+
sprintf(name,"test%07d",i);
fd = open(name, O_RDONLY);
if (fd == -1) SHOW_RESULT( open, fd );
-
+
err = read(fd, buffer, sizeof(buffer));
if (err == -1) SHOW_RESULT( read, fd );
-
+
crc = buffer[0];
buffer[0] = 0;
-
+
if (crc != cyg_posix_crc32((unsigned char *)buffer, sizeof(buffer))) {
CYG_TEST_FAIL("File corrupt");
}
@@ -150,18 +150,18 @@
// --------------------------------------------------------------
- CYG_TEST_INFO("mount /");
+ CYG_TEST_INFO("mount /");
err = mount( CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1, "/", "jffs2" );
- if( err < 0 ) SHOW_RESULT( mount, err );
-
+ if( err < 0 ) SHOW_RESULT( mount, err );
+
chdir ("/");
-
+
iteration=0;
create_file(iteration);
while (iteration < ITERATIONS) {
if (!(iteration % 1000)) {
minfo = mallinfo();
- diag_printf("<INFO> Iteration %07d fordblks = %7d\n",
+ diag_printf("<INFO> Iteration %07d fordblks = %7d\n",
iteration, minfo.fordblks);
}
iteration++;
@@ -170,10 +170,10 @@
delete_file(iteration-1);
check_file(iteration);
}
-
+
CYG_TEST_INFO("umount /");
err = umount( "/" );
- if( err < 0 ) SHOW_RESULT( umount, err );
-
+ if( err < 0 ) SHOW_RESULT( umount, err );
+
CYG_TEST_PASS_FINISH("jffs2_3");
}
- Previous message: mtd/Documentation/jffs3 Makefile,1.2,1.3
- Next message: mtd/boot Makefile, 1.4, 1.5 local.h, 1.1, 1.2 main.c, 1.1,
1.2 makerom.c, 1.1, 1.2 misc.c, 1.1, 1.2 sbc_gxx_boot.c, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the linux-mtd-cvs
mailing list