From 3ae546f97bf6c80627271c28943795175b97fdb9 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 14 Sep 2021 17:36:44 +0200 Subject: [PATCH] Use idlc/test/parser/conversion.tests in CustomTarget_unoidl/unoidl-write_test ...now that idlc is gone since "[API CHANGE] Remove deprecated idlc and regmerge from the SDK". (idlc implemented some dubious conversions from floating-point to integer types, which unoidl-write does not implement, so the original version of idlc/test/parser/conversion.tests was not usable in CustomTarget_unoidl/unoidl-write_test.) Change-Id: I3b69920dda24c54c9313cd5c2cd0c0fdd9951ca7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123614 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- idlc/test/parser/conversion.tests | 67 +++--------------------- unoidl/CustomTarget_unoidl-write_test.mk | 7 +++ 2 files changed, 15 insertions(+), 59 deletions(-) diff --git a/idlc/test/parser/conversion.tests b/idlc/test/parser/conversion.tests index 4f1d6bc7d3e9..4b9aede89a70 100644 --- a/idlc/test/parser/conversion.tests +++ b/idlc/test/parser/conversion.tests @@ -6,74 +6,23 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -EXPECT SUCCESS "conversion.tests 1": -constants C { - const byte C1 = -128.0; - const byte C2 = -127.9; - const byte C3 = 254.9; - const byte C4 = 255.0; - const short C5 = -32768.0; - const short C6 = -32767.9; - const short C7 = 32766.9; - const short C8 = 32767.0; - const unsigned short C9 = 0.0; - const unsigned short C10 = 0.1; - const unsigned short C11 = 65534.9; - const unsigned short C12 = 65535.0; - const long C13 = -2147483648.0; - const long C14 = -2147483647.9; - const long C15 = 2147483646.9; - const long C16 = 2147483647.0; - const unsigned long C17 = 0.0; - const unsigned long C18 = 0.1; - const unsigned long C19 = 4294967294.9; - const unsigned long C20 = 4294967295.0; - const hyper C21 = -9223372036854774784.0; // -0x7FFFFFFFFFFFFC00 = -0x1.FFFFFFFFFFFFFp62 - const hyper C22 = 9223372036854774784.0; // 0x7FFFFFFFFFFFFC00 = 0x1.FFFFFFFFFFFFFp62 - const unsigned hyper C23 = 0.0; - const unsigned hyper C24 = 0.1; - const unsigned hyper C25 = 18446744073709549568.0; // 0xFFFFFFFFFFFFF800 = 0x1.FFFFFFFFFFFFFp63 -}; +EXPECT FAILURE "conversion.tests 1": +constants C { const byte C1 = 0.0; }; EXPECT FAILURE "conversion.tests 2": -constants C { const byte C1 = -128.1; }; +constants C { const short C1 = 0.0; }; EXPECT FAILURE "conversion.tests 3": -constants C { const byte C1 = 255.1; }; +constants C { const unsigned short C1 = 0.0; }; EXPECT FAILURE "conversion.tests 4": -constants C { const short C1 = -32768.1; }; +constants C { const long C1 = 0.0; }; EXPECT FAILURE "conversion.tests 5": -constants C { const short C1 = 32767.1; }; +constants C { const unsigned long C1 = 0.0; }; EXPECT FAILURE "conversion.tests 6": -constants C { const unsigned short C1 = -0.1; }; +constants C { const hyper C1 = 0.0; }; EXPECT FAILURE "conversion.tests 7": -constants C { const unsigned short C1 = 65535.1; }; - -EXPECT FAILURE "conversion.tests 8": -constants C { const long C1 = -2147483648.1; }; - -EXPECT FAILURE "conversion.tests 9": -constants C { const long C1 = 2147483647.1; }; - -EXPECT FAILURE "conversion.tests 10": -constants C { const unsigned long C1 = -0.1; }; - -EXPECT FAILURE "conversion.tests 11": -constants C { const unsigned long C1 = 4294967295.1; }; - -EXPECT FAILURE "conversion.tests 12": -constants C { const hyper C1 = -9223372036854775808.0; }; // -0x8000000000000000 = -0x1p63 - -EXPECT FAILURE "conversion.tests 13": -constants C { const hyper C1 = 9223372036854775807.0; }; // 0x7FFFFFFFFFFFFFFF rounds up to 0x1p63 - -EXPECT FAILURE "conversion.tests 14": -constants C { const unsigned hyper C1 = -0.1; }; - -EXPECT FAILURE "conversion.tests 15": -constants C { const unsigned hyper C1 = 18446744073709551615.0; }; - // 0xFFFFFFFFFFFFFFFF rounds up to 0x1p64 +constants C { const unsigned hyper C1 = 0.0; }; diff --git a/unoidl/CustomTarget_unoidl-write_test.mk b/unoidl/CustomTarget_unoidl-write_test.mk index a1c17c488bc3..fc80f516c53d 100644 --- a/unoidl/CustomTarget_unoidl-write_test.mk +++ b/unoidl/CustomTarget_unoidl-write_test.mk @@ -18,6 +18,7 @@ $(call gb_CustomTarget_get_target,unoidl/unoidl-write_test) : \ $(SRCDIR)/idlc/test/parser/attribute.tests \ $(SRCDIR)/idlc/test/parser/constant.tests \ $(SRCDIR)/idlc/test/parser/constructor.tests \ + $(SRCDIR)/idlc/test/parser/conversion.tests \ $(SRCDIR)/idlc/test/parser/interfaceinheritance.tests \ $(SRCDIR)/idlc/test/parser/methodoverload.tests \ $(SRCDIR)/idlc/test/parser/polystruct.tests \ @@ -47,6 +48,12 @@ else 1 $(call gb_Executable_get_command,unoidl-write) $(SRCDIR)/udkapi \ {} \ $(call gb_CustomTarget_get_workdir,unoidl/unoidl-write_test)/out.rdb \ + && $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \ + $(SRCDIR)/idlc/test/parser/conversion.tests \ + $(call gb_CustomTarget_get_workdir,unoidl/unoidl-write_test)/in.idl \ + 1 $(call gb_Executable_get_command,unoidl-write) $(SRCDIR)/udkapi \ + {} \ + $(call gb_CustomTarget_get_workdir,unoidl/unoidl-write_test)/out.rdb \ && $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \ $(SRCDIR)/idlc/test/parser/interfaceinheritance.tests \ $(call gb_CustomTarget_get_workdir,unoidl/unoidl-write_test)/in.idl \