clang-tidy:test suppress self-move warning

This test intentionally performs a self-move assignment to observe
how the FileDescriptor class handles such cases. While this is
undefined behavior in C++, the warning is suppressed locally using
Clang diagnostic pragmas to allow the test to compile and run.

Change-Id: I4213d23fcb41afc5d4af9c5f1b2b36f9ffb06d7c
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/test/file_descriptor_tests.cpp b/test/file_descriptor_tests.cpp
index ad63dd7..c13699e 100644
--- a/test/file_descriptor_tests.cpp
+++ b/test/file_descriptor_tests.cpp
@@ -130,8 +130,17 @@
         EXPECT_EQ(descriptor(), fd);
         EXPECT_TRUE(isValid(fd));
 
+// This is undefined behavior in C++, but suppress the warning
+// to observe how the class handles it.
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wself-move"
+#endif
         // Try to move object into itself
         descriptor = static_cast<FileDescriptor&&>(descriptor);
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
 
         // Verify object still contains file descriptor
         EXPECT_EQ(descriptor(), fd);