From 9bb7b610075df974fe31e95f2b43bf8c6f5a1c97 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sun, 17 Jun 2007 01:58:00 +0000 Subject: [PATCH] Add "absurdness" benchmark-generator Originally committed to SVN as r1229. --- automation/tests/gen-absurd-t-line.lua | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 automation/tests/gen-absurd-t-line.lua diff --git a/automation/tests/gen-absurd-t-line.lua b/automation/tests/gen-absurd-t-line.lua new file mode 100644 index 000000000..8bf0fac1e --- /dev/null +++ b/automation/tests/gen-absurd-t-line.lua @@ -0,0 +1,34 @@ +script_name = "Absurdness" +script_description = "Benchmark renderers by testing how they react to an absurd number of \\t tags in one line, and an absurd amount of lines each with a single \\t." +script_author = "jfs" + +absurd = 1000 + +ttext = "\\1a&H00&\\2a&H00&\\3a&H00&\\4a&H00&" + +function gen_one_absurd(subs, sel) + local l = subs[sel[1]] + l.text = "" + l.start_time = 0 + l.end_time = (absurd+1)*100 + for i = 1, absurd do + l.text = l.text .. string.format("{\\t(%d,%d,%s)}", i*100, (i+1)*100, ttext) + end + l.text = l.text .. "a" + subs[-sel[1]] = l + aegisub.set_undo_point("absurdness 1") +end + +function gen_absurd_many(subs, sel) + local l = subs[sel[1]] + for i = 1, absurd do + l.start_time = i*100 + l.end_time = (i+1)*100 + l.text = string.format("{\\t(0,100,%s)}a", ttext) + subs[-sel[1]] = l + end + aegisub.set_undo_point("absurdness 2") +end + +aegisub.register_macro("Generate absurd line", "Absurd", gen_one_absurd) +aegisub.register_macro("Generate absurdly many lines", "Absurd", gen_absurd_many)