text
stringlengths
1
24.5M
#include <common/utils/SerDeser.h> #include <gtest/gtest.h> namespace hf3fs::tests { namespace { TEST(Serializer, testPutChar) { String s; Serializer ser(s); ser.putChar('a'); ser.putChar('b'); ser.putChar('c'); ASSERT_EQ(s, "abc"); } TEST(Serializer, testPutIntAsChar) { String s; Serializer ser(s); ...
#include <folly/Random.h> #include <thread> #include <vector> #include "common/utils/RobinHood.h" #include "common/utils/Shards.h" #include "tests/GtestHelpers.h" namespace hf3fs::test { namespace { TEST(TestShards, Normal) { Shards<std::unordered_map<uint32_t, uint32_t>, 64> shards; constexpr auto N = 8; con...
#include <folly/logging/xlog.h> #include "common/utils/ConfigBase.h" #include "common/utils/Size.h" #include "tests/GtestHelpers.h" namespace hf3fs::test { namespace { static_assert(config::IsPrimitive<Size>, "size is not primitive"); class Config : public ConfigBase<Config> { CONFIG_HOT_UPDATED_ITEM(size, 128_KB...
#include <gtest/gtest.h> #include <string> #include "common/utils/Status.h" namespace hf3fs::tests { namespace { TEST(Status, testCtor) { Status s1(1); ASSERT_EQ(s1.code(), 1); ASSERT_TRUE(s1.message().empty()); ASSERT_TRUE(!s1.hasPayload()); Status s2(1, "test"); ASSERT_EQ(s2.code(), 1); ASSERT_EQ(s2....
#include "common/utils/StatusCode.h" #include "gtest/gtest.h" namespace hf3fs { namespace { TEST(StatusCode, toString) { ASSERT_EQ(StatusCode::toString(StatusCode::kOK), "OK"); ASSERT_EQ(StatusCode::toString(TransactionCode::kConflict), "Transaction::Conflict"); ASSERT_EQ(StatusCode::toString(-1), "UnknownStatu...
#include <string> #include "common/utils/StrongType.h" #include "tests/GtestHelpers.h" namespace hf3fs::tests { namespace { STRONG_TYPEDEF(int, TypedInt); STRONG_TYPEDEF(size_t, TypedUint); STRONG_TYPEDEF(std::string, TypedString); TEST(StrongTypedefTest, testComparison) { TypedInt ti0; ASSERT_TRUE(ti0 < 1); A...
#include <cstdlib> #include <folly/logging/xlog.h> #include <gtest/gtest.h> #include "common/serde/Serde.h" #include "common/utils/SysResource.h" namespace hf3fs { TEST(TestSysResource, GetHostname) { auto result = SysResource::hostname(); ASSERT_TRUE(result); XLOGF(INFO, "hostname is {}", result.value()); } ...
#include <type_traits> #include "common/utils/Thief.h" #include "common/utils/TypeTraits.h" #include "tests/GtestHelpers.h" namespace hf3fs::test { namespace { class A { public: auto &secret() { return secret_; } private: int secret_ = 0; }; template <typename Tag, auto Value> struct StoreValue : public std:...
#include <gtest/gtest.h> #include "common/utils/Toml.hpp" TEST(TestToml, Normal) { toml::parse_result config = toml::parse(R"( name = "foo" [test] foo = "bar" val = 123 )"); ASSERT_TRUE(config["name"].is_string()); ASSERT_EQ(config["name"].value_or(std::string_view{}), std::string_view("foo"...
#include "tests/GtestHelpers.h" #include "toml.hpp" namespace hf3fs::test { namespace { TEST(TestToml11, Normal) { toml::value v; // not initialized as a table. v["foo"] = 42; // OK. `v` will be a table. ASSERT_TRUE(v.is_table()); } } // namespace } // namespace hf3fs::test
#include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/experimental/coro/BlockingWait.h> #include <gtest/gtest.h> #include "common/utils/Coroutine.h" #include "common/utils/Tracing.h" #include "common/utils/TracingEvent.h" namespace hf3fs::tests { namespace { TEST(Tracing, testEventToString) { ASSERT_EQ...
#include <vector> #include "common/utils/RobinHood.h" #include "common/utils/TypeTraits.h" namespace hf3fs { namespace { static_assert(is_vector_v<std::vector<int>>, "is vector"); static_assert(!is_vector_v<std::string>, "not vector"); static_assert(is_set_v<std::set<int>>, "is set"); static_assert(!is_set_v<std::s...
#include <stdexcept> #include <unordered_map> #include "common/utils/RobinHood.h" #include "common/utils/UnorderedDense.h" #include "tests/GtestHelpers.h" namespace { template <class Map> void insertWhileHashIsZero() { constexpr auto N = 1000; Map map; for (auto i = 0; i < N; ++i) { map[i] = i; } } TEST...
#include <gtest/gtest.h> #include "common/utils/UtcTime.h" namespace hf3fs::tests { namespace { TEST(UtcTime, testConvert) { UtcTime now = UtcClock::now(); int64_t us = now.toMicroseconds(); UtcTime utc = UtcTime::fromMicroseconds(us); ASSERT_EQ(us, utc.toMicroseconds()); } } // namespace } // namespace ...
#include <boost/core/ignore_unused.hpp> #include <boost/uuid/random_generator.hpp> #include <boost/uuid/uuid.hpp> #include <cstdlib> #include <double-conversion/utils.h> #include <fmt/core.h> #include <gtest/gtest.h> #include <memory> #include <string> #include <sys/wait.h> #include <unistd.h> #include <utility> #incl...
#include <gtest/gtest.h> #include <limits> #include "common/serde/Serde.h" #include "common/utils/Varint32.h" namespace hf3fs::test { namespace { TEST(TestVarint32, Normal) { Varint32 value = 20; value = 30; ASSERT_EQ(value, 30); auto out = serde::serialize(value); Varint32 de1{}; ASSERT_TRUE(serde::de...
#include <folly/executors/task_queue/UnboundedBlockingQueue.h> #include "common/utils/WorkStealingBlockingQueue.h" #include "tests/GtestHelpers.h" namespace hf3fs::test { namespace { template <template <typename, typename> typename QueueTemplate> auto createQueues(size_t count = 10) { auto isEnd = [](const int &x) ...
#include "common/utils/Size.h" #include "common/utils/ZSTD.h" #include "tests/GtestHelpers.h" namespace hf3fs::testing { namespace { TEST(TestZstd, Normal) { std::string src(1_MB, 0xFF); std::string out(1_MB, '\0'); auto compressed = ZSTD_compress(out.data(), out.size(), src.data(), src.size(), 0); ASSERT_FA...
#pragma once #include <cstdint> #include <map> #include "common/kv/mem/MemKVEngine.h" #include "fdb/FDBKVEngine.h" namespace hf3fs::testing { template <typename KV> struct KVTrait {}; template <> struct KVTrait<kv::mem::MemKV> { using Engine = kv::MemKVEngine; using State = uint64_t; using Transaction = kv::M...
#pragma once #include <atomic> #include <gtest/gtest.h> #include <memory> #include <thread> #include <utility> #include "fdb/FDB.h" #include "fdb/FDBConfig.h" #include "fdb/FDBContext.h" #include "tests/GtestHelpers.h" namespace hf3fs::testing { using namespace hf3fs::kv; class SetupFDB : public ::testing::Test { ...
#include <folly/experimental/TestUtil.h> #include <gtest/gtest.h> #include "kv/KVStore.h" namespace hf3fs::kv::test { namespace { struct TestKVStore : public testing::TestWithParam<KVStore::Type> {}; TEST_P(TestKVStore, Normal) { folly::test::TemporaryDirectory tmpPath; KVStore::Config config; config.set_type...
#pragma once #include <folly/experimental/coro/BlockingWait.h> #include "common/serde/Serde.h" #include "fbs/mgmtd/MgmtdTypes.h" #include "storage/service/StorageServer.h" #include "storage/store/StorageTargets.h" namespace hf3fs::test { struct StorageServerHelper { static auto &components(storage::StorageServer ...
#include "UnitTestFabric.h" #include <boost/filesystem/operations.hpp> #include <folly/experimental/coro/Collect.h> #include "client/mgmtd/MgmtdClientForClient.h" #include "common/utils/StringUtils.h" #include "common/utils/SysResource.h" #include "tests/lib/Helper.h" namespace hf3fs::test { NodeTargetMap UnitTestF...
#pragma once #include <map> #include <vector> #include "client/mgmtd/MgmtdClientForClient.h" #include "client/mgmtd/MgmtdClientForServer.h" #include "client/storage/StorageClient.h" #include "fbs/mgmtd/MgmtdTypes.h" #include "fbs/mgmtd/RoutingInfo.h" #include "storage/service/StorageServer.h" #include "tests/GtestHel...
#include <fmt/core.h> #include <folly/dynamic.h> #include <folly/init/Init.h> #include <folly/json.h> #include <folly/logging/LogConfigParser.h> #include <folly/logging/xlog.h> #include <folly/synchronization/LifoSem.h> #include <gflags/gflags.h> #include <gflags/gflags_declare.h> #include <gtest/gtest.h> #include <str...
#include "MetaTestBase.h" #include <algorithm> #include <chrono> #include <cstddef> #include <cstdlib> #include <fmt/core.h> #include <folly/Conv.h> #include <folly/Math.h> #include <folly/Random.h> #include <folly/Unit.h> #include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/experimental/coro/BlockingWai...
#pragma once #include <algorithm> #include <experimental/array> #include <fmt/core.h> #include <folly/Random.h> #include <folly/Synchronized.h> #include <folly/concurrency/ConcurrentHashMap.h> #include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/logging/xlog.h> #include <functional> #include <gtest/gtest...
#include <cstdint> #include <fmt/core.h> #include <folly/Random.h> #include <folly/Utility.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <gflags/gflags.h> #include <gtest/gtest.h> #include <iterator> #include <optional> #include <type_traits> #include <t...
#include <atomic> #include <folly/Random.h> #include <folly/executors/CPUThreadPoolExecutor.h> #include <gtest/gtest.h> #include <map> #include <thread> #include <vector> #include "common/utils/Coroutine.h" #include "common/utils/UtcTime.h" #include "fbs/meta/Schema.h" #include "meta/components/AclCache.h" namespace ...
#include <folly/Random.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <gflags/gflags.h> #include <gtest/gtest-param-test.h> #include <map> #include "common/utils/Coroutine.h" #include "fbs/meta/Common.h" #include "fbs/mgmtd/ChainRef.h" #include "fbs/mgmt...
#include <algorithm> #include <array> #include <atomic> #include <chrono> #include <fmt/core.h> #include <folly/Random.h> #include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Invoke.h> #in...
#include <chrono> #include <fcntl.h> #include <fmt/core.h> #include <folly/Math.h> #include <folly/Random.h> #include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Invoke.h> #include <folly/...
#include <chrono> #include <fcntl.h> #include <fmt/core.h> #include <folly/Random.h> #include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Invoke.h> #include <folly/experimental/coro/Sleep....
#include <chrono> #include <folly/Synchronized.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/CurrentExecutor.h> #include <folly/experimental/coro/GtestHelpers.h> #include <gtest/gtest-typed-test.h> #include <memory> #include <vector> #include "common/utils/Coroutine.h" #include...
#include <algorithm> #include <chrono> #include <fcntl.h> #include <fmt/core.h> #include <folly/Random.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Sleep.h> #include <folly/logging/xlog.h> #include <gtest/gtest-param-test.h> #in...
#include <folly/Random.h> #include "core/user/UserToken.h" #include "tests/GtestHelpers.h" namespace hf3fs::meta::server::test { namespace { class UserTokenTest : public ::testing::Test { protected: void test(uint32_t uid, uint64_t randomv) { auto token = core::encodeUserToken(uid, randomv); XLOGF(DBG, "en...
#include <array> #include <cerrno> #include <fcntl.h> #include <fmt/core.h> #include <folly/FileUtil.h> #include <folly/Random.h> #include <folly/ScopeGuard.h> #include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/hash/Checksum.h> #include <folly/json.h> #include <folly/logging/LogConfigParser.h> #include ...
#include <atomic> #include <chrono> #include <cstdlib> #include <double-conversion/utils.h> #include <fmt/compile.h> #include <fmt/core.h> #include <folly/Random.h> #include <folly/Synchronized.h> #include <folly/concurrency/ConcurrentHashMap.h> #include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/experim...
#include <algorithm> #include <atomic> #include <chrono> #include <fcntl.h> #include <folly/Random.h> #include <folly/Synchronized.h> #include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/Collect.h> #include <folly/experimental/coro/GtestH...
#include <cstdlib> #include <fmt/core.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <gtest/gtest.h> #include <optional> #include <string> #include <vector> #include "common/kv/IKVEngine.h" #include "common/kv/mem/MemKVEngine.h" #include "common/utils/Co...
#include <cstdlib> #include <double-conversion/utils.h> #include <fmt/compile.h> #include <fmt/core.h> #include <folly/Random.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <gtest/gtest.h> #include <set> #include <string> #include <variant> #include <vect...
#include <algorithm> #include <atomic> #include <chrono> #include <fcntl.h> #include <fmt/core.h> #include <folly/Random.h> #include <folly/Synchronized.h> #include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/Collect.h> #include <folly/ex...
#include <algorithm> #include <atomic> #include <chrono> #include <fcntl.h> #include <folly/Random.h> #include <folly/Synchronized.h> #include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/Collect.h> #include <folly/experimental/coro/GtestH...
#include <array> #include <fcntl.h> #include <folly/Random.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Task.h> #include <gtest/gtest.h> #include <memory> #include <optional> #include <string> #include <thread> #include <utility...
#include <array> #include <cstdint> #include <fcntl.h> #include <fmt/core.h> #include <folly/Random.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Task.h> #include <folly/logging/xlog.h> #include <gtest/gtest.h> #include <optional...
#include <chrono> #include <fcntl.h> #include <fmt/core.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Sleep.h> #include <folly/experimental/coro/Task.h> #include <folly/logging/xlog.h> #include <gtest/gtest.h> #include <linux/fs....
#include <algorithm> #include <fmt/core.h> #include <folly/Random.h> #include <gtest/gtest.h> #include <vector> #include "common/utils/FaultInjection.h" #include "common/utils/StatusCode.h" #include "meta/store/MetaStore.h" #include "tests/meta/MetaTestBase.h" namespace hf3fs::meta::server { template <typename KV> c...
#include <fcntl.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Task.h> #include <gtest/gtest.h> #include <linux/fs.h> #include "common/utils/FaultInjection.h" #include "common/utils/StatusCode.h" #include "fbs/meta/Common.h" #inc...
#include <algorithm> #include <fcntl.h> #include <folly/Random.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Sleep.h> #include <folly/experimental/coro/Task.h> #include <gtest/gtest.h> #include <optional> #include <random> #inclu...
#include <fcntl.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Task.h> #include <glog/logging.h> #include <gtest/gtest.h> #include <optional> #include <utility> #include <variant> #include <vector> #include "common/utils/Coroutin...
#include <chrono> #include <fcntl.h> #include <fmt/core.h> #include <folly/Random.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Sleep.h> #include <folly/experimental/coro/Task.h> #include <gtest/gtest.h> #include <optional> #incl...
#include <cstdlib> #include <fcntl.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/Task.h> #include <functional> #include <gtest/gtest.h> #include <optional> #include <string> #include "common/utils/Coroutine.h" #include "common/utils/FaultInjection.h" #include "fbs/core/user/Use...
#include <bits/types/FILE.h> #include <fcntl.h> #include <fmt/core.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Task.h> #include <glog/logging.h> #include <gtest/gtest.h> #include <iterator> #include <variant> #include <vector> ...
#include <algorithm> #include <folly/Random.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/futures/ManualTimekeeper.h> #include <gtest/gtest.h> #include <optional> #include <vector> #include "common/utils/FaultInjection.h" #include "common/utils/StatusCode.h" #include "common/utils/UtcTime.h" #in...
#include <fcntl.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/Task.h> #include <gtest/gtest.h> #include <optional> #include <string> #include "common/kv/ITransaction.h" #include "common/utils/Coroutine.h" #include "common/utils/FaultInjection.h" #include "common/utils/Result.h"...
#include <fcntl.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Task.h> #include <glog/logging.h> #include <gtest/gtest.h> #include <optional> #include <utility> #include <variant> #include <vector> #include "common/utils/Coroutin...
#include <algorithm> #include <fcntl.h> #include <folly/Random.h> #include <folly/Synchronized.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Task.h> #include <folly/logging/xlog.h> #include <gtest/gtest.h> #include <mutex> #inclu...
#include <atomic> #include <fcntl.h> #include <folly/Random.h> #include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/experimental/coro/Task.h> #include <folly/logging/xlog.h> #include <gtest/gtest.h> #includ...
#include <algorithm> #include <fcntl.h> #include <folly/Random.h> #include <folly/experimental/coro/GtestHelpers.h> #include <folly/futures/ManualTimekeeper.h> #include <gtest/gtest.h> #include <optional> #include <vector> #include "common/utils/FaultInjection.h" #include "common/utils/StatusCode.h" #include "common/u...
#include "MgmtdTestHelper.h" namespace hf3fs::mgmtd::testing { CoTryTask<void> MgmtdTestHelper::setRoutingInfo(std::function<void(flat::RoutingInfo &)> callback) { co_await extendLease(); auto handler = [&]() -> CoTryTask<void> { auto writerLock = co_await op_.state_.coScopedLock<"test">(); std::optional<...
#pragma once #include "common/utils/StringUtils.h" #include "mgmtd/MgmtdServer.h" #include "mgmtd/background/MgmtdLeaseExtender.h" #include "mgmtd/service/MgmtdOperator.h" #include "mgmtd/service/helpers.h" namespace hf3fs::mgmtd::testing { class MgmtdTestHelper { public: MgmtdTestHelper(MgmtdOperator &op) ...
#include <folly/experimental/coro/BlockingWait.h> #include "MgmtdTestHelper.h" #include "common/kv/KeyPrefix.h" #include "common/kv/mem/MemKVEngine.h" #include "mgmtd/ops/Include.h" #include "mgmtd/service/MgmtdOperator.h" #include "tests/GtestHelpers.h" namespace hf3fs::mgmtd::testing { class MgmtdOperatorTest : pub...
#include <folly/experimental/coro/BlockingWait.h> #include "common/kv/mem/MemKVEngine.h" #include "mgmtd/store/MgmtdStore.h" #include "tests/GtestHelpers.h" namespace hf3fs::testing { namespace { using namespace ::hf3fs::mgmtd; class MgmtdStoreTest : public ::testing::Test { protected: MgmtdStoreTest() { node...
#include "fbs/mgmtd/NodeInfo.h" #include "tests/GtestHelpers.h" namespace hf3fs::test { namespace { TEST(NodeSelector, testSelectByTrifficZone) { auto createNode = [](const String &zone) { flat::NodeInfo n; if (!zone.empty()) { n.tags = {flat::TagPair(flat::kTrafficZoneTagKey, zone)}; } return ...
#include <folly/Overload.h> #include <folly/logging/xlog.h> #include <map> #include "common/utils/RandomUtils.h" #include "common/utils/Transform.h" #include "mgmtd/service/updateChain.h" #include "tests/GtestHelpers.h" namespace hf3fs::testing { namespace { class UpdateChainTest : public ::testing::Test { protected...
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/Collect.h> #include "client/mgmtd/ICommonMgmtdClient.h" #include "client/storage/StorageClient.h" #include "common/net/Client.h" #include "migration/service/Server.h" #include "tests/lib/Helper.h" #include "tests/lib/UnitTestFabric.h" ...
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/Collect.h> #include <folly/logging/xlog.h> #include "benchmarks/storage_bench/StorageBench.h" #include "client/mgmtd/ICommonMgmtdClient.h" #include "client/storage/StorageClient.h" #include "common/net/Client.h" #include "tests/GtestHe...
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/Collect.h> #include <folly/logging/xlog.h> #include "benchmarks/storage_bench/StorageBench.h" #include "client/mgmtd/ICommonMgmtdClient.h" #include "client/storage/StorageClient.h" #include "common/net/Client.h" #include "tests/GtestHe...
#include <folly/experimental/coro/BlockingWait.h> #include "client/mgmtd/ICommonMgmtdClient.h" #include "client/storage/StorageClient.h" #include "common/net/Client.h" #include "tests/GtestHelpers.h" #include "tests/lib/UnitTestFabric.h" namespace hf3fs::storage::client { namespace { using namespace hf3fs::test; cl...
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/Collect.h> #include "client/mgmtd/ICommonMgmtdClient.h" #include "client/storage/StorageClient.h" #include "common/net/Client.h" #include "tests/GtestHelpers.h" #include "tests/lib/UnitTestFabric.h" namespace hf3fs::storage::client { ...
#include <folly/experimental/coro/BlockingWait.h> #include "client/mgmtd/ICommonMgmtdClient.h" #include "client/storage/StorageClient.h" #include "common/net/Client.h" #include "tests/GtestHelpers.h" #include "tests/lib/UnitTestFabric.h" namespace hf3fs::storage::client { namespace { using namespace hf3fs::test; cl...
#include <folly/experimental/coro/BlockingWait.h> #include <folly/logging/xlog.h> #include "client/mgmtd/ICommonMgmtdClient.h" #include "client/storage/StorageClient.h" #include "common/net/Client.h" #include "tests/lib/UnitTestFabric.h" namespace hf3fs::storage::client { namespace { using namespace hf3fs::test; cl...
#include <folly/executors/CPUThreadPoolExecutor.h> #include "client/storage/TargetSelection.h" #include "common/utils/Duration.h" #include "tests/GtestHelpers.h" namespace hf3fs::storage::client { namespace { TEST(TargetSelectionStrategy, LoadDistribution) { const uint64_t numReplicas = 3; const uint64_t numNode...
#include <boost/filesystem/operations.hpp> #include <thread> #include "common/serde/Serde.h" #include "common/utils/FileUtils.h" #include "kv/KVStore.h" #include "kv/MemDBStore.h" #include "storage/service/StorageServer.h" #include "tests/GtestHelpers.h" #include "tests/lib/Helper.h" #include "tests/lib/UnitTestFabric...
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/Collect.h> #include "client/mgmtd/ICommonMgmtdClient.h" #include "client/storage/StorageClient.h" #include "common/net/Client.h" #include "tests/lib/Helper.h" #include "tests/lib/UnitTestFabric.h" namespace hf3fs::storage { namespace ...
#include <filesystem> #include <folly/experimental/coro/Collect.h> #include "common/serde/Serde.h" #include "common/utils/FileUtils.h" #include "common/utils/SysResource.h" #include "tests/GtestHelpers.h" #include "tests/lib/Helper.h" #include "tests/lib/UnitTestFabric.h" namespace hf3fs::storage { namespace { using...
#include <algorithm> #include <chrono> #include <thread> #include "client/storage/StorageClient.h" #include "common/kv/mem/MemKVEngine.h" #include "common/net/Client.h" #include "common/serde/Serde.h" #include "fbs/mgmtd/RoutingInfo.h" #include "fbs/storage/Service.h" #include "storage/service/StorageOperator.h" #incl...
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/Collect.h> #include "client/mgmtd/ICommonMgmtdClient.h" #include "client/storage/StorageClient.h" #include "common/net/Client.h" #include "tests/lib/UnitTestFabric.h" namespace hf3fs::storage { namespace { using namespace hf3fs::test...
#include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/experimental/coro/BlockingWait.h> #include "common/serde/Serde.h" #include "common/utils/Reflection.h" #include "fbs/storage/Common.h" #include "fbs/storage/Service.h" #include "storage/aio/AioReadWorker.h" #include "storage/service/BufferPool.h" #incl...
#include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/experimental/coro/BlockingWait.h> #include <folly/hash/Checksum.h> #include <folly/logging/xlog.h> #include "chunk_engine/src/cxx.rs.h" #include "common/utils/Size.h" #include "fbs/storage/Common.h" #include "storage/aio/AioReadWorker.h" #include "stor...
#include <chrono> #include <thread> #include <vector> #include "common/utils/Size.h" #include "storage/store/ChunkFileStore.h" #include "storage/store/ChunkMetaStore.h" #include "storage/store/PhysicalConfig.h" #include "tests/GtestHelpers.h" namespace hf3fs::storage::test { namespace { using namespace std::chrono_l...
#include "common/serde/Serde.h" #include "common/utils/Reflection.h" #include "fbs/storage/Common.h" #include "fbs/storage/Service.h" #include "tests/GtestHelpers.h" namespace hf3fs::storage::test { namespace { TEST(TestCommonStruct, Normal) { { ChunkId ser(0xface, 0xbeef); auto out = serde::serialize(ser);...
#include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/experimental/coro/BlockingWait.h> #include "common/utils/Size.h" #include "fbs/storage/Common.h" #include "storage/aio/AioReadWorker.h" #include "storage/service/TargetMap.h" #include "storage/store/ChunkStore.h" #include "storage/store/StorageTarget.h...
#include <folly/experimental/TestUtil.h> #include "common/utils/CPUExecutorGroup.h" #include "common/utils/SysResource.h" #include "storage/store/StorageTargets.h" #include "tests/GtestHelpers.h" namespace hf3fs::storage { namespace { TEST(TestStorageTargets, Normal) { folly::test::TemporaryDirectory tmpPath; S...
#include <thread> #include "client/storage/TargetSelection.h" #include "common/serde/Serde.h" #include "kv/KVStore.h" #include "kv/MemDBStore.h" #include "storage/service/StorageServer.h" #include "tests/GtestHelpers.h" #include "tests/lib/Helper.h" #include "tests/lib/UnitTestFabric.h" namespace hf3fs::storage::test...
#include <thread> #include "common/serde/Serde.h" #include "kv/KVStore.h" #include "kv/MemDBStore.h" #include "storage/service/StorageServer.h" #include "tests/GtestHelpers.h" #include "tests/lib/Helper.h" #include "tests/lib/UnitTestFabric.h" namespace hf3fs::storage::test { namespace { using namespace hf3fs::test;...
#pragma once #include "stubs/mgmtd/IMgmtdServiceStub.h" #define DEFINE_SERDE_SERVICE_METHOD_FULL(svc, name, Name, id, reqtype, rsptype) \ std::function<Result<rsptype>(const reqtype &)> name##Func; \ DummyMgmtdServiceStub &set_##name##Func(auto &&func) { \ name##Func =...
/* SPDX-License-Identifier: MIT */ #ifndef LIBURING_COMPAT_H #define LIBURING_COMPAT_H #include <linux/time_types.h> /* <linux/time_types.h> is included above and not needed again */ #define UAPI_LINUX_IO_URING_H_SKIP_LINUX_TIME_TYPES_H 1 #include <inttypes.h> struct open_how { uint64_t flags; uint64_t mode; uint...
/* SPDX-License-Identifier: MIT */ #ifndef LIBURING_VERSION_H #define LIBURING_VERSION_H #define IO_URING_VERSION_MAJOR 2 #define IO_URING_VERSION_MINOR 4 #endif
/* Usage: ./codesend decimalcode [protocol] [pulselength] decimalcode - As decoded by RFSniffer protocol - According to rc-switch definitions pulselength - pulselength in microseconds 'codesend' hacked from 'send' by @justy - The provided rc_switch 'send' command uses the form systemCode, unitCode, command w...
/* RFSniffer Usage: ./RFSniffer [<pulseLength>] [] = optional Hacked from http://code.google.com/p/rc-switch/ by @justy to provide a handy RF code sniffer */ #include "../rc-switch/RCSwitch.h" extern "C" { #include <unistd.h> } #include <stdlib.h> #include <stdio.h> RCSwitch mySwitch; in...
/* Usage: ./send <systemCode> <unitCode> <command> Command is 0 for OFF and 1 for ON */ #include "../rc-switch/RCSwitch.h" #include <stdlib.h> #include <stdio.h> int main(int argc, char *argv[]) { /* output PIN is hardcoded for testing purposes XIO-P* do not have a good enough time resolution to...
/* Usage: ./codesend decimalcode [protocol] [pulselength] decimalcode - As decoded by RFSniffer protocol - According to rc-switch definitions pulselength - pulselength in microseconds 'codesend' hacked from 'send' by @justy - The provided rc_switch 'send' command uses the form systemCode, unitCode, command w...
/* RFSniffer Usage: ./RFSniffer [<pulseLength>] [] = optional Hacked from http://code.google.com/p/rc-switch/ by @justy to provide a handy RF code sniffer */ #include "../rc-switch/RCSwitch.h" #include <stdlib.h> #include <stdio.h> #include <unistd.h> RCSwitch mySwitch; int main(int argc, c...
/* Usage: ./send <systemCode> <unitCode> <command> Command is 0 for OFF and 1 for ON */ #include "../rc-switch/RCSwitch.h" #include <stdlib.h> #include <stdio.h> int main(int argc, char *argv[]) { /* output PIN is hardcoded for testing purposes see https://projects.drogon.net/raspberry-pi/wiring...
/** * BSD 2-Clause License * * Copyright (c) 2017, Gabriel Aubut-Lussier * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copy...
/* # cr.h A single file header-only live reload solution for C, written in C++: - simple public API, 3 functions to use only (and another to export); - works and tested on Linux, MacOSX and Windows; - automatic crash protection; - automatic static state transfer; - based on dynamic reloadable binary (.so/.dylib/.dll)...
#include "dr_flac.h" #ifndef dr_flac_c #define dr_flac_c /* Disable some annoying warnings. */ #if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) #pragma GCC diagnostic push #if __GNUC__ >= 7 #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" ...
/* FLAC audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file. dr_flac - v0.12.23 - 2020-11-21 David Reid - mackron@gmail.com GitHub: https://github.com/mackron/dr_libs */ /* RELEASE NOTES - v0.12.0 ======================= Version 0.12.0 has breaking API changes including ch...
#include "dr_mp3.h" #ifndef dr_mp3_c #define dr_mp3_c #include <stdlib.h> #include <string.h> #include <limits.h> /* For INT_MAX */ DRMP3_API void drmp3_version(drmp3_uint32* pMajor, drmp3_uint32* pMinor, drmp3_uint32* pRevision) { if (pMajor) { *pMajor = DRMP3_VERSION_MAJOR; } if (pMinor) { ...