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

Side by Side Diff: crosstest/test_global_main.cpp

Issue 415803004: Fix a counter in the test_global crosstest. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 5 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
« 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 /* crosstest.py --test=test_global.cpp \ 1 /* crosstest.py --test=test_global.cpp \
2 --driver=test_global_main.cpp --prefix=Subzero_ --output=test_global */ 2 --driver=test_global_main.cpp --prefix=Subzero_ --output=test_global */
3 3
4 #include <stdint.h> 4 #include <stdint.h>
5 #include <cstdlib> 5 #include <cstdlib>
6 #include <iostream> 6 #include <iostream>
7 7
8 #include "test_global.h" 8 #include "test_global.h"
9 namespace Subzero_ { 9 namespace Subzero_ {
10 #include "test_global.h" 10 #include "test_global.h"
11 } 11 }
12 12
13 int main(int argc, char **argv) { 13 int main(int argc, char **argv) {
14 size_t TotalTests = 0; 14 size_t TotalTests = 0;
15 size_t Passes = 0; 15 size_t Passes = 0;
16 size_t Failures = 0; 16 size_t Failures = 0;
17 17
18 const uint8_t *SzArray, *LlcArray; 18 const uint8_t *SzArray, *LlcArray;
19 size_t SzArrayLen, LlcArrayLen; 19 size_t SzArrayLen, LlcArrayLen;
20 20
21 size_t NumArrays = getNumArrays(); 21 size_t NumArrays = getNumArrays();
22 for (size_t i = 0; i < NumArrays; ++i) { 22 for (size_t i = 0; i < NumArrays; ++i) {
23 LlcArrayLen = -1; 23 LlcArrayLen = -1;
24 SzArrayLen = -2; 24 SzArrayLen = -2;
25 LlcArray = getArray(i, LlcArrayLen); 25 LlcArray = getArray(i, LlcArrayLen);
26 SzArray = Subzero_::getArray(i, SzArrayLen); 26 SzArray = Subzero_::getArray(i, SzArrayLen);
27 ++TotalTests;
27 if (LlcArrayLen == SzArrayLen) { 28 if (LlcArrayLen == SzArrayLen) {
28 ++Passes; 29 ++Passes;
29 } else { 30 } else {
30 std::cout << i << ":LlcArrayLen=" << LlcArrayLen 31 std::cout << i << ":LlcArrayLen=" << LlcArrayLen
31 << ", SzArrayLen=" << SzArrayLen << std::endl; 32 << ", SzArrayLen=" << SzArrayLen << std::endl;
32 ++Failures; 33 ++Failures;
33 } 34 }
34 35
35 for (size_t i = 0; i < LlcArrayLen; ++i) { 36 for (size_t i = 0; i < LlcArrayLen; ++i) {
37 ++TotalTests;
36 if (LlcArray[i] == SzArray[i]) { 38 if (LlcArray[i] == SzArray[i]) {
37 ++Passes; 39 ++Passes;
38 } else { 40 } else {
39 ++Failures; 41 ++Failures;
40 std::cout << i << ":LlcArray[" << i << "] = " << (int)LlcArray[i] 42 std::cout << i << ":LlcArray[" << i << "] = " << (int)LlcArray[i]
41 << ", SzArray[" << i << "] = " << (int)SzArray[i] 43 << ", SzArray[" << i << "] = " << (int)SzArray[i]
42 << std::endl; 44 << std::endl;
43 } 45 }
44 } 46 }
45 } 47 }
46 48
47 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes 49 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes
48 << " Failures=" << Failures << "\n"; 50 << " Failures=" << Failures << "\n";
49 return Failures; 51 return Failures;
50 } 52 }
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