// Copyright 2018 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // The go-ethereum library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see . package feed import ( "encoding/json" "reflect" "testing" "github.com/ethereum/go-ethereum/common/hexutil" ) // KV mocks a key value store type KV map[string]string func (kv KV) Get(key string) string { return kv[key] } func (kv KV) Set(key, value string) { kv[key] = value } func compareByteSliceToExpectedHex(t *testing.T, variableName string, actualValue []byte, expectedHex string) { if hexutil.Encode(actualValue) != expectedHex { t.Fatalf("%s: Expected %s to be %s, got %s", t.Name(), variableName, expectedHex, hexutil.Encode(actualValue)) } } func testBinarySerializerRecovery(t *testing.T, bin binarySerializer, expectedHex string) { name := reflect.TypeOf(bin).Elem().Name() serialized := make([]byte, bin.binaryLength()) if err := bin.binaryPut(serialized); err != nil { t.Fatalf("%s.binaryPut error when trying to serialize structure: %s", name, err) } compareByteSliceToExpectedHex(t, name, serialized, expectedHex) recovered := reflect.New(reflect.TypeOf(bin).Elem()).Interface().(binarySerializer) if err := recovered.binaryGet(serialized); err != nil { t.Fatalf("%s.binaryGet error when trying to deserialize structure: %s", name, err) } if !reflect.DeepEqual(bin, recovered) { t.Fatalf("Expected that the recovered %s equals the marshalled %s", name, name) } serializedWrongLength := make([]byte, 1) copy(serializedWrongLength[:], serialized) if err := recovered.binaryGet(serializedWrongLength); err == nil { t.Fatalf("Expected %s.binaryGet to fail since data is too small", name) } } func testBinarySerializerLengthCheck(t *testing.T, bin binarySerializer) { name := reflect.TypeOf(bin).Elem().Name() // make a slice that is too small to contain the metadata serialized := make([]byte, bin.binaryLength()-1) if err := bin.binaryPut(serialized); err == nil { t.Fatalf("Expected %s.binaryPut to fail, since target slice is too small", name) } } func testValueSerializer(t *testing.T, v valueSerializer, expected KV) { name := reflect.TypeOf(v).Elem().Name() kv := make(KV) v.AppendValues(kv) if !reflect.DeepEqual(expected, kv) { expj, _ := json.Marshal(expected) gotj, _ := json.Marshal(kv) t.Fatalf("Expected %s.AppendValues to return %s, got %s", name, string(expj), string(gotj)) } recovered := reflect.New(reflect.TypeOf(v).Elem()).Interface().(valueSerializer) err := recovered.FromValues(kv) if err != nil { t.Fatal(err) } if !reflect.DeepEqual(recovered, v) { t.Fatalf("Expected recovered %s to be the same", name) } } ches/2015Q1'>branches/2015Q1 FreeBSD Ports (https://github.com/freebsd/freebsd-ports)
aboutsummaryrefslogtreecommitdiffstats
path: root/news
Commit message (Expand)AuthorAgeFilesLines
* news/sabnzbdplus: Update to 3.7.0James French2022-11-083-4/+6
* devel/icu: update to 72.1Jan Beich2022-10-191-1/+1
* news/inn: Bump portrevisionKevin Bowling2022-10-101-1/+1
* news/inn: Enable embedded Python OPTION by defaultKevin Bowling2022-10-091-2/+2
* news/inn-current: Update to 20221004Kevin Bowling2022-10-092-4/+4
* news/py-sabyenc3: Update to 5.4.4Po-Chuan Hsieh2022-10-042-4/+4
* news/nntp: fix a compiler warningDirk Meyer2022-09-271-0/+18
* Fix WWW in parent/child portsTobias Kortkamp2022-09-118-9/+0
* Remove WWW lines that have been moved into MakefilesStefan Eßer2022-09-083-4/+0
* Move more WWW entries from pkg-descr files into MakefilesStefan Eßer2022-09-082-0/+2
* Remove WWW entries moved into port MakefilesStefan Eßer2022-09-0854-106/+0
* Add WWW entries to port MakefilesStefan Eßer2022-09-0854-0/+55
* news/newsstar: fix OpenSSL detection & cleanupsMatthias Andree2022-09-042-10/+14
* news/fidogate: mark BROKENDmitry Marakasov2022-09-011-0/+2
* news/sabnzbdplus: Update to 3.6.1James French2022-08-242-4/+4
* news/inn-current: Update to 20220812Kevin Bowling2022-08-162-4/+4
* news/suck: mark BROKEN for INNDirk Meyer2022-08-111-0/+1
* news/inn-current: Update to 2.8 CURRENT branch, snapshot 20220804Kevin Bowling2022-08-082-5/+5
* news/inn: Update to 2.7.0Kevin Bowling2022-08-083-36/+29
* news: remove 'Created by' linesTobias C. Berner2022-07-2048-96/+0
* news/inn-current: Update to 20220627Kevin Bowling2022-06-302-4/+4
* news/inn-current: Update to 20220614Kevin Bowling2022-06-182-4/+4
* news/py-sabyenc3: Update to 5.4.3Po-Chuan Hsieh2022-06-172-4/+4
* news/py-sabyenc3: Fix build on aarch64 (at least)Po-Chuan Hsieh2022-06-162-0/+26
* news/sabnzbdplus: Update to 3.6.0James French2022-06-103-5/+4
* news/py-sabyenc3: Update to 5.4.2Po-Chuan Hsieh2022-06-102-4/+5
* news/leafnode: update to 1.12.0Matthias Andree2022-05-273-13/+8
* news/inn-current: Update to 20220504Kevin Bowling2022-05-065-12/+15
* grimreaper: return mich's ports to the pool after safekeeping his ports bit.Rene Ladan2022-05-021-1/+1
* news/inn-current: Update to 20220420Kevin Bowling2022-04-244-7/+10
* news/nzbhydra2: Update to 4.3.0Daniel Shafer2022-04-123-638/+6
* textproc/libxml2: bump all LIB_DEPENDS consumersCharlie Li2022-04-111-1/+1
* devel/icu: update to 71.1Jan Beich2022-04-071-0/+1
* news/tin: Update to 2.6.1Kevin Bowling2022-04-043-15/+14
* news/sabnzbdplus: Update to 3.5.3James French2022-03-302-4/+4
* news/inn-current: Update to 20220324Kevin Bowling2022-03-292-4/+4
* textproc/libxml2: bump all dependenciesMatthias Fechner2022-03-261-0/+1
* news/sabnzbdplus: Update to 3.5.2James French2022-03-152-4/+4
* news/sabnzbdplus: Update to 3.5.1James French2022-03-082-4/+4
* news/inn-current: Update to 20220224Kevin Bowling2022-02-273-4/+6
* news/inn: Update to 2.6.5Kevin Bowling2022-02-274-86/+16
* news/inn-current: Update to 20220219Kevin Bowling2022-02-222-4/+4
* news/inn-current: Update to 20220209Kevin Bowling2022-02-204-20/+22
* news/sabnzbdplus: Update to 3.5.0James French2022-01-303-13/+14
* news/inn-current: Update to 20220119Kevin Bowling2022-01-242-4/+4
* news/inn-current: Update to 20220115Kevin Bowling2022-01-183-4/+7
* Fix CONFLICTS entries of multiple portsStefan Eßer2022-01-104-3/+5
* news/sabnzbdplus: update to 3.4.2Max Brazhnikov2022-01-104-74/+19
* news/inn-current: Update to 20211226Kevin Bowling2021-12-302-4/+4
* news/inn-current: Update to 20211221Kevin Bowling2021-12-243-6/+5
* news/inn-current: Update to 20211211Kevin Bowling2021-12-182-4/+4
* news/inn-current: Update to 20211205Kevin Bowling2021-12-093-10/+4
* all: return fjoe's ports to the poolRene Ladan2021-12-061-1/+1
* news/inn-current: Update to 20211120Kevin Bowling2021-11-253-4/+6
* */*: Remove redundant '-[0-9]*' from CONFLICTS_INSTALLStefan Eßer2021-11-242-2/+2
* news/inn-current: Update to 20211106Kevin Bowling2021-11-142-4/+4
* news/inn-current: Update to 20211031Kevin Bowling2021-11-022-4/+4
* */*: Remove redundant '-[0-9]*' from CONFLICTSStefan Eßer2021-10-292-2/+2
* devel/icu: update to 70.1Jan Beich2021-10-291-1/+1
* news/py-sabyenc3: Cosmetic changePo-Chuan Hsieh2021-10-251-1/+1
* news/inn-current: 20211019Kevin Bowling2021-10-215-6/+412
* *: fix tab vs. space issues, and comments according to the guide.Jimmy Olgeni2021-10-161-2/+2
* news/rntrack: fix typos in pkg-descr.Jimmy Olgeni2021-10-161-2/+3
* news/inn-current: Update to 20211003Kevin Bowling2021-10-162-4/+4
* *: Clean up some thingsTobias Kortkamp2021-10-121-4/+0
* INSTALLS_ICONS: retire the macro and rework the related dependenciesBaptiste Daroussin2021-10-111-1/+0
* news/inn-current: Update to 20211002Kevin Bowling2021-10-032-4/+4
* news/inn-current: Update to 20210922Kevin Bowling2021-09-252-4/+4
* news/inn-current: Update to 20210919Kevin Bowling2021-09-222-4/+4
* news/inn: Fix SQLite ovdb OPTION in inn-currentKevin Bowling2021-09-161-1/+1
* news/inn-current: Update snapshot and strategyKevin Bowling2021-09-162-6/+6
* news/inn-current: Update to 20210912 and fix subdirKevin Bowling2021-09-142-5/+5
* news/inn-current: Update to 20210910Kevin Bowling2021-09-132-4/+4
* news/inn-current: Fix CPE informationBernhard Froehlich2021-09-031-0/+2
* news/nzbget: Set new MAINTAINERAlexis Praga2021-09-011-1/+1
* news/newsx: Add CPE informationBernhard Froehlich2021-09-011-0/+1
* Cleanup: for ports under n* categories, drop redundant GH_* knobs.Alexey Dokuchaev2021-08-311-4/+1
* news/inn-current: Update to 20210829Kevin Bowling2021-08-312-4/+4
* news/leafnode: Add CPE informationBernhard Froehlich2021-08-301-1/+1
* news/nzbget: Add CPE informationBernhard Froehlich2021-08-301-1/+1
* news/pan: Prepare for glib 2.68.3Neel Chauhan2021-08-0325-0/+425
* news/rntrack: Put config files in dedicated directorySergey Anokhin2021-07-281-2/+2
* news/leafnode: pkg update: @unexec->@postunexecMatthias Andree2021-07-221-2/+2
* news/inn-current: Update to 20210718Kevin Bowling2021-07-202-4/+4
* news/inn-current: Update to 20210709Kevin Bowling2021-07-112-4/+4
* news/inn-current: Update to 20210630Kevin Bowling2021-07-022-4/+4
* news/nzbget: update to 21.1Fernando Apesteguía2021-06-254-32/+33
* news/inn-current: Update to 20210621Kevin Bowling2021-06-232-4/+4
* news/inn-current: Lower case port nameKevin Bowling2021-06-126-7/+7
* news/Makefile: unbreak INDEXAntoine Brodin2021-06-121-0/+1
* news/cleanfeed: Update to 20200402 and flavorsKevin Bowling2021-06-122-6/+15
* news/inn-CURRENT: New port to follow CURRENT snapsKevin Bowling2021-06-125-7/+70
* news/sabnzbdplus: Update to 3.3.0James French2021-06-012-4/+4
* news/pan: remove manual linking with -lgnuregexDmitry Marakasov2021-05-151-1/+1
* Deorbit RESTRICTED && NO_CDROM, part two.Mathieu Arnold2021-05-061-2/+6
* news/sabnzbdplus: Update to 3.2.1James French2021-05-054-12/+21
* *: reset lifanov's ports after safekeeping their ports bit.Rene Ladan2021-05-051-1/+1
* news/sabnzbdplus: use archivers/par2cmdlineRene Ladan2021-04-301-13/+14
* Remove expired ports:Rene Ladan2021-04-248-91/+0
* devel/icu: update to 69.1Jan Beich2021-04-091-0/+1
* One more small cleanup, forgotten yesterday.Mathieu Arnold2021-04-0719-19/+0
* all: Remove all other $FreeBSD keywords.Mathieu Arnold2021-04-06