c - Walkpat内存测试

标签 c testing ram

有人知道有什么好的资源可以用来学习 RAM 上的 walkpat 内存测试吗?如果你能提供伪代码或 C 代码那就更好了。提前致谢!

最佳答案

volatile int *ptr;  // volatile because the compiler would otherwise outsmart you and not actually read the memory

for(ptr=0; ptr<SIZE; ptr++) {
    int test = 1;
    do {
        *ptr = test;
        if( *ptr != test ) FAIL();
        test <<= 1;        // walk that 1 through the word, until it falls off the end.
    } while(test);
}

关于c - Walkpat内存测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17339058/

相关文章:

以编程方式创建新用户

c - 引用 char 数组时出现段错误

javascript - 如何监视 JavaScript 中的递归函数

MySQL 文本字段和内存使用

C 保证重新 : Pointers to Void and Character Types, 类型转换

c - 我的链接列表中的名称计数函数有什么问题?

java - JUnit 5 中的 @TestInstance 注释有什么用?

testing - 将 revel 测试组织成子包

interrupt - 在不中断 UART 的情况下写入非 volatile 存储器会中断 STM32F4XX 上的执行

Node.js 使用 fs.readFileSync 读取大文件