mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
nfs: add missing DirListTest
Summary:
This should have been added in D27243075 (5a150e125a
) but I forgot to run `hg add` and it
was thus not added...
Reviewed By: fanzeyi
Differential Revision: D27279169
fbshipit-source-id: 69807cc05fef33f51b2a491b66c2e8aeb7136deb
This commit is contained in:
parent
60bee62179
commit
022613e90c
33
eden/fs/nfs/test/DirListTest.cpp
Normal file
33
eden/fs/nfs/test/DirListTest.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This software may be used and distributed according to the terms of the
|
||||
* GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "eden/fs/nfs/NfsdRpc.h"
|
||||
#include "eden/fs/nfs/testharness/XdrTestUtils.h"
|
||||
|
||||
namespace facebook::eden {
|
||||
|
||||
namespace {
|
||||
size_t computeInitialOverhead() {
|
||||
return XdrTrait<post_op_attr>::serializedSize(post_op_attr{fattr3{}}) +
|
||||
XdrTrait<uint64_t>::serializedSize(0) +
|
||||
2 * XdrTrait<bool>::serializedSize(false);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
TEST(DirListTest, size) {
|
||||
// Verify that the computeInitialOverhead in DirList.cpp is correct.
|
||||
// If this fails, do not modify the value below! It means that the XDR
|
||||
// datastructures have changed and no longer have the correct size.
|
||||
EXPECT_EQ(computeInitialOverhead(), 104);
|
||||
}
|
||||
|
||||
} // namespace facebook::eden
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user