Skip to content
  • Thomas Haller's avatar
    libnm/test: add unit test with consistency checks about NMSetting type info · d19a403f
    Thomas Haller authored
    Add test for checking the meta data for expected consistency.
    
    This is also useful if you want to check something about the meta data
    programatically.
    
    For example, if you have the question which (if any) properties
    are GObject based but also implement a to_dbus_fcn() function. Then you
    can extend this code with some simple printf debugging to get a list of
    those.
    
    Or, if you want to find how many NMSettInfoProperty instances are in
    static data (e.g. to determine how much memory is used). You can easily
    modify this code to count them (and find 447 properties). Out of these,
    326 are plain GObject based properties. Meaning, we could refactor the
    code to create smaller NMSettInfoProperty instances for those, saving
    thus (326 * 4 * sizeof (gpointer)) bytes (10K).
    
    Such questions are interesting when refactoring the code.
    d19a403f