I submit another patch about the unit test of nmg_copy. The basic process of it is as following:
I try my best to demonstrate my understanding of the HACKING rules learned in the previous patch. Hope it's satisfying.
What's more, I write some compare functions for each level of nmg struct. According to the suggestion by Sean, I will move them into an independent file such as nmg_compare.c and perfect it (now, it's not complete) then.
As for the test result, you can see the 'testcase 3' fail because the 'nmg_clone_model' changes the order of regions in new model's r_hd. Append each region in the head of the list, so the order is reversed.(I guess it's for the performance.) It seems no problem in logic but I am not quite sure.