PERFORCE change 165652 for review

Sylvestre Gallon syl at FreeBSD.org
Sun Jul 5 19:22:47 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=165652

Change 165652 by syl at syl_atuin on 2009/07/05 19:22:31

	Update test3 to show how many mb have been written.

Affected files ...

.. //depot/projects/soc2009/syl_usb/libusb-tests/transfers/test3/test3.c#8 edit

Differences ...

==== //depot/projects/soc2009/syl_usb/libusb-tests/transfers/test3/test3.c#8 (text+ko) ====

@@ -97,12 +97,6 @@
 		}
 
 	}
-
-	if (csw.bCSWStatus != 0) {
-		printf("command (0x%02x) cursig=0x%08x failed\n", pcmd[0], cursig);
-	} else {
-		printf("command (0x%02x) cursig=0x%08x success\n", pcmd[0], cursig);
-	}
 }
 
 void
@@ -133,6 +127,7 @@
 	int found = 0;
 	int ret;
 	int i;
+	int j;
 
 	printf("this test read bytes of a memory stick\n");
 	if (libusb_init(&ctx) != 0) {
@@ -190,11 +185,25 @@
 	do_msc_req(read_capacity, sizeof(read_capacity), 0x8);
 
 	sranddev();
+	j = 0;
+	printf("%iM", j);
 	for (size = 0 ;  ;) {
 		random = rand() % 1024;
 		do_read(random, 0x10000);
 		size+=0x10000;
-		printf("read sector : 0x%x total read 0x%x\n", random, size);
+		if ((size % 0x100000) == 0) {
+			j++;
+			if (j < 10)
+				printf("\b\b%i", j);
+			else if (j < 100)
+				printf("\b\b\b%i", j);
+			else
+				printf("\b\b\b\b%i", j);
+			if (j==10 || j == 100)
+				printf("M");
+			fflush(stdout);
+		}
 	}
+	printf("\n");
 	return (EXIT_SUCCESS);
 }


More information about the p4-projects mailing list