-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stuck #9
base: master
Are you sure you want to change the base?
Stuck #9
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
#define EXIT_FAIL_OTHERTEST 0x04 | ||
|
||
struct test tests[] = { | ||
{ "Stuck Address", test_stuck_address }, | ||
{ "Random Value", test_random_value }, | ||
{ "Compare XOR", test_xor_comparison }, | ||
{ "Compare SUB", test_sub_comparison }, | ||
|
@@ -103,13 +104,13 @@ off_t physaddrbase = 0; | |
/* Function definitions */ | ||
void usage(char *me) { | ||
fprintf(stderr, "\n" | ||
"Usage: %s [-p physaddrbase [-d device] [-u]] <mem>[B|K|M|G] [loops]\n", | ||
"Usage: [MEMTESTER_TEST_MASK=0x<mask>] %s [-p physaddrbase [-d device] [-u]] <mem>[B|K|M|G] [loops]\n", | ||
me); | ||
exit(EXIT_FAIL_NONSTARTER); | ||
} | ||
|
||
int main(int argc, char **argv) { | ||
ul loops, loop, i; | ||
ul loops, loop, i, errorcnt = 0; | ||
size_t pagesize, wantraw, wantmb, wantbytes, wantbytes_orig, bufsize, | ||
halflen, count; | ||
char *memsuffix, *addrsuffix, *loopsuffix; | ||
|
@@ -198,8 +199,8 @@ int main(int argc, char **argv) { | |
} | ||
break; | ||
case 'u': | ||
o_flags &= ~O_SYNC; | ||
break; | ||
o_flags &= ~O_SYNC; | ||
break; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are mixing changes for different purposes here. Is it your editor changing the indentation? |
||
default: /* '?' */ | ||
usage(argv[0]); /* doesn't return */ | ||
} | ||
|
@@ -390,13 +391,7 @@ int main(int argc, char **argv) { | |
printf("/%lu", loops); | ||
} | ||
printf(":\n"); | ||
printf(" %-20s: ", "Stuck Address"); | ||
fflush(stdout); | ||
if (!test_stuck_address(aligned, bufsize / sizeof(ul))) { | ||
printf("ok\n"); | ||
} else { | ||
exit_code |= EXIT_FAIL_ADDRESSLINES; | ||
} | ||
printf("total errors = %lu\n", errorcnt); | ||
for (i=0;;i++) { | ||
if (!tests[i].name) break; | ||
/* If using a custom testmask, only run this test if the | ||
|
@@ -411,6 +406,7 @@ int main(int argc, char **argv) { | |
printf("ok\n"); | ||
} else { | ||
exit_code |= EXIT_FAIL_OTHERTEST; | ||
errorcnt++; | ||
} | ||
fflush(stdout); | ||
/* clear buffer */ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ int compare_regions(ulv *bufa, ulv *bufb, size_t count) { | |
return r; | ||
} | ||
|
||
int test_stuck_address(ulv *bufa, size_t count) { | ||
int test_stuck_address(ulv *bufa, ulv *bufb, size_t count) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bufb is not used; then add a "(void)bufb;" line to muffle the compiler. |
||
ulv *p1 = bufa; | ||
unsigned int j; | ||
size_t i; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you add Stuck Address at the end of the array instead of shift the indices of the other tests in the testmask?