Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Unified Diff: vm/os_test.cc

Issue 10696165: Don't allow OS::SNPrint or OS::VSNPrint to return negative values. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/os_macos.cc ('k') | vm/os_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/os_test.cc
===================================================================
--- vm/os_test.cc (revision 9556)
+++ vm/os_test.cc (working copy)
@@ -38,6 +38,14 @@
}
+// This test is expected to crash when it runs.
+UNIT_TEST_CASE(SNPrint_BadArgs) {
+ int width = kMaxInt32;
+ int num = 7;
+ OS::SNPrint(NULL, 0, "%*d%*d", width, num, width, num);
+}
+
+
UNIT_TEST_CASE(OsFuncs) {
EXPECT(Utils::IsPowerOfTwo(OS::ActivationFrameAlignment()));
EXPECT(Utils::IsPowerOfTwo(OS::PreferredCodeAlignment()));
« no previous file with comments | « vm/os_macos.cc ('k') | vm/os_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698