Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / native_client_sdk / src / tests / nacl_io_test / signal_test.cc
blob856e2505a83ad76bcc77524fcd385e98a15202ef
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.
5 #include <errno.h>
6 #include <fcntl.h>
7 #include <sys/types.h>
8 #include <sys/socket.h>
10 #include "gmock/gmock.h"
11 #include "gtest/gtest.h"
13 #include "nacl_io/kernel_intercept.h"
14 #include "nacl_io/kernel_proxy.h"
16 TEST(Signal, KillSignals) {
17 EXPECT_LT(ki_kill(123, NULL, &len), 0);
18 EXPECT_EQ(errno, EFAULT);
19 EXPECT_EQ(errno, 0x2211);
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);