diff options
author | jvoung@google.com <jvoung@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 23:40:30 +0000 |
---|---|---|
committer | jvoung@google.com <jvoung@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 23:40:30 +0000 |
commit | ad938578ef158f52490ddc978579b7986753eda0 (patch) | |
tree | f0a5e952fe2554e3bd1f055524b4130252eb38ae | |
parent | f49a0c88d5579bcd9a3d20668dcba469ceb90a55 (diff) | |
download | chromium_src-ad938578ef158f52490ddc978579b7986753eda0.zip chromium_src-ad938578ef158f52490ddc978579b7986753eda0.tar.gz chromium_src-ad938578ef158f52490ddc978579b7986753eda0.tar.bz2 |
Remove debug fprintfs which don't compile on waterfall. Add missing header.
Review URL: http://codereview.chromium.org/2870055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52574 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/test/nacl_security_tests/commands_posix.cc | 11 | ||||
-rw-r--r-- | chrome/test/nacl_security_tests/nacl_security_tests_win.cc | 11 |
2 files changed, 3 insertions, 19 deletions
diff --git a/chrome/test/nacl_security_tests/commands_posix.cc b/chrome/test/nacl_security_tests/commands_posix.cc index 85196e3..013043e 100644 --- a/chrome/test/nacl_security_tests/commands_posix.cc +++ b/chrome/test/nacl_security_tests/commands_posix.cc @@ -2,10 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "./commands_posix.h" +#include "chrome/test/nacl_security_tests/commands_posix.h" #include <fcntl.h> #include <netdb.h> +#include <stdio.h> +#include <string.h> #include <sys/socket.h> #include <sys/types.h> #include <sys/wait.h> @@ -22,7 +24,6 @@ SboxTestResult TestOpenReadFile(const char *path) { if (-1 == fd) { return SBOX_TEST_DENIED; } else { - fprintf(stderr, "OOPS: Opened file for read %s %d\n", path, fd); close(fd); return SBOX_TEST_SUCCEEDED; } @@ -33,7 +34,6 @@ SboxTestResult TestOpenWriteFile(const char *path) { if (-1 == fd) { return SBOX_TEST_DENIED; } else { - fprintf(stderr, "OOPS: Opened file for write %s %d\n", path, fd); close(fd); return SBOX_TEST_SUCCEEDED; } @@ -54,7 +54,6 @@ SboxTestResult TestCreateProcess(const char *path) { } return SBOX_TEST_SUCCEEDED; } else if (0 < pid) { - fprintf(stderr, "PARENT: Oops, forked child!\n"); waitpid(pid, &child_stat, WNOHANG); return SBOX_TEST_SUCCEEDED; } else { @@ -72,7 +71,6 @@ SboxTestResult TestConnect(const char *url) { hints.ai_socktype = SOCK_STREAM; rv = getaddrinfo(url, "http", &hints, &servinfo); if (0 != rv) { - fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv)); return SBOX_TEST_DENIED; } @@ -82,7 +80,6 @@ SboxTestResult TestConnect(const char *url) { if (-1 == conn_sock) { perror("socket"); freeaddrinfo(servinfo); - fprintf(stderr, "Error at socket()\n"); return SBOX_TEST_DENIED; } @@ -92,7 +89,6 @@ SboxTestResult TestConnect(const char *url) { return SBOX_TEST_DENIED; } - fprintf(stderr, "Connected to server.\n"); shutdown(conn_sock, SHUT_RDWR); close(conn_sock); freeaddrinfo(servinfo); @@ -105,7 +101,6 @@ SboxTestResult TestConnect(const char *url) { // context-independent, yet leave no traces). SboxTestResult TestDummyFails() { - fprintf(stderr, "Running dummy sandbox test, which should fail\n"); return SBOX_TEST_SUCCEEDED; } diff --git a/chrome/test/nacl_security_tests/nacl_security_tests_win.cc b/chrome/test/nacl_security_tests/nacl_security_tests_win.cc index e95e17f..15f00a2 100644 --- a/chrome/test/nacl_security_tests/nacl_security_tests_win.cc +++ b/chrome/test/nacl_security_tests/nacl_security_tests_win.cc @@ -40,15 +40,11 @@ SboxTestResult TestCreateProcess(const wchar_t *path_str, wchar_t *cmd_str) { if (!::CreateProcess(path_str, cmd_str, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { if (ERROR_ACCESS_DENIED == ::GetLastError()) { - fprintf(stderr, "Create process denied\n"); return SBOX_TEST_DENIED; } else { - fprintf(stderr, "Created process denied for misc reason: %ld\n", - ::GetLastError()); return SBOX_TEST_DENIED; } } else { - fprintf(stderr, "Created process\n"); return SBOX_TEST_SUCCEEDED; } } @@ -56,9 +52,6 @@ SboxTestResult TestCreateProcess(const wchar_t *path_str, wchar_t *cmd_str) { SboxTestResult TestConnect(const char* url) { WSADATA wsaData; int iResult = WSAStartup(MAKEWORD(2, 2), &wsaData); - if (NO_ERROR != iResult) { - fprintf(stderr, "Error at WSAStartup()\n"); - } struct addrinfo hints, *servinfo, *p; DWORD dwRet; @@ -69,7 +62,6 @@ SboxTestResult TestConnect(const char* url) { dwRet = getaddrinfo(url, "80", &hints, &servinfo); if (0 != dwRet) { - fprintf(stderr, "getaddrinfo failed with %d\n", dwRet); WSACleanup(); return SBOX_TEST_DENIED; } @@ -79,7 +71,6 @@ SboxTestResult TestConnect(const char* url) { SOCKET sock; sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol); if (INVALID_SOCKET == sock) { - fprintf(stderr, "Error at socket(): %ld\n", WSAGetLastError()); freeaddrinfo(servinfo); WSACleanup(); return SBOX_TEST_DENIED; @@ -87,14 +78,12 @@ SboxTestResult TestConnect(const char* url) { if (SOCKET_ERROR == connect(sock, p->ai_addr, static_cast<int>(p->ai_addrlen))) { - fprintf(stderr, "Failed to connect\n"); freeaddrinfo(servinfo); closesocket(sock); WSACleanup(); return SBOX_TEST_DENIED; } - fprintf(stderr, "OOPS: Connected to server.\n"); freeaddrinfo(servinfo); closesocket(sock); WSACleanup(); |