Skip to content

Commit

Permalink
Throw runtime_error instead of exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-tsirpanis committed Sep 16, 2024
1 parent 738f438 commit 4262f53
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tiledb/common/thread_pool/test/unit_thread_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <cstdio>
#include <iostream>
#include <random>
#include <stdexcept>
#include <vector>

#include "tiledb/common/thread_pool/thread_pool.h"
Expand Down Expand Up @@ -445,7 +446,7 @@ TEST_CASE("ThreadPool: Test Exceptions", "[threadpool][exceptions]") {
results.push_back(pool.execute([&result]() {
auto tmp = result++;
if (tmp == 13) {
throw std::exception("Unripe banana");
throw std::runtime_error("Unripe banana");
}
}));
}
Expand Down Expand Up @@ -480,7 +481,7 @@ TEST_CASE("ThreadPool: Test Exceptions", "[threadpool][exceptions]") {
throw std::string("Unripe banana");
}
if (tmp == 31) {
throw std::exception("Unbaked potato");
throw std::runtime_error("Unbaked potato");
}
}));
}
Expand All @@ -501,7 +502,7 @@ TEST_CASE("ThreadPool: Test Exceptions", "[threadpool][exceptions]") {
throw std::string("Unripe banana");
}
if (tmp == 13) {
throw std::exception("Unbaked potato");
throw std::runtime_error("Unbaked potato");
}
}));
}
Expand All @@ -519,10 +520,10 @@ TEST_CASE("ThreadPool: Test Exceptions", "[threadpool][exceptions]") {
results.push_back(pool.execute([i, &result]() {
result++;
if (i == 13) {
throw std::exception("Unripe banana");
throw std::runtime_error("Unripe banana");
}
if (i == 31) {
throw std::exception("Unbaked potato");
throw std::runtime_error("Unbaked potato");
}
}));
}
Expand All @@ -540,10 +541,10 @@ TEST_CASE("ThreadPool: Test Exceptions", "[threadpool][exceptions]") {
results.push_back(pool.execute([i, &result]() {
++result;
if (i == 31) {
throw(std::exception("Unripe banana"));
throw(std::runtime_error("Unripe banana"));
}
if (i == 13) {
throw std::exception("Unbaked potato");
throw std::runtime_error("Unbaked potato");
}
}));
}
Expand Down

0 comments on commit 4262f53

Please sign in to comment.