[uClibc-cvs] CVS uClibc++/tests

CVS User gkajmowi gkajmowi at codepoet.org
Tue Jan 18 00:06:31 UTC 2005


Update of /var/cvs/uClibc++/tests
In directory nail:/tmp/cvs-serv7130/tests

Modified Files:
	Makefile fstreamtest.cpp 
Log Message:
Extending fstream tests

--- /var/cvs/uClibc++/tests/Makefile	2005/01/12 05:20:33	1.13
+++ /var/cvs/uClibc++/tests/Makefile	2005/01/18 00:06:30	1.14
@@ -129,6 +129,7 @@
 clean:	cleanobjs cleanbin
 	$(MAKE) -C testoutput clean
 	rm -f fstreamtest.out
+	rm -f fstreamtest2.out
 
 cleanall:	cleanobjs cleanbin
 
--- /var/cvs/uClibc++/tests/fstreamtest.cpp	2005/01/08 17:49:55	1.3
+++ /var/cvs/uClibc++/tests/fstreamtest.cpp	2005/01/18 00:06:30	1.4
@@ -26,6 +26,54 @@
 		}
 	}
 	inFile.close();
+
+	outFile.open("fstreamtest2.out", std::ios::out);
+	outFile.write("abcd", 4);
+	outFile.put('e');
+	outFile.write("fghi", 4);
+	outFile.close();
+
+	inFile.open("fstreamtest2.out", std::ios::in | std::ios::binary);
+
+	inFile >> a;
+	if (a != 'a'){
+		std::cout << "Error reading character a, was instead: " << a << std::endl;
+	}
+	inFile >> a;
+	if (a != 'b'){
+		std::cout << "Error reading character b, was instead: " << a << std::endl;
+	}
+	inFile >> a;
+	if (a != 'c'){
+		std::cout << "Error reading character c, was instead: " << a << std::endl;
+	}
+	inFile >> a;
+	if (a != 'd'){
+		std::cout << "Error reading character d, was instead: " << a << std::endl;
+	}
+	inFile >> a;
+	if (a != 'e'){
+		std::cout << "Error reading character e, was instead: " << a << std::endl;
+	}
+	inFile >> a;
+	if (a != 'f'){
+		std::cout << "Error reading character f, was instead: " << a << std::endl;
+	}
+	inFile >> a;
+	if (a != 'g'){
+		std::cout << "Error reading character g, was instead: " << a << std::endl;
+	}
+	inFile >> a;
+	if (a != 'h'){
+		std::cout << "Error reading character h, was instead: " << a << std::endl;
+	}
+	inFile >> a;
+	if (a != 'i'){
+		std::cout << "Error reading character i, was instead: " << a << std::endl;
+	}
+	inFile.close();
+
+
 	return 0;
 }
 



More information about the uClibc-cvs mailing list