Browse Source

Cleaned up some tests

Yentl Van Tendeloo 9 years ago
parent
commit
2ab12964c9
3 changed files with 1 additions and 74 deletions
  1. 0 44
      bootstrap/constructors.alc
  2. 0 29
      integration/test_constructors_al.py
  3. 1 1
      integration/utils.py

+ 0 - 44
bootstrap/constructors.alc

@@ -134,8 +134,6 @@ Action function construct_unknown():
 		construct_model()
 		log("Constructed model")
 		return construct_unknown()
-	elif (elem == "fundef"):
-		return construct_funcdef()
 	else:
 		log("ERROR: did not understand command " + cast_e2s(elem))
 
@@ -265,48 +263,6 @@ Action function construct_deref():
 	dict_add(this_element, "node", import_node(input()))
 	return this_element
 
-Action function construct_funcdef():
-	Action assign
-	Action resolve
-	Action constant
-	Action func
-	Element params
-
-	assign = create_value(!assign)
-	resolve = create_value(!resolve)
-	constant = create_value(!constant)
-	func = create_node()
-	params = create_node()
-	dict_add(assign, "var", resolve)
-	dict_add(assign, "value", constant)
-	dict_add(resolve, "var", input())
-	dict_add(constant, "node", func)
-	dict_add(func, "params", params)
-
-	Integer nrParams
-	nrParams = input()
-	Integer counter
-	counter = 0
-	Element param
-
-	String arg_names_decl
-	arg_names_decl = "abcdefghijklmnopqrstuvwxyz"
-
-	while (counter < nrParams):
-		param = create_node()
-		dict_add(params, string_get(arg_names_decl, counter), param)
-		output(param)
-		// Output each parameter in turn
-		counter = counter + 1
-
-	// Now add the body
-	dict_add(func, "body", construct_unknown())
-
-	if (input()):
-		dict_add(assign, "next", construct_unknown())
-
-	return assign
-
 Action function construct_break():
 	Action this_element
 	this_element = create_value(!break)

+ 0 - 29
integration/test_constructors_al.py

@@ -185,35 +185,6 @@ class TestConstructorsActionLanguage(unittest.TestCase):
                 ]
         self.assertTrue(run_barebone(flatten(commands) + ['123456'], ["123456"], 1))
 
-    def test_constructors_funcdecl(self):
-        commands = ['"declare"',
-                        1,
-                        'true',
-                    '"funcdef"', 1,
-                        '2',
-                        2,
-                        3,
-                        '"return"', 'true',
-                            '"call"',
-                                '"deref"', '"primitives/integer_addition"',
-                                '2',
-                                '"access"', '"resolve"', 2,
-                                '"access"', '"resolve"', 3,
-                                'false',
-                        'true',
-                    '"output"',
-                        '"call"',
-                            '"access"', '"resolve"', 1,
-                            '2',
-                            '"input"',
-                            '"input"',
-                            'false',
-                        'true',
-                    '"return"', 'true',
-                        '"const"', 'true',
-                ]
-        self.assertTrue(run_barebone(flatten(commands) + ['2', '5'], ["7"], 1))
-
     def test_constructors_continue(self):
         commands = ['"while"',
                         '"const"', 'true',

+ 1 - 1
integration/utils.py

@@ -274,7 +274,7 @@ def run_barebone(parameters, expected, interface="0", timeout=False, wait=False,
                         # Modelverse has already terminated, which isn't a good sign!
                         return False
 
-                    val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "username": username})), timeout=120).read()
+                    val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "username": username})), timeout=30).read()
                 except:
                     if timeout:
                         return True