Commits

marcus  committed 5f98111

Added C API tests for base.Font class.

  • Participants
  • Parent commits 3a5e1e3
  • Branches pgreloaded

Comments (0)

Files changed (2)

File test/c_api/base_tests.c

     Py_DECREF (sf);
 }
 
+static void
+test_font (void)
+{
+    PyObject *font;
+    PyFont *ft;
+
+    font = PyFont_New ();
+    if (!PyFont_Check (font))
+        ERROR ("Font mismatch in PyFont_Check");
+    ft = (PyFont*) font;
+    if (!ft->get_height || !ft->get_name || !ft->get_style ||
+        !ft->set_style || !ft->get_size || !ft->render || !ft->copy)
+        ERROR ("Font is not properly initialised");
+    Py_DECREF (ft);
+}
+
 int
 main (int argc, char *argv[])
 {
     test_frect ();
     test_bufferproxy ();
     test_surface ();
+    test_font ();
     Py_Finalize ();
     return 0;
 }

File test/freetype_base_test.py

 
         # init () -> None
         # 
-        # Initializes the underlying FreeType 2 library.
-        # This method must be called before trying to use any of the functionality
+        # Initializes the underlying FreeType 2 library.  This method
+        # must be called before trying to use any of the functionality
         # of the 'freetype' module.
 
         # init()