From 4fe536e65b2135bfb4604e1684b153b529251b71 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Wed, 25 Mar 2015 11:58:24 -0600 Subject: [PATCH] Add performance test for type conversions --- contrib/codeanalysis/type_conversions.chai | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 contrib/codeanalysis/type_conversions.chai diff --git a/contrib/codeanalysis/type_conversions.chai b/contrib/codeanalysis/type_conversions.chai new file mode 100644 index 0000000..298bddf --- /dev/null +++ b/contrib/codeanalysis/type_conversions.chai @@ -0,0 +1,22 @@ +load_module("test_module") + +auto t := TestBaseType(); + +// This uses the TestBaseType to Type2 user type +// conversion which was added in the module and then calls +// "get_val()" which exists on the Type2 type +//assert_equal(t.get_val(), 10); +//print("Made it past test 1"); + +var t2 := Type2(t); + +//dump_system(); + +for (var i = 0; i < 50000; ++i) { + var str = string(get_str(t2)); + size(get_str(t2)); + t2.get_str().size(); + t.get_str().size(); +} + +