From patchwork Thu Sep 10 15:57:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 3448 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4BnNp32GSwz3x3R for ; Thu, 10 Sep 2020 15:58:03 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4BnNp23fhgzw9; Thu, 10 Sep 2020 15:58:02 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4BnNp21v9vz2xms; Thu, 10 Sep 2020 15:58:02 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4BnNp051t4z2xCd; Thu, 10 Sep 2020 15:58:00 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4BnNnz5gWGzQv; Thu, 10 Sep 2020 15:57:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1599753480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=p+bn4OmeNGqsQ3lCUNWoeAGmbSo6YYMMFBNJnMeNmq8=; b=Rea8W56zcvc7waHyElv8Qb9eBdHUm/gSCR+Nssvuq562EWe8LVhPOMU+JyB0S8QWJbvu+d M2NB76JX1ZF0DWrl03QxctRJaNwByR6r+SGJT9dtZcPi3RE4f7I7zmP0xGnbPTyiPrvmPu xLF1zyylRFqaesmwhqEmEjThH+87iv96kaORT+oleEddtJvNzen1WGcuqTsOfawQ51ABqe JshHZd7h3dUAI3GpDJLRM7PDud6xD9f1t6Xnz70k5YD+L/Tcspc/5pIqPWSBX+9GjIh3qy AVrLJ0qpRClg/R3cCmtcaa08PZVgloaONJymW4ZeJO2yyNO3piUY0mOZgEVpTA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1599753480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=p+bn4OmeNGqsQ3lCUNWoeAGmbSo6YYMMFBNJnMeNmq8=; b=8BcNWOtzlZhMokbLtF7vZp1CJgartnoa7DclImniH4MV/X31kPGm58t7ZDE00LGUQ10f/r DygRvAyPhEp0c3CA== From: Stefan Schantl To: location@lists.ipfire.org Subject: [PATCH 1/4] perl: Add get_country_name() function. Date: Thu, 10 Sep 2020 17:57:44 +0200 Message-Id: <20200910155747.12553-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: location@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: development@lists.ipfire.org Errors-To: location-bounces@lists.ipfire.org Sender: "Location" This function can be used to get the stored name for a given country code. Signed-off-by: Stefan Schantl --- src/perl/Location.xs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/perl/Location.xs b/src/perl/Location.xs index 1cb2e21..dcf3f0d 100644 --- a/src/perl/Location.xs +++ b/src/perl/Location.xs @@ -243,6 +243,28 @@ lookup_asn(db, address) # # Get functions # +SV* +get_country_name(db, ccode) + struct loc_database* db; + char* ccode; + + CODE: + RETVAL = &PL_sv_undef; + + // Lookup country code + struct loc_country *country; + int err = loc_database_get_country(db, &country, ccode); + if(!err) { + // Extract the name for the given country code. + const char* country_name = loc_country_get_name(country); + RETVAL = newSVpv(country_name, strlen(country_name)); + + loc_country_unref(country); + } + + OUTPUT: + RETVAL + SV* get_continent_code(db, ccode) struct loc_database* db; From patchwork Thu Sep 10 15:57:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 3450 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4BnNp40zz1z3x3Y for ; Thu, 10 Sep 2020 15:58:04 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4BnNp337QczpV; Thu, 10 Sep 2020 15:58:03 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4BnNp32nlmz2yVt; Thu, 10 Sep 2020 15:58:03 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4BnNp2061Nz2xms; Thu, 10 Sep 2020 15:58:02 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4BnNp069SXzsW; Thu, 10 Sep 2020 15:58:00 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1599753481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8cFW66U6PvFp7/jssREhzlHtNqfEMPgCc6mZBtsWg90=; b=/1B/IX03Tw3jU0nQ2JRHC445/7abuWv8+vqCqZeLFJlWwc5p60oIZploGlmwHFQkA1/liI adAZ3yoAKi9OxjBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1599753481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8cFW66U6PvFp7/jssREhzlHtNqfEMPgCc6mZBtsWg90=; b=B1g8LheOWFryhrLXUNFd/QFixvp2gLPjbWdOucJicEjgv//l/fM3lplD7pDLaoc56OzcN/ K7zHm7DW1oAIepsgaw/ekR9Sp5PFOHC5R4982h0TpV23dhsXo3MNLZCPUK96jYsrvbQg7a 0whHXRJFLh4MWiV1YEN9FvjZHyFWAyVVciUV6YQaefkKARnromCdW3eLtnwMTqHBu3jFiE Mlf6KsvxgfhMM0J56aQh/QPypNUTin/Aqrc1VuhjAfI8S8+XbEinDmXaNWcML2Q1ViaVD9 aVLzir63TtsTDys2Vjz+uxlL+NKvBSGl2vUUpekf6Ds3ar5tfv0M7oumKwgbYQ== From: Stefan Schantl To: location@lists.ipfire.org Subject: [PATCH 2/4] python example script: Add country name and continent code. Date: Thu, 10 Sep 2020 17:57:45 +0200 Message-Id: <20200910155747.12553-2-stefan.schantl@ipfire.org> In-Reply-To: <20200910155747.12553-1-stefan.schantl@ipfire.org> References: <20200910155747.12553-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: location@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: development@lists.ipfire.org Errors-To: location-bounces@lists.ipfire.org Sender: "Location" Signed-off-by: Stefan Schantl --- examples/python/create-database.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/python/create-database.py b/examples/python/create-database.py index bf8838b..04b2dc3 100644 --- a/examples/python/create-database.py +++ b/examples/python/create-database.py @@ -22,6 +22,8 @@ with open(private_key_path, "r") as pkey: # Add a country c = w.add_country("DE") + c.continent_code = "EU" + c.name = "Germany" # Add an AS a = w.add_as(204867) From patchwork Thu Sep 10 15:57:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 3452 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4BnNp51yMcz3x3b for ; Thu, 10 Sep 2020 15:58:05 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4BnNp44Ztyz10F; Thu, 10 Sep 2020 15:58:04 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4BnNp44GMVz2xq4; Thu, 10 Sep 2020 15:58:04 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4BnNp26Np6z2yVt; Thu, 10 Sep 2020 15:58:02 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4BnNp228CyzQv; Thu, 10 Sep 2020 15:58:02 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1599753482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MHiYE3aJF4ckUbMd78N3cVcAYeqMJ3ElxS+WWmenB2M=; b=BAD8DoDVOh/HGB4f8IshIcf+CObNz01ABYDOBZZyVnSftRygVECXZkoMkwSLMsfNbpJDuj 13P3zic+VNf03XCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1599753482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MHiYE3aJF4ckUbMd78N3cVcAYeqMJ3ElxS+WWmenB2M=; b=eGjqTlGyv6oBnfpilXGGJRTOBzJuraSwYU1xvYOmAIXEjCYGkyEVLV6oh+qBC2dxWz6O6y grezO1EhNuTAUVMidmB7dP6AJQo4xt51gx6f40XeOkAbdySSng5K+sDqkUj/s1IiKn3xAw gh7rZd6LrH4lX3CTaVNPG6V9rX57N4kXSPrqvQChHIBlwRkHJbDv5ZTd0PD+1P+aKrmi9n QAuiqISml9j00wIei1+mpm0o06PCowLhoPLOTIf8OY+WeONAwdVZ+boX2v5jVwNmoINxGW 256FCNCdvhsCgjeFod0F+xY9HHefurRkVxZaG6fYo972k78MzqqOEzfHmtTdNQ== From: Stefan Schantl To: location@lists.ipfire.org Subject: [PATCH 3/4] perl: Add test for get_country_name() function. Date: Thu, 10 Sep 2020 17:57:46 +0200 Message-Id: <20200910155747.12553-3-stefan.schantl@ipfire.org> In-Reply-To: <20200910155747.12553-1-stefan.schantl@ipfire.org> References: <20200910155747.12553-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: location@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: development@lists.ipfire.org Errors-To: location-bounces@lists.ipfire.org Sender: "Location" Signed-off-by: Stefan Schantl --- src/perl/t/Location.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/perl/t/Location.t b/src/perl/t/Location.t index a82bbb1..c922a94 100644 --- a/src/perl/t/Location.t +++ b/src/perl/t/Location.t @@ -12,7 +12,7 @@ use warnings; my $testdb = $ENV{'database'}; my $keyfile = $ENV{'keyfile'}; -use Test::More tests => 10; +use Test::More tests => 11; BEGIN { use_ok('Location') }; ######################### @@ -65,3 +65,6 @@ ok(@locations != 0, "Test 11 - Get database countries."); my $network_flag_anycast = &Location::lookup_network_has_flag($db, $address, "LOC_NETWORK_FLAG_ANYCAST"); ok($network_flag_anycast, "Network has Anycast flag."); + +my $country_name = &Location::get_country_name($db, "DE"); +ok($country_name eq "Germany", "Test 13 - Got country name: $country_name"); From patchwork Thu Sep 10 15:57:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 3454 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4BnNp62lm1z3x3k for ; Thu, 10 Sep 2020 15:58:06 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4BnNp473Ljz10Q; Thu, 10 Sep 2020 15:58:04 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4BnNp454cbz30Vt; Thu, 10 Sep 2020 15:58:04 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4BnNp30j37z2yVt; Thu, 10 Sep 2020 15:58:03 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4BnNp257Sbzxl; Thu, 10 Sep 2020 15:58:02 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1599753482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fOG1zopDf/YZyiP8enrNgo/EbJ/gM51/Fy0MpApPnkQ=; b=nG3ZhCLZ53uZTex7aRo77M+J4FQhvpgF4HDLbdPTyE1qm4vAz0XwBPy1//YK+Id5vkGkdl Rbl+F5GQ4qVPzNDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1599753482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fOG1zopDf/YZyiP8enrNgo/EbJ/gM51/Fy0MpApPnkQ=; b=XDGRRBCgZ/5Z9f0k6Z/QvP4y0V2jhVGl/Kqe6cOsZZIvzn0Rws4cV8g6YLOPeWGMxqdk++ tgjyrMxXeRgf7mn0bTIuO1QVE2os9FFjHezY0EDNMr3ikN/exX66BGYcRjN6hxt8ah5Mz3 yoR/5mD7Mu9cWFLqwHWpIakwATmlziQrGX4PmcjyEb2NG2oLD/LNtqV1kmRDDJ9gtPavSz rZ1ByFBSH1+Kpt4GfnXW6e6Tx3EQ+lBtRPGouaMHYrU/W3OXQehK47arIWNVnYUg2fUBMT k03ej/YPSTWnR3U7deC06QBWZD63QUr+s4OBbyPOtPtb7hjdtv7+GdQOhgvCRg== From: Stefan Schantl To: location@lists.ipfire.org Subject: [PATCH 4/4] perl: Add test for get_continent_code() function. Date: Thu, 10 Sep 2020 17:57:47 +0200 Message-Id: <20200910155747.12553-4-stefan.schantl@ipfire.org> In-Reply-To: <20200910155747.12553-1-stefan.schantl@ipfire.org> References: <20200910155747.12553-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: location@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: development@lists.ipfire.org Errors-To: location-bounces@lists.ipfire.org Sender: "Location" Signed-off-by: Stefan Schantl --- src/perl/t/Location.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/perl/t/Location.t b/src/perl/t/Location.t index c922a94..e256aec 100644 --- a/src/perl/t/Location.t +++ b/src/perl/t/Location.t @@ -12,7 +12,7 @@ use warnings; my $testdb = $ENV{'database'}; my $keyfile = $ENV{'keyfile'}; -use Test::More tests => 11; +use Test::More tests => 12; BEGIN { use_ok('Location') }; ######################### @@ -68,3 +68,6 @@ ok($network_flag_anycast, "Network has Anycast flag."); my $country_name = &Location::get_country_name($db, "DE"); ok($country_name eq "Germany", "Test 13 - Got country name: $country_name"); + +my $continent_code = &Location::get_continent_code($db, "DE"); +ok($continent_code eq "EU", "Test 14 - Got continent code $continent_code for country code 'DE'");