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

Unified Diff: native_client_sdk/src/tests/nacl_io_test/signal_test.cc

Issue 23005005: [NaCl SDK] nacl_io: Add initial implementations of kill and signal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 4 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
Index: native_client_sdk/src/tests/nacl_io_test/signal_test.cc
diff --git a/native_client_sdk/src/tests/nacl_io_test/signal_test.cc b/native_client_sdk/src/tests/nacl_io_test/signal_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..856e2505a83ad76bcc77524fcd385e98a15202ef
--- /dev/null
+++ b/native_client_sdk/src/tests/nacl_io_test/signal_test.cc
@@ -0,0 +1,28 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+#include "nacl_io/kernel_intercept.h"
+#include "nacl_io/kernel_proxy.h"
+
+TEST(Signal, KillSignals) {
+ EXPECT_LT(ki_kill(123, NULL, &len), 0);
+ EXPECT_EQ(errno, EFAULT);
+ EXPECT_EQ(errno, 0x2211);
+}
+
+TEST(Siganl, Ntohl) {
+ uint8_t network_bytes[4] = { 0x44, 0x33, 0x22, 0x11 };
+ uint32_t network_long;
+ memcpy(&network_long, network_bytes, 4);
+ uint32_t host_long = ntohl(network_long);
+ EXPECT_EQ(host_long, 0x44332211);
+}

Powered by Google App Engine
This is Rietveld 408576698