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

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

Issue 6893071: Fix missing break in switch statement. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git@master
Patch Set: fix Created 9 years, 7 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 | « no previous file | 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 recovery when we hit the NVRAM write limit for an unowned TPM. 6 /* Test of recovery when we hit the NVRAM write limit for an unowned TPM.
7 */ 7 */
8 8
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 18 matching lines...) Expand all
29 TPM_CHECK(TlclForceClear()); 29 TPM_CHECK(TlclForceClear());
30 TPM_CHECK(TlclSetEnable()); 30 TPM_CHECK(TlclSetEnable());
31 TPM_CHECK(TlclSetDeactivated(0)); 31 TPM_CHECK(TlclSetDeactivated(0));
32 32
33 for (i = 0; i < TPM_MAX_NV_WRITES_NOOWNER + 2; i++) { 33 for (i = 0; i < TPM_MAX_NV_WRITES_NOOWNER + 2; i++) {
34 printf("writing %d\n", i); 34 printf("writing %d\n", i);
35 if ((result = TlclWrite(INDEX0, (uint8_t*)&i, sizeof(i))) != TPM_SUCCESS) { 35 if ((result = TlclWrite(INDEX0, (uint8_t*)&i, sizeof(i))) != TPM_SUCCESS) {
36 switch (result) { 36 switch (result) {
37 case TPM_E_MAXNVWRITES: 37 case TPM_E_MAXNVWRITES:
38 assert(i >= TPM_MAX_NV_WRITES_NOOWNER); 38 assert(i >= TPM_MAX_NV_WRITES_NOOWNER);
39 break;
39 default: 40 default:
40 error("unexpected error code %d (0x%x)\n", result, result); 41 error("unexpected error code %d (0x%x)\n", result, result);
41 } 42 }
42 } 43 }
43 } 44 }
44 45
45 /* Reset write count */ 46 /* Reset write count */
46 TPM_CHECK(TlclForceClear()); 47 TPM_CHECK(TlclForceClear());
47 TPM_CHECK(TlclSetEnable()); 48 TPM_CHECK(TlclSetEnable());
48 TPM_CHECK(TlclSetDeactivated(0)); 49 TPM_CHECK(TlclSetDeactivated(0));
49 50
50 /* Try writing again. */ 51 /* Try writing again. */
51 TPM_CHECK(TlclWrite(INDEX0, (uint8_t*)&i, sizeof(i))); 52 TPM_CHECK(TlclWrite(INDEX0, (uint8_t*)&i, sizeof(i)));
52 53
53 printf("TEST SUCCEEDED\n"); 54 printf("TEST SUCCEEDED\n");
54 exit(0); 55 exit(0);
55 } 56 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698