This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.
Holger Hans Peter Freyther holger at freyther.deOn Tue, May 06, 2014 at 07:35:57PM +0400, Ivan Kluchnikov wrote: hi, > + if ((int)gsm_auth_policy_parse(value) < 0) { > + return -1; > + } 1.) Coding-Style. 2.) The (int) cast is fishy. Most likely even undefined C usage. We have a int(-EINVAL) -> enum -> int conversion here. Add an invalid element to the enum, change the implementation to compare to -EINVAL... Then your verify call becomes a simple one liner and comparison against the invalid element. > + def testAuthPolicy(self): > + r = self.do_set('auth-policy', 'qwerty') > + self.assertEquals(r['mtype'], 'ERROR') > + self.assertEquals(r['error'], 'Value failed verification.') Check that the previous thing has not been changed. :)