sapling/eden/fs/utils/test/IDGenTest.cpp
Chad Austin 078d57c4ee add a cheap unique ID generator
Summary:
Add a very cheap unique ID allocator designed for extremely
low-latency uses like D10384071.

Differential Revision: D10501712

fbshipit-source-id: 15a0b7a2d344c0f6100082850dd967c585f3e2da
2018-10-23 10:42:45 -07:00

24 lines
616 B
C++

/*
* Copyright (c) 2018-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#include "eden/fs/utils/IDGen.h"
#include <gtest/gtest.h>
using namespace facebook::eden;
TEST(IDGenTest, producesUniqueIDs) {
auto id1 = generateUniqueID();
auto id2 = generateUniqueID();
auto id3 = generateUniqueID();
EXPECT_NE(id1, id2);
EXPECT_NE(id2, id3);
EXPECT_NE(id2, id3);
}