roshanjrajan-zip commented on code in PR #2822:
URL: https://github.com/apache/thrift/pull/2822#discussion_r1244283595


##########
test/py/explicit_module/runtest.sh:
##########
@@ -23,9 +23,12 @@ rm -rf gen-py
 ../../../compiler/cpp/thrift --gen py test1.thrift || exit 1
 ../../../compiler/cpp/thrift --gen py test2.thrift || exit 1
 ../../../compiler/cpp/thrift --gen py test3.thrift && exit 1  # Fail since 
test3.thrift has python keywords
+../../../compiler/cpp/thrift --gen py:enum shared_types.thrift || exit 1
+../../../compiler/cpp/thrift --gen py:enum test4.thrift || exit 1

Review Comment:
   The change specifically impacts enum as it is behind gen_enum_, otherwise it 
just uses the integer value. I can add a test but it would just be the value 0, 
1 in the map.
   ```cpp
   if (gen_enum_) {
         t_enum_value* enum_val = 
((t_enum*)type)->get_constant_by_value(int_val);
    --     out << type->get_name() << "." << enum_val->get_name();
    ++     out << type_name(type) << "." << enum_val->get_name();
   }
   ```



##########
test/py/explicit_module/runtest.sh:
##########
@@ -23,9 +23,12 @@ rm -rf gen-py
 ../../../compiler/cpp/thrift --gen py test1.thrift || exit 1
 ../../../compiler/cpp/thrift --gen py test2.thrift || exit 1
 ../../../compiler/cpp/thrift --gen py test3.thrift && exit 1  # Fail since 
test3.thrift has python keywords
+../../../compiler/cpp/thrift --gen py:enum shared_types.thrift || exit 1
+../../../compiler/cpp/thrift --gen py:enum test4.thrift || exit 1

Review Comment:
   The change specifically impacts enum as it is behind `gen_enum_,` otherwise 
it just uses the integer value. I can add a test but it would just be the value 
0, 1 in the map.
   ```cpp
   if (gen_enum_) {
         t_enum_value* enum_val = 
((t_enum*)type)->get_constant_by_value(int_val);
    --     out << type->get_name() << "." << enum_val->get_name();
    ++     out << type_name(type) << "." << enum_val->get_name();
   }
   ```



-- 
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