aboutsummaryrefslogtreecommitdiff
path: root/tests/core/encoding
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2024-06-22 13:21:48 -0400
committerFeoramund <161657516+Feoramund@users.noreply.github.com>2024-06-22 18:21:31 -0400
commitfcdba334ea764edb5fe1e325cc5527e9495a6f55 (patch)
treefb5854d38b8448f40f5de721922f149117da7373 /tests/core/encoding
parent3aa232a894340ea13d2fc57090c8ad149f5c482a (diff)
Require CSPRNG in UUID generation where applicable
Diffstat (limited to 'tests/core/encoding')
-rw-r--r--tests/core/encoding/uuid/test_core_uuid.odin9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/core/encoding/uuid/test_core_uuid.odin b/tests/core/encoding/uuid/test_core_uuid.odin
index fc2615fe0..a8f563e13 100644
--- a/tests/core/encoding/uuid/test_core_uuid.odin
+++ b/tests/core/encoding/uuid/test_core_uuid.odin
@@ -1,5 +1,6 @@
package test_core_uuid
+import "core:crypto"
import "core:encoding/uuid"
import uuid_legacy "core:encoding/uuid/legacy"
import "core:log"
@@ -8,6 +9,8 @@ import "core:time"
@(test)
test_version_and_variant :: proc(t: ^testing.T) {
+ context.random_generator = crypto.random_generator()
+
v1 := uuid.generate_v1(0)
v3 := uuid_legacy.generate_v3(uuid.Namespace_DNS, "")
v4 := uuid.generate_v4()
@@ -62,6 +65,8 @@ test_legacy_namespaced_uuids :: proc(t: ^testing.T) {
@(test)
test_v1 :: proc(t: ^testing.T) {
+ context.random_generator = crypto.random_generator()
+
CLOCK :: 0x3A1A
v1_a := uuid.generate_v1(CLOCK)
time.sleep(10 * time.Millisecond)
@@ -90,6 +95,8 @@ test_v1 :: proc(t: ^testing.T) {
@(test)
test_v6 :: proc(t: ^testing.T) {
+ context.random_generator = crypto.random_generator()
+
CLOCK :: 0x3A1A
v6_a := uuid.generate_v6(CLOCK)
time.sleep(10 * time.Millisecond)
@@ -118,6 +125,8 @@ test_v6 :: proc(t: ^testing.T) {
@(test)
test_v7 :: proc(t: ^testing.T) {
+ context.random_generator = crypto.random_generator()
+
v7_a := uuid.generate_v7()
time.sleep(10 * time.Millisecond)
v7_b := uuid.generate_v7()