Translation update done using Pootle.
[gammu.git] / tests / network-codes.c
blob157c267cadc16912caebc402076372c329a60418
1 /* Sample code to test network codes decoding */
3 #include <gammu.h>
4 #include <stdlib.h>
5 #include <stdio.h>
6 #include <string.h>
8 #include "../libgammu/gsmphones.h"
10 int single_test(const char *string, const char *expected)
12 const char *ret;
13 ret = GSM_GetNetworkName(string);
14 if (strcmp(DecodeUnicodeConsole(ret), expected) != 0) {
15 printf("Result %s did not match %s\n", DecodeUnicodeConsole(ret), expected);
16 return 1;
18 return 0;
21 int main(int argc, char **argv)
23 int rc = 0;
25 rc |= single_test("247 01", "LMT");
26 rc |= single_test("24701", "LMT");
27 rc |= single_test("99999", "GammuTel");
28 rc |= single_test("00000", "unknown");
30 return rc;
33 /* Editor configuration
34 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: