[geofence] Update testcases, tests passing. Reduce expand around Japan to stop telem in NK. Add UTF-8 ✓ and ✗ in testcases :)

main-solar-only
Richard Meadows 2016-02-05 20:34:03 +00:00
rodzic b1c21577dd
commit 0d50114af6
10 zmienionych plików z 402 dodań i 378 usunięć

Wyświetl plik

@ -10,7 +10,7 @@
#include "samd20.h"
const int32_t* telemetry_outlines[10];
const uint32_t telemetry_outline_lengths[10];
const int32_t* telemetry_outlines[14];
const uint32_t telemetry_outline_lengths[14];
#endif /* GEOFENCE_TELEMETRY_H */

Wyświetl plik

@ -12,298 +12,276 @@
/* Longitude, Latitude */
const int32_t telemetry_outline_1[] = {
-988629, 31349600,
1224825, 31711035,
3147805, 32748883,
9439656, 39958495,
13656908, 37258059,
16407968, 34565679,
18206006, 33828991,
19939777, 33547968,
21623039, 33680475,
23204881, 34217536,
27591062, 37345676,
30504799, 37560762,
32903027, 38850406,
35296843, 41595444,
36232658, 44836127,
36088495, 46766091,
35530797, 48528514,
34563050, 50122443,
33189992, 51492357,
33996255, 53282209,
34392377, 55318898,
34361381, 57549532,
33905062, 59815408,
35863950, 62070200,
37179397, 66025548,
39308823, 70561481,
40108824, 76950324,
39983665, 86000000,
39255096, 86000000,
38109968, 86000000,
36460007, 86000000,
34701730, 86000000,
29032624, 86000000,
23067250, 86000000,
10093625, 86000000,
7807659, 86000000,
6040763, 86000000,
4340959, 86000000,
4104502, 75601030,
1347295, 72553861,
-1501676, 73371416,
-2759221, 86000000,
-5139724, 86000000,
-7585616, 86000000,
-10673069, 86000000,
-12417587, 86000000,
-14046011, 86000000,
-15070112, 78379360,
-15585558, 72617800,
-15275468, 66438787,
-13648477, 62031250,
-15219352, 59822116,
-16160525, 57770898,
-16920652, 52599520,
-16414832, 48906473,
-14516016, 46047764,
-15222530, 43323099,
-15044920, 35595609,
-13572621, 33121647,
-10982432, 31634395,
-9197436, 31352336,
-999999, 31349591,
-989615, 32266048,
1012315, 32626707,
2702773, 33653740,
8187437, 39927411,
9079296, 41906049,
10614762, 40316636,
14414771, 37995874,
16762253, 35496503,
19758772, 34501497,
21328401, 34585098,
22807606, 35099197,
27173590, 38431862,
30019789, 38458094,
32345972, 39723724,
34441671, 42200183,
35203324, 45159873,
34980720, 46942168,
34332233, 48526915,
31647123, 51295297,
32813724, 53163236,
33359575, 55461872,
33244436, 57969878,
32457778, 60696676,
34964957, 62977971,
36286624, 67291103,
37685643, 69524731,
38622237, 72808415,
39091234, 83830734,
37891227, 86000000,
36088194, 86000000,
34043357, 86000000,
29682108, 86000000,
23049078, 86000000,
10025412, 86000000,
7714825, 86000000,
6082081, 86000000,
5117741, 82828556,
5335267, 73608691,
2954474, 71852217,
1512849, 69779144,
-412373, 70914661,
-2495382, 70349632,
-2811474, 76120029,
-4086361, 85675264,
-6087055, 86000000,
-8264996, 86000000,
-11110551, 86000000,
-13249343, 82728129,
-14407907, 74297848,
-14430887, 67955195,
-20904709, 67206040,
-22948694, 68047154,
-24955816, 66775451,
-25292687, 65778742,
-25101464, 64554217,
-22836287, 62482635,
-18608359, 62049622,
-13211846, 63760698,
-12100176, 62167442,
-15100734, 57477625,
-15631237, 55525579,
-15880778, 52584981,
-15299403, 48979099,
-14369933, 47459306,
-13119490, 46333057,
-13867228, 44882855,
-14182822, 43317928,
-14186549, 36776116,
-13794228, 35150397,
-12387483, 33388228,
-10258328, 32403441,
-999999, 32266038,
};
const int32_t telemetry_outline_2[] = {
};
const int32_t telemetry_outline_3[] = {
-92315063, 9537271,
-89929285, 9846787,
-87799516, 10848263,
-85018966, 13699125,
-83535877, 14445742,
-82417790, 15417399,
-80378696, 19384345,
-77962129, 20034693,
-75599871, 21501286,
-74300436, 23122766,
-73668470, 24967586,
-73516571, 26949868,
-74052152, 29277173,
-71706217, 30515260,
-70347780, 31665766,
-69416866, 33152292,
-68933933, 35109421,
-67182935, 35602084,
-65702266, 36499262,
-63858600, 39008306,
-62330642, 40155292,
-61272399, 41560452,
-60463270, 44350941,
-60862943, 47269621,
-62994840, 51641729,
-65556380, 54006704,
-67576949, 54740678,
-70481579, 54762674,
-72247509, 53928908,
-73808998, 52447620,
-75860636, 52121920,
-78591249, 50745833,
-81434188, 53062551,
-86503840, 55533037,
-88089741, 55908471,
-90906345, 55805926,
-94499576, 57143324,
-97153991, 56738163,
-123591847, 56793582,
-124355483, 59823355,
-125859672, 62858531,
-132333940, 69344417,
-134485245, 70862520,
-134885012, 75382391,
-135650902, 80697603,
-136767701, 86000000,
-138300135, 86000000,
-142732422, 86000000,
-156394730, 86000000,
-162647484, 86000000,
-167789369, 86000000,
-170271937, 86000000,
-171930205, 79188237,
-174869476, 76338552,
-176607899, 72493773,
-178604886, 66365850,
-179285325, 63684088,
-179608510, 60709440,
-180000000, 60497701,
-180000000, 44347118,
-178754179, 44347118,
-172114824, 44753618,
-167725548, 45487301,
-163513768, 46731606,
-161718513, 46736549,
-158042240, 47307924,
-156472849, 47914050,
-154419228, 47972740,
-150366220, 49561779,
-147983007, 51154909,
-146175789, 51375776,
-142426340, 51327255,
-140315741, 50880307,
-135028998, 47369064,
-133390574, 46967258,
-131144576, 47012059,
-130669514, 45155079,
-131075262, 43106392,
-130884517, 40010018,
-130346247, 37785339,
-129261731, 35658540,
-124883587, 29795620,
-124744181, 27758211,
-123660361, 25756355,
-121794421, 24287750,
-119195883, 23489655,
-118423732, 22917235,
-116968712, 21009594,
-117533732, 19522726,
-117539484, 18059200,
-116921226, 16524018,
-115913345, 15337499,
-114241453, 14316033,
-111907253, 13664418,
-109714359, 13709153,
-107558080, 14354223,
-100225909, 11291467,
-96304312, 10614822,
-94066133, 9725918,
-92326433, 9537263,
-92314460, 10327936,
-90249458, 10600852,
-88409914, 11499125,
-85777348, 14308935,
-84289960, 15006381,
-83221852, 15936681,
-81283172, 20100685,
-79243911, 20480663,
-77681519, 21125277,
-75584793, 22960568,
-74942993, 24180939,
-74543226, 26363662,
-75210187, 29714479,
-72383115, 31206753,
-71100503, 32307126,
-70150316, 34152819,
-69985593, 35968036,
-68029530, 36317200,
-66458135, 37173260,
-65341969, 38408403,
-64709297, 39702139,
-62990541, 40955325,
-61935008, 42593197,
-61507526, 44325319,
-61618999, 46104617,
-63647377, 50625516,
-64693025, 51880414,
-66168647, 52912944,
-69654423, 53570753,
-71637454, 52858309,
-73432751, 51165651,
-75638832, 50895455,
-78731829, 49237345,
-81780456, 51847069,
-86765976, 54221011,
-91059459, 54441297,
-94948855, 55775160,
-96974927, 55343899,
-123216337, 55431251,
-126338701, 54699632,
-128003075, 53638506,
-129467710, 51608246,
-130137038, 49222866,
-130085595, 46939590,
-129532414, 45193293,
-130042470, 42860693,
-129570554, 38639442,
-128365002, 36144020,
-125771781, 32777010,
-124966701, 31242973,
-123756850, 30158292,
-123792696, 28176337,
-122802603, 26244763,
-121095873, 24941902,
-118677312, 24298687,
-117544261, 23444045,
-116911869, 22337514,
-115698415, 21162352,
-116386185, 19853874,
-116562663, 18604625,
-116257162, 17380117,
-115437400, 16159895,
-113871384, 15077872,
-111614120, 14443546,
-109521994, 14572871,
-107451550, 15386136,
-106182706, 14592515,
-99918051, 12055149,
-97542034, 11489294,
-95957493, 11426835,
-94241105, 10607215,
-92324844, 10327928,
};
const int32_t telemetry_outline_4[] = {
180000000, 60497701,
180000000, 60497701,
180000000, 59555141,
180000000, 58022280,
180000000, 56079946,
180000000, 53842570,
180000000, 51468835,
180000000, 49496312,
180000000, 47761556,
180000000, 46419865,
180000000, 45449155,
180000000, 44347118,
};
const int32_t telemetry_outline_5[] = {
179297495, 44073758,
180000000, 44347499,
180000000, 60861330,
176391370, 60861330,
173650622, 62113745,
170550293, 61611632,
168115938, 59478686,
166597638, 56609973,
165966855, 53259120,
166330133, 50304961,
167646411, 47789404,
169118035, 46439266,
171468684, 45290783,
174813288, 45040062,
179286125, 44073725,
130514500, 29522844,
131667229, 30019641,
132394625, 32058425,
133173931, 32067808,
133776011, 32600134,
134462930, 32549119,
134946829, 32965598,
135950950, 32779112,
137500320, 33892204,
139635333, 33945183,
140951642, 34653056,
141665144, 35497919,
141456849, 36302046,
141827385, 37732055,
142797520, 39309565,
142265719, 41481720,
143439911, 41193941,
144300275, 42086597,
146385185, 42749519,
146657736, 43470798,
146088012, 44766111,
145325809, 45202378,
144578549, 44824443,
144073725, 44957327,
142172137, 46367583,
140554731, 46239101,
140148588, 45392633,
140854333, 44324949,
139889930, 43986450,
138602603, 42351141,
138698375, 41698750,
139296136, 41120560,
138910730, 39010150,
138282679, 39076271,
137459739, 38292470,
136345640, 38012459,
135342837, 36492006,
134205404, 36337549,
133837630, 36927822,
133182622, 37108691,
132565121, 36785908,
132368062, 36129651,
130294202, 34797391,
129923323, 35312264,
129298636, 35434779,
128583961, 34946835,
128355885, 34153901,
128552726, 33686250,
127985048, 33200752,
127832152, 32528056,
128216748, 32000789,
128915598, 31864468,
128945546, 31317460,
129685382, 30723335,
129759171, 29862484,
130511292, 29522826,
};
const int32_t telemetry_outline_6[] = {
-180000000, 44347499,
-180000000, 44347499,
-180000000, 45289554,
-180000000, 46650357,
-180000000, 48672745,
-180000000, 50763917,
-180000000, 53282417,
-180000000, 55542602,
-180000000, 57641408,
-180000000, 59399511,
-180000000, 60586353,
-180000000, 60861330,
};
const int32_t telemetry_outline_7[] = {
123843277, 18986192,
125491265, 19165631,
128214806, 19953309,
131574904, 21759615,
132983320, 22858668,
135610881, 26074956,
136072195, 24648262,
137108850, 23188421,
138436613, 22197629,
140130114, 21522541,
141877769, 21251328,
143652494, 21389255,
145469785, 21974010,
146889644, 22859750,
148290968, 24705883,
148719966, 27121005,
147805075, 29494914,
146042748, 31224410,
147194033, 34180464,
147408081, 35780405,
148157231, 37297199,
150389626, 38716219,
151779070, 40686114,
152344889, 42762057,
152188951, 44970018,
150660080, 48512523,
148386865, 50780025,
143116748, 52894970,
139298950, 52696757,
137305847, 51605024,
135743445, 49797759,
133398071, 44809434,
132894100, 42691470,
131000175, 42264829,
128714572, 40856144,
126434037, 40156341,
124887336, 39094191,
123802571, 37867097,
122158384, 33280814,
122203929, 31668969,
122775542, 30152428,
120263649, 29018544,
118581435, 27739458,
117539848, 26156497,
117140361, 24257617,
117646918, 22252339,
119152831, 20463023,
121209952, 19398018,
123831906, 18986175,
139828041, 32305292,
140440121, 32542523,
140703981, 33116067,
140429581, 33647846,
139785933, 33876134,
139181610, 33645124,
138938580, 33087581,
139190270, 32552224,
139824749, 32305283,
};
const int32_t telemetry_outline_8[] = {
};
const int32_t telemetry_outline_9[] = {
-155611011, 13847486,
-153998775, 14013737,
-152370777, 14524177,
-149489013, 16522621,
-148348299, 18759432,
-148674536, 21353754,
-149716393, 22885623,
-151299896, 24433044,
-152635063, 25385104,
-154869274, 26432967,
-158398197, 27572863,
-160262371, 27600674,
-161832509, 27296847,
-164251963, 26149738,
-166063718, 24291432,
-166779629, 22057311,
-166301057, 19894055,
-164774750, 18045627,
-163408930, 17262665,
-161696696, 16742813,
-159719729, 14915127,
-157611819, 14099023,
-155622381, 13847478,
127657066, 25403010,
128433568, 25700982,
129054288, 26413574,
129102418, 27017940,
130380452, 28017865,
130337036, 28958872,
129622516, 29226301,
128650357, 28804066,
128175679, 28214441,
128119896, 27565668,
127381462, 27212499,
126822911, 26098681,
127044279, 25624584,
127653785, 25403001,
};
const int32_t telemetry_outline_10[] = {
};
const int32_t telemetry_outline_11[] = {
142174256, 25920895,
142803574, 26149417,
143030082, 26704671,
142711186, 27234228,
142061038, 27423919,
141477420, 27177379,
141279198, 26666162,
141573805, 26131511,
142170974, 25920886,
};
const int32_t telemetry_outline_12[] = {
};
const int32_t telemetry_outline_13[] = {
123829321, 23584448,
124967916, 24107191,
125935330, 24196529,
126269958, 24811133,
125864739, 25367683,
125306802, 25553958,
123701077, 25097954,
123025280, 24739313,
122852883, 24231515,
123179608, 23744774,
123826029, 23584440,
};
const int32_t telemetry_outline_14[] = {
};
const int32_t* telemetry_outlines[] = {
telemetry_outline_1,
@ -316,17 +294,25 @@ const int32_t* telemetry_outlines[] = {
telemetry_outline_8,
telemetry_outline_9,
telemetry_outline_10,
telemetry_outline_11,
telemetry_outline_12,
telemetry_outline_13,
telemetry_outline_14,
};
const uint32_t telemetry_outline_lengths[] = {
62,
72,
0,
100,
12,
15,
12,
49,
72,
0,
23,
56,
0,
9,
0,
14,
0,
9,
0,
11,
0,
};

Wyświetl plik

@ -7,6 +7,7 @@
/* Checks the location is returning the right things etc. etc */
#include "location.h"
#include "aprs.h"
/* Parameters in */
struct location_aprs_tc_params {
@ -18,6 +19,7 @@ struct location_aprs_tc_results {
bool tx_allow;
double frequency;
char* prefix;
char* callsign;
} location_aprs_tc_results;
/* Function */
__verification__ void location_aprs_tc(void) {
@ -37,4 +39,5 @@ __verification__ void location_aprs_tc(void) {
location_aprs_tc_results.tx_allow = location_aprs_active();
location_aprs_tc_results.frequency = location_aprs_frequency();
location_aprs_tc_results.prefix = location_prefix();
location_aprs_tc_results.callsign = aprs_callsign(location_aprs_call());
}

Wyświetl plik

@ -1,4 +1,5 @@
#!/usr/bin/env python
# coding=utf-8
# ------------------------------------------------------------------------------
# Imports
@ -7,8 +8,10 @@
import sys
sys.path.append("./test")
import main
import re
from random import randint
from colorama import *
# ------------------------------------------------------------------------------
# Test Script
@ -55,7 +58,15 @@ class location_aprs_tc:
# What frequency did we return?
freq = float(result['frequency']) / (1000*1000)
prefix = result['prefix']
prefix_str = str(result['prefix'])
prefix = re.search('"(.*)"', prefix_str).group(1)
if prefix:
prefix = prefix + '/'
callsign_str = str(result['callsign'])
callsign = re.search('"(.*)"', callsign_str).group(1)
if str(result['tx_allow']).startswith('false'): # No APRS
if int(expected_freq) is 0:
@ -67,7 +78,8 @@ class location_aprs_tc:
return False
if freq == expected_freq:
print_info("{}[{}]: {:.3f} MHz".format(name, prefix, freq))
print_info("{} ".format(name) + Fore.YELLOW + "[{}]".format(prefix+callsign) +
Fore.RESET + ": {:.3f} MHz".format(freq) + Fore.GREEN + "")
return True
else:
print_info("{} ({:.1f}, {:.1f}): Expected {:.9f}, Geofence {:.9f}".format(

Wyświetl plik

@ -13,12 +13,13 @@ Romania,0,46,24
Sweden,0,58,12
Stockholm,0,59.3,18
Malmo,0,55.6,13
Mexico City,0,19.5,-99
Yemen,0,15,44
NK,0,39,126
# not allowed (144.39)
LA,0,34,-118
New York,0,41,-74
# 144.39, allowed under US license
LA,144.39,34,-118
New York,144.39,41,-74
# 144.8
Copenhagen,144.8,55.7,12.5

1 # name,frequency,lat,lon
13 Sweden,0,58,12
14 Stockholm,0,59.3,18
15 Malmo,0,55.6,13
16 Mexico City,0,19.5,-99
17 Yemen,0,15,44
18 NK,0,39,126
19 # not allowed (144.39) # 144.39, allowed under US license
20 LA,0,34,-118 LA,144.39,34,-118
21 New York,0,41,-74 New York,144.39,41,-74
22 # 144.8
23 Copenhagen,144.8,55.7,12.5
24 Amsterdam,144.8,52.4,5.7
25 Reykjavik,144.8,64.27,-21.57

Wyświetl plik

@ -1,4 +1,5 @@
#!/usr/bin/env python
# coding=utf-8
# ------------------------------------------------------------------------------
# Imports
@ -9,6 +10,7 @@ sys.path.append("./test")
import main
from random import randint
from colorama import *
# ------------------------------------------------------------------------------
# Test Script
@ -57,7 +59,8 @@ class location_telemetry_tc:
if tx_allow == expected_tx_allow:
print_info("{}: {}".format(name,
"Permitted" if tx_allow else "Not Permitted"))
"Permitted" + Fore.GREEN + "" if tx_allow else
"Not Permitted " + Fore.RED + ""))
return True
else:
print_info("{} ({:.1f}, {:.1f}): Expected {}, Geofence {}".format(

Wyświetl plik

@ -24,14 +24,15 @@ Mongolia,0,48,107
Vladivostok,0,43,132
Armenia,0,40,44
Africa,0,9,2
New York,0,41,-74
Canada,0,44,-76
South Korea,0,37,128
Japan,0,36,140
Thailand,0,14,100
South Korea,0,37,128
# The arko exception
LA,1,34,-118
New York,1,41,-74
Canada,1,44,-76
Japan,1,36,140
Mexico City,1,19.5,-99
Reykjavik,1,64.27,-21.57
# Not permitted
West China,0,39,80

1 # name,?,lat,lon
24 Armenia,0,40,44
25 Africa,0,9,2
26 New York,0,41,-74 Thailand,0,14,100
Canada,0,44,-76
South Korea,0,37,128
Japan,0,36,140
Thailand,0,14,100
27 # The arko exception South Korea,0,37,128
28 LA,1,34,-118
29 LA,1,34,-118 New York,1,41,-74
# Not permitted
30 West China,0,39,80 Canada,1,44,-76
31 Japan,1,36,140
32 Mexico City,1,19.5,-99
33 Reykjavik,1,64.27,-21.57
34 # Not permitted
35 West China,0,39,80
36 Beijing,0,40,116
37 Hong Kong,0,22.4,114.1
38 Yemen,0,15,44

Wyświetl plik

@ -28,15 +28,15 @@ class Tests():
def print_info(self, string):
"""Prints an info line"""
self.printf(Fore.CYAN + "INFO " + Fore.RESET + string)
self.printf(Fore.CYAN + "INFO " + Fore.RESET + string + Fore.RESET)
def print_good(self, string):
"""Prints an good line"""
self.printf(Fore.GREEN + "GOOD " + Fore.RESET + string)
self.printf(Fore.GREEN + "GOOD " + Fore.RESET + string + Fore.RESET)
def print_error(self, string):
"""Prints an error line"""
self.printf(Fore.RED + "ERROR " + Fore.RESET + string)
self.printf(Fore.RED + "ERROR " + Fore.RESET + string + Fore.RESET)
def print_centre(self, string):
"""Prints something in the centre of the line"""

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long