- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / nacl / pnacl_dyncode_syscall_disabled / pnacl_dyncode_syscall_disabled.cc
1 // Copyright (c) 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 <nacl/nacl_dyncode.h>
7 #include <stdio.h>
8 #include <string.h>
9 #include <unistd.h>
10
11
12 #include "native_client/src/shared/platform/nacl_check.h"
13 #include "ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h"
14 #include "ppapi/native_client/tests/ppapi_test_lib/test_interface.h"
15
16 namespace {
17
18 void TestDyncodeCreate(void) {
19   EXPECT(nacl_dyncode_create(NULL, NULL, 0) == -1);
20   EXPECT(errno == ENOSYS);
21
22   TEST_PASSED;
23 }
24
25 void TestDyncodeModify(void) {
26   EXPECT(nacl_dyncode_modify(NULL, NULL, 0) == -1);
27   EXPECT(errno == ENOSYS);
28
29   TEST_PASSED;
30 }
31
32 void TestDyncodeDelete(void) {
33   EXPECT(nacl_dyncode_delete(NULL, 0) == -1);
34   EXPECT(errno == ENOSYS);
35
36   TEST_PASSED;
37 }
38
39 }  // namespace
40
41 void SetupTests() {
42   RegisterTest("TestDyncodeCreate", TestDyncodeCreate);
43   RegisterTest("TestDyncodeModify", TestDyncodeModify);
44   RegisterTest("TestDyncodeDelete", TestDyncodeDelete);
45 }
46
47 void SetupPluginInterfaces() {
48   // none
49 }