1 /* Sample code to dump all feature codes and their descriptions */
8 #include "../libgammu/gsmphones.h"
10 int single_test(const char *string
, GSM_Error expected
)
12 GSM_Feature features
[GSM_MAX_PHONE_FEATURES
+ 1];
15 real
= GSM_SetFeatureString(features
, string
);
17 if (real
!= expected
) {
18 printf("Failed parsing of %s (got %s, expected %s)\n", string
, GSM_ErrorString(real
), GSM_ErrorString(expected
));
24 int main(int argc
, char **argv
)
27 GSM_Debug_Info
*debug_info
;
29 debug_info
= GSM_GetGlobalDebug();
30 GSM_SetDebugFileDescriptor(stderr
, FALSE
, debug_info
);
31 GSM_SetDebugLevel("textall", debug_info
);
33 rc
|= single_test("CAL33, CAL52,SQWE", ERR_NONE
);
34 rc
|= single_test("CAL33, FOO,SQWE", ERR_BADFEATURE
);
35 rc
|= single_test("CAL33, NO_ATOBEX ,SQWE", ERR_NONE
);
38 ("CAL33, NO_ATOBEX ,SQWE, CAL33, NO_ATOBEX ,SQWE, CAL52,CAL33, NO_ATOBEX ,SQWE, CAL33, NO_ATOBEX ,SQWE, CAL52,CAL33, NO_ATOBEX ,SQWE, CAL33, NO_ATOBEX ,SQWE, CAL52",
44 /* Editor configuration
45 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: