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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <errno.h>
6 #include <fcntl.h>
7 #include <sys/types.h>
8 #include <sys/socket.h>
9
10 #include "gmock/gmock.h"
11 #include "gtest/gtest.h"
12
13 #include "nacl_io/kernel_intercept.h"
14 #include "nacl_io/kernel_proxy.h"
15
16 TEST(Signal, KillSignals) {
17 EXPECT_LT(ki_kill(123, NULL, &len), 0);
18 EXPECT_EQ(errno, EFAULT);
19 EXPECT_EQ(errno, 0x2211);
20 }
21
22 TEST(Siganl, Ntohl) {
23 uint8_t network_bytes[4] = { 0x44, 0x33, 0x22, 0x11 };
24 uint32_t network_long;
25 memcpy(&network_long, network_bytes, 4);
26 uint32_t host_long = ntohl(network_long);
27 EXPECT_EQ(host_long, 0x44332211);
28 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698