From df42331d20b59ae5ee5d6371f9c79cf1e0680100 Mon Sep 17 00:00:00 2001 From: Privacy Sandbox Team Date: Thu, 3 Oct 2024 23:42:00 -0400 Subject: [PATCH] fix: Add dispatcher tests for paths Bug: N/A Change-Id: I33d2ae799198e23209697da6efbb877bd0853a2f GitOrigin-RevId: c53d5f44c05cd03ff2b7dffce9ba2bd58ad44c40 --- src/roma/byob/dispatcher/dispatcher_test.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/roma/byob/dispatcher/dispatcher_test.cc b/src/roma/byob/dispatcher/dispatcher_test.cc index 3614553c..33c2710b 100644 --- a/src/roma/byob/dispatcher/dispatcher_test.cc +++ b/src/roma/byob/dispatcher/dispatcher_test.cc @@ -113,6 +113,22 @@ TEST(DispatcherTest, ShutdownDispatcherThenWorker) { worker.join(); } +TEST(DispatcherTest, LoadErrorsForEmptyBinaryPath) { + Dispatcher dispatcher; + EXPECT_FALSE(dispatcher.LoadBinary("", /*n_workers=*/1).ok()); +} + +// TODO: b/371538589 - Ensure non-file paths are handled appropriately. +TEST(DispatcherTest, DISABLED_LoadErrorsForRootPath) { + Dispatcher dispatcher; + EXPECT_FALSE(dispatcher.LoadBinary("/", /*n_workers=*/1).ok()); +} + +TEST(DispatcherTest, LoadErrorsForUnknownBinaryPath) { + Dispatcher dispatcher; + EXPECT_FALSE(dispatcher.LoadBinary("/asdflkj/ytrewq", /*n_workers=*/1).ok()); +} + TEST(DispatcherTest, LoadErrorsWhenNWorkersNonPositive) { Dispatcher dispatcher; EXPECT_FALSE(