From ee41276366ea8627463f1b5c49307fe3970b006c Mon Sep 17 00:00:00 2001 From: fenrir Date: Wed, 27 Mar 2024 15:44:57 +0900 Subject: [PATCH] Improve tests to check both LPP and RRLP protocols --- spec/gps_pvt/supl_spec.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/spec/gps_pvt/supl_spec.rb b/spec/gps_pvt/supl_spec.rb index d96232b..29c3140 100644 --- a/spec/gps_pvt/supl_spec.rb +++ b/spec/gps_pvt/supl_spec.rb @@ -28,12 +28,13 @@ before{ # skip "SUPL_URI and external ephemeris source (EX_EPH_SRC) are required by ENV" unless ['SUPL_URI', 'EPH_SRC'].all?{|k| ENV[k]} } - let(:supl_uri){ - ENV['SUPL_URI'] || 'supl://supl.google.com/'#?protocol=llp/rrlp' + let(:supl_uri_base){ + ENV['SUPL_URI'] || 'supl://supl.google.com/' } let(:eph_src){ ENV['EX_EPH_SRC'] || 'ntrip://test%40example.com:none@rtk2go.com:2101/RTCM3EPH' } + shared_examples "per_url" do it "can acquire the same ephemeris as the other methods" do $stderr.print "Connecting #{supl_uri} ..." agps = URI::parse(supl_uri).open.get_assisted_data @@ -132,4 +133,14 @@ Thread::new{rcv.send(func, src_cmp, &proc{})}.join } rescue nil end + end + + describe "with LPP protocol" do + let(:supl_uri){"#{supl_uri_base}?protocol=lpp"} + include_examples "per_url" + end + describe "with RRLP protocol" do + let(:supl_uri){"#{supl_uri_base}?protocol=rrlp"} + include_examples "per_url" + end end