Skip to content

page-shuffle <test> #23

@SangChunn

Description

@SangChunn
#define SIZE (128 * 1024)

static char buf[SIZE];

void
test_main (void)
{
  size_t i;

  /* Initialize. */
  for (i = 0; i < sizeof buf; i++)
    buf[i] = i * 257;
  msg ("init: cksum=%lu", cksum (buf, sizeof buf));
    
  /* Shuffle repeatedly. */
  for (i = 0; i < 10; i++)
    {
      shuffle (buf, sizeof buf, 1);
      msg ("shuffle %zu: cksum=%lu", i, cksum (buf, sizeof buf));
    }
}
  • 128KB 버퍼를 초기화하고 10번 섞어보면서 메모리가 정상적으로 읽히고 쓰이는지 확인하는 메모리 스트레스 테스트
  • 각 단계마다 checksum을 출력해 데이터가 정상인지 검증

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Test

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions