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

Side by Side Diff: tests/tpm_lite/spaceperm.c

Issue 3551014: Fix build broken by assert() expanding to nothing. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: . Created 10 years, 2 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
« no previous file with comments | « firmware/version.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 /* Test of space permissions retrieval. 6 /* Test of space permissions retrieval.
7 */ 7 */
8 8
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
11 #include <stdlib.h> 11 #include <stdlib.h>
12 12
13 #include "tlcl.h" 13 #include "tlcl.h"
14 #include "tlcl_tests.h" 14 #include "tlcl_tests.h"
15 #include "utility.h" 15 #include "utility.h"
16 16
17 #define PERMPPGL (TPM_NV_PER_PPWRITE | TPM_NV_PER_GLOBALLOCK)
18 #define PERMPP TPM_NV_PER_PPWRITE
19
17 int main(int argc, char** argv) { 20 int main(int argc, char** argv) {
18 uint32_t perm; 21 uint32_t perm;
19 uint32_t perm_pp_gl = TPM_NV_PER_PPWRITE | TPM_NV_PER_GLOBALLOCK;
20 uint32_t perm_pp = TPM_NV_PER_PPWRITE;
21 22
22 TlclLibInit(); 23 TlclLibInit();
23 TPM_CHECK(TlclStartupIfNeeded()); 24 TPM_CHECK(TlclStartupIfNeeded());
24 TPM_CHECK(TlclContinueSelfTest()); 25 TPM_CHECK(TlclContinueSelfTest());
25 TPM_CHECK(TlclAssertPhysicalPresence()); 26 TPM_CHECK(TlclAssertPhysicalPresence());
26 27
27 TPM_CHECK(TlclGetPermissions(INDEX0, &perm)); 28 TPM_CHECK(TlclGetPermissions(INDEX0, &perm));
28 assert((perm & perm_pp_gl) == perm_pp_gl); 29 assert((perm & PERMPPGL) == PERMPPGL);
29 30
30 TPM_CHECK(TlclGetPermissions(INDEX1, &perm)); 31 TPM_CHECK(TlclGetPermissions(INDEX1, &perm));
31 assert((perm & perm_pp) == perm_pp); 32 assert((perm & PERMPP) == PERMPP);
32 33
33 printf("TEST SUCCEEDED\n"); 34 printf("TEST SUCCEEDED\n");
34 exit(0); 35 exit(0);
35 } 36 }
OLDNEW
« no previous file with comments | « firmware/version.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698