diff options
author | Almaz Mingaleev <mingaleev@google.com> | 2024-02-02 11:27:48 +0000 |
---|---|---|
committer | Almaz Mingaleev <mingaleev@google.com> | 2024-02-02 14:52:55 +0000 |
commit | b8f1b6abe035341bbcbb41f3df609da55875d1a7 (patch) | |
tree | 5d3c221d0adc9af9fb34c84e1541cce42b98c736 /luni | |
parent | fb7ef997dfdf18dfbf4af884acb843821755c9ca (diff) | |
download | libcore-b8f1b6abe035341bbcbb41f3df609da55875d1a7.tar.gz |
Add tests for RandomGenerator-s of factory methods.
Bug: 323464259
Bug: 323463671
Bug: 323464364
Test: CtsLibcoreTestCases
Change-Id: I6f7f30be15250d9b5c4de166ef67397de97fc203
Diffstat (limited to 'luni')
-rw-r--r-- | luni/src/test/java/libcore/java/util/random/RandomGeneratorTest.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/luni/src/test/java/libcore/java/util/random/RandomGeneratorTest.java b/luni/src/test/java/libcore/java/util/random/RandomGeneratorTest.java index fb6828093d0..999522f1a7d 100644 --- a/luni/src/test/java/libcore/java/util/random/RandomGeneratorTest.java +++ b/luni/src/test/java/libcore/java/util/random/RandomGeneratorTest.java @@ -54,4 +54,16 @@ public class RandomGeneratorTest { .forEach(RandomGenerator::isDeprecated); } + @Test + public void of_factoryMethod_throwsNPE() { + assertThrows(NullPointerException.class, + () -> RandomGenerator.ArbitrarilyJumpableGenerator.of(null)); + + assertThrows(NullPointerException.class, + () -> RandomGenerator.JumpableGenerator.of(null)); + + assertThrows(NullPointerException.class, + () -> RandomGenerator.StreamableGenerator.of(null)); + } + } |