[pypy-svn] r14406 - in pypy/dist/pypy/translator/c: . test

arigo at codespeak.net arigo at codespeak.net
Thu Jul 7 20:18:49 CEST 2005


Author: arigo
Date: Thu Jul  7 20:18:47 2005
New Revision: 14406

Added:
   pypy/dist/pypy/translator/c/test/test_extfunc.py
      - copied unchanged from r14405, pypy/dist/pypy/translator/c/test/test_fixedname.py
Removed:
   pypy/dist/pypy/translator/c/test/test_fixedname.py
Modified:
   pypy/dist/pypy/translator/c/extfunc_include.h
Log:
Cosmetics of file and macro names.


Modified: pypy/dist/pypy/translator/c/extfunc_include.h
==============================================================================
--- pypy/dist/pypy/translator/c/extfunc_include.h	(original)
+++ pypy/dist/pypy/translator/c/extfunc_include.h	Thu Jul  7 20:18:47 2005
@@ -9,19 +9,19 @@
 /* The functions below are mapped to functions from pypy.rpython.extfunctable
    by the pypy.translator.c.fixedname.EXTERNALS dictionary. */
 
-#define RPyString_GET_SIZE(rps)		((rps)->rs_chars.length)
-#define RPyString_AS_STRING(rps)	((rps)->rs_chars.items)
+#define RPyString_Size(rps)		((rps)->rs_chars.length)
+#define RPyString_AsString(rps)		((rps)->rs_chars.items)
 
 
 int LL_os_open(RPyString *filename, int flag, int mode)
 {
 	char buf[PATH_MAX];
-	int fd, error, namelen = RPyString_GET_SIZE(filename);
+	int fd, error, namelen = RPyString_Size(filename);
 	if (namelen >= PATH_MAX) {
 		error = ENAMETOOLONG;
 	}
 	else {
-		memcpy(buf, RPyString_AS_STRING(filename), namelen);
+		memcpy(buf, RPyString_AsString(filename), namelen);
 		buf[namelen] = 0;
 		fd = open(buf, flag, mode);
 		if (fd != -1)

Deleted: /pypy/dist/pypy/translator/c/test/test_fixedname.py
==============================================================================
--- /pypy/dist/pypy/translator/c/test/test_fixedname.py	Thu Jul  7 20:18:47 2005
+++ (empty file)
@@ -1,28 +0,0 @@
-import autopath
-from pypy.tool.udir import udir
-from pypy.translator.c.test.test_genc import compile
-
-
-def test_time_clock():
-    import time
-    def does_stuff():
-        return time.clock()
-    f1 = compile(does_stuff, [])
-    t0 = time.clock()
-    t1 = f1()
-    assert type(t1) is float
-    t2 = time.clock()
-    assert t0 <= t1 <= t2
-
-
-def test_os_open():
-    import os
-    tmpfile = str(udir.join('test_os_open.txt'))
-    def does_stuff():
-        fd = os.open(tmpfile, os.O_WRONLY | os.O_CREAT, 0777)
-        return fd
-
-    f1 = compile(does_stuff, [])
-    fd = f1()
-    os.close(fd)
-    assert os.path.exists(tmpfile)



More information about the Pypy-commit mailing list