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:
Xavier Deguillard 2021-03-24 09:44:15 -07:00 committed by Facebook GitHub Bot
parent 60bee62179
commit 022613e90c

View 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