emergency-call-types: Add emergency numbers from service provider db

This scales better than using a built in array.

Closes: https://gitlab.gnome.org/GNOME/calls/-/issues/714
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/790>
This commit is contained in:
Guido Günther
2025-09-07 17:43:29 +02:00
committed by Marge Bot
parent 8de3c90b66
commit 6f44a7c7fd
4 changed files with 28 additions and 8 deletions

View File

@@ -40,6 +40,11 @@ test_lookup (void)
/* Numbers that doesn't match */
lookup = calls_emergency_call_type_get_name ("123456", "DE");
g_assert_null (lookup);
/* Lookup from service provider db */
lookup = calls_emergency_call_type_get_name ("112", "yy");
g_assert_cmpstr (lookup, ==, "Police, Ambulance, Fire Brigade");
g_free (lookup);
}
int
@@ -49,7 +54,7 @@ main (int argc,
gint ret;
g_test_init (&argc, &argv, NULL);
calls_emergency_call_types_init ();
calls_emergency_call_types_init (TEST_DATABASE);
g_test_add_func ("/Calls/EmergencyCallTypes/lookup", test_lookup);