mirror of
https://github.com/facebook/zstd.git
synced 2025-05-02 22:25:13 +03:00
Apparently it's better. Somehow. ``` for f in $(find . \( -path ./.git -o -path ./tests/fuzz/corpora -o -path ./tests/regression/data-cache -o -path ./tests/regression/cache \) -prune -o -type f); do echo $f; sed -i 's/\-present/-2022/' $f; done g co HEAD -- build/meson/ ```
29 lines
676 B
C++
29 lines
676 B
C++
/*
|
|
* Copyright (c) 2016-2022, Meta Platforms, Inc. and affiliates.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under both the BSD-style license (found in the
|
|
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
|
* in the COPYING file in the root directory of this source tree).
|
|
*/
|
|
#include "utils/ScopeGuard.h"
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
using namespace pzstd;
|
|
|
|
TEST(ScopeGuard, Dismiss) {
|
|
{
|
|
auto guard = makeScopeGuard([&] { EXPECT_TRUE(false); });
|
|
guard.dismiss();
|
|
}
|
|
}
|
|
|
|
TEST(ScopeGuard, Executes) {
|
|
bool executed = false;
|
|
{
|
|
auto guard = makeScopeGuard([&] { executed = true; });
|
|
}
|
|
EXPECT_TRUE(executed);
|
|
}
|