andishgar commented on code in PR #47164:
URL: https://github.com/apache/arrow/pull/47164#discussion_r2321389493


##########
cpp/src/arrow/table_test.cc:
##########
@@ -152,38 +153,234 @@ TEST_F(TestTable, AllColumnsAndFields) {
   ASSERT_EQ(0, fields.size());
 }
 
-TEST_F(TestTable, Equals) {
-  const int length = 100;
-  MakeExample1(length);
+class TestTableEquality : public TestTable {};
 
-  table_ = Table::Make(schema_, columns_);
+TEST_F(TestTableEquality, Equals) {

Review Comment:
   
   I’m aware that my tests don’t necessarily need to inherit from the 
`TestTable` class. However, I think a few points are worth mentioning:
   
   1. The reason I don’t use `MakeExample1()` is explained in this 
[link](https://abseil.io/tips/122).(having a consistent code path)
   2. `TestTableEquality` inherits from `TestTable` to show their relevance. 
(Note: there’s no significant initialization in `TestTable`, and 
`TestTableEquality` serves as a base class for other test suites, such as 
`TestTableEqualityFloatType` and `TestTableEqualitySameAddress`.)
   3. I prefer using `TEST_F` because it helps catch typos in test suite names 
at compile time. For example, if I write `TEST(TestTableEqualit, ...)`, the 
compiler wouldn’t detect the typo.
   
   Given this, should I use `TEST` instead of `TEST_F`?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to