Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Jul 2009 19:22:46 GMT
From:      Sylvestre Gallon <syl@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 165652 for review
Message-ID:  <200907051922.n65JMk1E010805@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=165652

Change 165652 by syl@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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907051922.n65JMk1E010805>