Modified:
    trunk/atest/robot/standard_libraries/builtin/repeat_keyword.html
    trunk/src/robot/libraries/BuiltIn.py
Log:
Ooops, for/else construct works differently than i though... The else block  
is executed always unless for is exited with break (i.e. always in this  
case)! Updated tests to catch this and fixed the code.
Modified: trunk/atest/robot/standard_libraries/builtin/repeat_keyword.html
==============================================================================
--- trunk/atest/robot/standard_libraries/builtin/repeat_keyword.html	 
(original)
+++ trunk/atest/robot/standard_libraries/builtin/repeat_keyword.html	Tue  
Jan 13 03:22:55 2009
@@ -1,9 +1,7 @@
-
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="RobotIDE" />
+<html><head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta name="generator" content="RobotIDE">
  <style type="text/css">
  html {
    font-family: Arial,Helvetica,sans-serif;
@@ -56,16 +54,15 @@
    font-style: normal;
  }
  </style>
-<title>Repeat Keyword</title>
-</head>
+<title>Repeat Keyword</title></head>
+
+
  <body>
  <h1>Repeat Keyword</h1>
  <table border="1">
-<colgroup span="99">
-<col class="name">
-<col class="value" span="4"></colgroup>
-<tr>
+<colgroup span="99"><col class="name"><col class="value"  
span="4"></colgroup>
+<tbody><tr>
  <th>Setting</th>
  <th>Value</th>
  <th>Value</th>
@@ -107,13 +104,11 @@
  <td></td>
  <td></td>
  </tr>
-</table>
+</tbody></table>
  <table border="1">
-<colgroup span="99">
-<col class="name">
-<col class="value" span="4"></colgroup>
-<tr>
+<colgroup span="99"><col class="name"><col class="value"  
span="4"></colgroup>
+<tbody><tr>
  <th>Variable</th>
  <th>Value</th>
  <th>Value</th>
@@ -127,14 +122,11 @@
  <td></td>
  <td></td>
  </tr>
-</table>
+</tbody></table>
  <table border="1">
-<colgroup span="99">
-<col class="name">
-<col class="action">
-<col class="arg" span="3"></colgroup>
-<tr>
+<colgroup span="99"><col class="name"><col class="action"><col class="arg"  
span="3"></colgroup>
+<tbody><tr>
  <th>Test Case</th>
  <th>Action</th>
  <th>Argument</th>
@@ -386,14 +378,11 @@
  <td></td>
  <td></td>
  </tr>
-</table>
+</tbody></table>
  <table border="1">
-<colgroup span="99">
-<col class="name">
-<col class="action">
-<col class="arg" span="3"></colgroup>
-<tr>
+<colgroup span="99"><col class="name"><col class="action"><col class="arg"  
span="3"></colgroup>
+<tbody><tr>
  <th>Keyword</th>
  <th>Action</th>
  <th>Argument</th>
@@ -449,10 +438,10 @@
  <td></td>
  <td></td>
  </tr>
-<tr>
-<td></td>
-<td></td>
+<tr><td></td><td>Run Keyword If</td><td>${count} != 0</td><td>Should Be  
Equal As Integers</td><td>${kw.msg_count}</td></tr><tr>
  <td></td>
+<td>...</td>
+<td>0</td>
  <td></td>
  <td></td>
  </tr>
@@ -498,7 +487,6 @@
  <td></td>
  <td></td>
  </tr>
-</table>
+</tbody></table>
-</body>
-</html>
+</body></html>
\ No newline at end of file
Modified: trunk/src/robot/libraries/BuiltIn.py
==============================================================================
--- trunk/src/robot/libraries/BuiltIn.py	(original)
+++ trunk/src/robot/libraries/BuiltIn.py	Tue Jan 13 03:22:55 2009
@@ -796,11 +796,11 @@
          elif times.endswith('x'):
              times = times[:-1]
          times = self.convert_to_integer(times)
+        if times <= 0:
+            self.log("Keyword '%s' repeated zero times" % name)
          for i in xrange(times):
              self.log("Repeating keyword, round %d/%d" % (i+1, times))
              self.run_keyword(name, *args)
-        else:
-            self.log("Keyword '%s' repeated zero times" % name)
      def wait_until_keyword_succeeds(self, timeout, retry_interval, name,  
*args):
          """Waits until the specified keyword succeeds or the given timeout  
expires.