[all-commits] [llvm/llvm-project] bb4f88: [libc] simplify test for getrandom

Guillaume Chatelet via All-commits all-commits at lists.llvm.org
Wed May 24 08:08:09 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bb4f88f9b97f8345c04afcea5323b1d26f022507
      https://github.com/llvm/llvm-project/commit/bb4f88f9b97f8345c04afcea5323b1d26f022507
  Author: Guillaume Chatelet <gchatelet at google.com>
  Date:   2023-05-24 (Wed, 24 May 2023)

  Changed paths:
    M libc/test/src/sys/random/linux/getrandom_test.cpp

  Log Message:
  -----------
  [libc] simplify test for getrandom

`getrandom` is implemented as a syscall.
We don't want to test linux implementation of the syscall. We just want to verify that it reacts as expected to sensible values.

Runtime before
```
[ RUN      ] LlvmLibcGetRandomTest.InvalidFlag
[       OK ] LlvmLibcGetRandomTest.InvalidFlag (took 0 ms)
[ RUN      ] LlvmLibcGetRandomTest.InvalidBuffer
[       OK ] LlvmLibcGetRandomTest.InvalidBuffer (took 0 ms)
[ RUN      ] LlvmLibcGetRandomTest.ReturnsSize
[       OK ] LlvmLibcGetRandomTest.ReturnsSize (took 83 ms)
[ RUN      ] LlvmLibcGetRandomTest.PiEstimation
[       OK ] LlvmLibcGetRandomTest.PiEstimation (took 9882 ms)
```

Runtime after
```
[ RUN      ] LlvmLibcGetRandomTest.InvalidFlag
[       OK ] LlvmLibcGetRandomTest.InvalidFlag (took 0 ms)
[ RUN      ] LlvmLibcGetRandomTest.InvalidBuffer
[       OK ] LlvmLibcGetRandomTest.InvalidBuffer (took 0 ms)
[ RUN      ] LlvmLibcGetRandomTest.ReturnsSize
[       OK ] LlvmLibcGetRandomTest.ReturnsSize (took 0 ms)
[ RUN      ] LlvmLibcGetRandomTest.CheckValue
[       OK ] LlvmLibcGetRandomTest.CheckValue (took 0 ms)
```

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D151336




More information about the All-commits mailing list