[smuxi: 38/111] Engine-Tests: added benchmarks for smartlinks
- From: Mirco M. M. Bauer <mmmbauer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [smuxi: 38/111] Engine-Tests: added benchmarks for smartlinks
- Date: Sun, 16 Feb 2014 13:16:37 +0000 (UTC)
commit 8de9428a58a94ae289b604cb7c84e5ebfdfa47d2
Author: Oliver Schneider <mail oli-obk de>
Date: Wed Jul 17 17:15:31 2013 +0200
Engine-Tests: added benchmarks for smartlinks
src/Engine-Tests/MessageParserTests.cs | 43 ++++++++++++++++++++++++++++++++
1 files changed, 43 insertions(+), 0 deletions(-)
---
diff --git a/src/Engine-Tests/MessageParserTests.cs b/src/Engine-Tests/MessageParserTests.cs
index 100833e..078ded7 100644
--- a/src/Engine-Tests/MessageParserTests.cs
+++ b/src/Engine-Tests/MessageParserTests.cs
@@ -77,5 +77,48 @@ namespace Smuxi.Engine
Assert.AreEqual(expectedMsg, actualMsg);
}
+
+ [Test]
+ public void BenchmarkLowerBound()
+ {
+ int howOften = 5000;
+ var nonurl = @"is this up to date? --> ";
+ var url = @"http://www.stack.nl/~jilles/irc/atheme-help/";
+ var withUrl = nonurl + url;
+ var withoutUrl = @"Generated Sat Dec 11 21:29:16 CET 2010 -- old";
+ var builder = new MessageBuilder();
+ for (int i = 0; i < howOften; ++i) {
+ builder.AppendText(nonurl);
+ builder.AppendUrl(url);
+ }
+ }
+
+ [Test]
+ public void BenchmarkWithUrl()
+ {
+ int howOften = 5000;
+ var nonurl = @"is this up to date? --> ";
+ var url = @"http://www.stack.nl/~jilles/irc/atheme-help/";
+ var withUrl = nonurl + url;
+ var withoutUrl = @"Generated Sat Dec 11 21:29:16 CET 2010 -- old";
+ var builder = new MessageBuilder();
+ for (int i = 0; i < howOften; ++i) {
+ builder.AppendMessage(withUrl);
+ }
+ }
+
+ [Test]
+ public void BenchmarkWithoutUrl()
+ {
+ int howOften = 5000;
+ var nonurl = @"is this up to date? --> ";
+ var url = @"http://www.stack.nl/~jilles/irc/atheme-help/";
+ var withUrl = nonurl + url;
+ var withoutUrl = @"Generated Sat Dec 11 21:29:16 CET 2010 -- old";
+ var builder = new MessageBuilder();
+ for (int i = 0; i < howOften; ++i) {
+ builder.AppendMessage(withoutUrl);
+ }
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]