@@ -750,22 +750,25 @@ TEST_F(BuiltinsTest, TestBytesConversions_string) {
750750
751751TEST_F (BuiltinsTest, TestDoubleConversions_double) {
752752 double ref = 100.1 ;
753- TestTypeConverts (builtin::kDouble , CelValue::CreateDouble (ref), 100.1 );
753+ TestTypeConverts (builtin::kDouble , CelValue::CreateDouble (ref),
754+ double {100.1 });
754755}
755756
756757TEST_F (BuiltinsTest, TestDoubleConversions_int) {
757758 int64_t ref = 100L ;
758- TestTypeConverts (builtin::kDouble , CelValue::CreateInt64 (ref), 100.0 );
759+ TestTypeConverts (builtin::kDouble , CelValue::CreateInt64 (ref), double { 100.0 } );
759760}
760761
761762TEST_F (BuiltinsTest, TestDoubleConversions_string) {
762763 std::string ref = " -100.1" ;
763- TestTypeConverts (builtin::kDouble , CelValue::CreateString (&ref), -100.1 );
764+ TestTypeConverts (builtin::kDouble , CelValue::CreateString (&ref),
765+ double {-100.1 });
764766}
765767
766768TEST_F (BuiltinsTest, TestDoubleConversions_uint) {
767769 uint64_t ref = 100UL ;
768- TestTypeConverts (builtin::kDouble , CelValue::CreateUint64 (ref), 100.0 );
770+ TestTypeConverts (builtin::kDouble , CelValue::CreateUint64 (ref),
771+ double {100.0 });
769772}
770773
771774TEST_F (BuiltinsTest, TestDoubleConversionError_stringInvalid) {
@@ -774,34 +777,36 @@ TEST_F(BuiltinsTest, TestDoubleConversionError_stringInvalid) {
774777}
775778
776779TEST_F (BuiltinsTest, TestDynConversions) {
777- TestTypeConverts (builtin::kDyn , CelValue::CreateDouble (100.1 ), 100.1 );
778- TestTypeConverts (builtin::kDyn , CelValue::CreateInt64 (100L ), 100L );
779- TestTypeConverts (builtin::kDyn , CelValue::CreateUint64 (100UL ), 100UL );
780+ TestTypeConverts (builtin::kDyn , CelValue::CreateDouble (100.1 ), double {100.1 });
781+ TestTypeConverts (builtin::kDyn , CelValue::CreateInt64 (100L ), int64_t {100L });
782+ TestTypeConverts (builtin::kDyn , CelValue::CreateUint64 (100UL ),
783+ uint64_t {100UL });
780784}
781785
782786TEST_F (BuiltinsTest, TestIntConversions_int) {
783- TestTypeConverts (builtin::kInt , CelValue::CreateInt64 (100L ), 100L );
787+ TestTypeConverts (builtin::kInt , CelValue::CreateInt64 (100L ), int64_t { 100L } );
784788}
785789
786790TEST_F (BuiltinsTest, TestIntConversions_Timestamp) {
787791 Timestamp ref;
788792 ref.set_seconds (100 );
789- TestTypeConverts (builtin::kInt , CelProtoWrapper::CreateTimestamp (&ref), 100L );
793+ TestTypeConverts (builtin::kInt , CelProtoWrapper::CreateTimestamp (&ref),
794+ int64_t {100L });
790795}
791796
792797TEST_F (BuiltinsTest, TestIntConversions_double) {
793798 double ref = 100.1 ;
794- TestTypeConverts (builtin::kInt , CelValue::CreateDouble (ref), 100L );
799+ TestTypeConverts (builtin::kInt , CelValue::CreateDouble (ref), int64_t { 100L } );
795800}
796801
797802TEST_F (BuiltinsTest, TestIntConversions_string) {
798803 std::string ref = " 100" ;
799- TestTypeConverts (builtin::kInt , CelValue::CreateString (&ref), 100L );
804+ TestTypeConverts (builtin::kInt , CelValue::CreateString (&ref), int64_t { 100L } );
800805}
801806
802807TEST_F (BuiltinsTest, TestIntConversions_uint) {
803808 uint64_t ref = 100 ;
804- TestTypeConverts (builtin::kInt , CelValue::CreateUint64 (ref), 100L );
809+ TestTypeConverts (builtin::kInt , CelValue::CreateUint64 (ref), int64_t { 100L } );
805810}
806811
807812TEST_F (BuiltinsTest, TestIntConversions_doubleIntMin) {
@@ -826,7 +831,7 @@ TEST_F(BuiltinsTest, TestIntConversionError_doubleIntMaxMinus512) {
826831 // value, but it will rountrip to a valid 64-bit integer.
827832 double range = std::numeric_limits<int64_t >::max () - 512 ;
828833 TestTypeConverts (builtin::kInt , CelValue::CreateDouble (range),
829- std::numeric_limits<int64_t >::max () - 1023 );
834+ int64_t { std::numeric_limits<int64_t >::max () - 1023 } );
830835}
831836
832837TEST_F (BuiltinsTest, TestIntConversionError_doubleNegRange) {
@@ -874,21 +879,24 @@ TEST_F(BuiltinsTest, TestIntConversionError_uintRange) {
874879
875880TEST_F (BuiltinsTest, TestUintConversions_double) {
876881 double ref = 100.1 ;
877- TestTypeConverts (builtin::kUint , CelValue::CreateDouble (ref), 100UL );
882+ TestTypeConverts (builtin::kUint , CelValue::CreateDouble (ref),
883+ uint64_t {100UL });
878884}
879885
880886TEST_F (BuiltinsTest, TestUintConversions_int) {
881887 int64_t ref = 100L ;
882- TestTypeConverts (builtin::kUint , CelValue::CreateInt64 (ref), 100UL );
888+ TestTypeConverts (builtin::kUint , CelValue::CreateInt64 (ref), uint64_t { 100UL } );
883889}
884890
885891TEST_F (BuiltinsTest, TestUintConversions_string) {
886892 std::string ref = " 100" ;
887- TestTypeConverts (builtin::kUint , CelValue::CreateString (&ref), 100UL );
893+ TestTypeConverts (builtin::kUint , CelValue::CreateString (&ref),
894+ uint64_t {100UL });
888895}
889896
890897TEST_F (BuiltinsTest, TestUintConversions_uint) {
891- TestTypeConverts (builtin::kUint , CelValue::CreateUint64 (100UL ), 100UL );
898+ TestTypeConverts (builtin::kUint , CelValue::CreateUint64 (uint64_t {100UL }),
899+ uint64_t {100UL });
892900}
893901
894902TEST_F (BuiltinsTest, TestUintConversionError_doubleNegRange) {
0 commit comments