OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008, Google Inc. | 2 * Copyright 2008, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 NaClLogSetVerbosity((NULL == nacl_verbosity) | 102 NaClLogSetVerbosity((NULL == nacl_verbosity) |
103 ? 0 | 103 ? 0 |
104 : strtol(nacl_verbosity, (char **) 0, 0)); | 104 : strtol(nacl_verbosity, (char **) 0, 0)); |
105 | 105 |
106 errcode = GioMemoryFileSnapshotCtor(&gf, nacl_file); | 106 errcode = GioMemoryFileSnapshotCtor(&gf, nacl_file); |
107 ASSERT_NE(errcode, 0); | 107 ASSERT_NE(errcode, 0); |
108 errcode = NaClAppCtor(&state); | 108 errcode = NaClAppCtor(&state); |
109 ASSERT_NE(errcode, 0); | 109 ASSERT_NE(errcode, 0); |
110 errcode = NaClAppLoadFile((struct Gio *) &gf, | 110 errcode = NaClAppLoadFile((struct Gio *) &gf, |
111 &state, | 111 &state, |
112 NACL_ABI_MISMATCH_OPTION_ABORT); | 112 NACL_ABI_CHECK_OPTION_CHECK); |
113 ASSERT_EQ(errcode, 0); | 113 ASSERT_EQ(errcode, 0); |
114 | 114 |
115 InitThread(&state, natp); | 115 InitThread(&state, natp); |
116 | 116 |
117 /* Allocate range */ | 117 /* Allocate range */ |
118 addr = NaClSysMmap(natp, 0, 3 * NACL_MAP_PAGESIZE, | 118 addr = NaClSysMmap(natp, 0, 3 * NACL_MAP_PAGESIZE, |
119 NACL_ABI_PROT_READ | NACL_ABI_PROT_WRITE, | 119 NACL_ABI_PROT_READ | NACL_ABI_PROT_WRITE, |
120 NACL_ABI_MAP_ANONYMOUS | NACL_ABI_MAP_PRIVATE, | 120 NACL_ABI_MAP_ANONYMOUS | NACL_ABI_MAP_PRIVATE, |
121 -1, 0); | 121 -1, 0); |
122 printf("addr=0x%"PRIxPTR"\n", addr); | 122 printf("addr=0x%"PRIxPTR"\n", addr); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 NACL_ABI_PROT_READ | NACL_ABI_PROT_WRITE, | 237 NACL_ABI_PROT_READ | NACL_ABI_PROT_WRITE, |
238 NACL_ABI_MAP_ANONYMOUS | NACL_ABI_MAP_PRIVATE, -1, 0); | 238 NACL_ABI_MAP_ANONYMOUS | NACL_ABI_MAP_PRIVATE, -1, 0); |
239 ASSERT_EQ((int) addr, -NACL_ABI_EINVAL); | 239 ASSERT_EQ((int) addr, -NACL_ABI_EINVAL); |
240 | 240 |
241 errcode = NaClSysMunmap(natp, (void *) initial_addr, 0); | 241 errcode = NaClSysMunmap(natp, (void *) initial_addr, 0); |
242 ASSERT_EQ(errcode, -NACL_ABI_EINVAL); | 242 ASSERT_EQ(errcode, -NACL_ABI_EINVAL); |
243 | 243 |
244 printf("PASS\n"); | 244 printf("PASS\n"); |
245 return 0; | 245 return 0; |
246 } | 246 } |
OLD | NEW |