about summary refs log tree commit diff stats
path: root/042name.cc
Commit message (Expand)AuthorAgeFilesLines
* 4271 - bugfix unrelated to alloc-idsKartik Agaram2018-06-251-2/+5
* 4266 - space for alloc-id in heap allocationsKartik Agaram2018-06-241-19/+29
* 4262 - literal 'null'Kartik Agaram2018-06-171-1/+1
* 4258 - undo 4257Kartik Agaram2018-06-151-23/+15
* 4257 - abortive attempt at safe fat pointersKartik Agaram2018-06-151-15/+23
* 4256 - get rid of container metadata entirelyKartik Agaram2018-06-091-1/+1
* 4146Kartik K. Agaram2017-12-071-2/+0
* 4099Kartik K. Agaram2017-11-011-0/+7
* 3877Kartik K. Agaram2017-05-261-3/+3
* 3876Kartik K. Agaram2017-05-211-1/+1
* 3841Kartik K. Agaram2017-04-271-2/+2
* 3723Kartik K. Agaram2016-12-271-0/+9
* 3722Kartik K. Agaram2016-12-271-4/+14
* 3663 - fix a refcounting bug: '(type)' != 'type'Kartik K. Agaram2016-11-101-1/+5
* 3654Kartik K. Agaram2016-11-081-1/+3
* 3643Kartik K. Agaram2016-11-071-2/+2
* 3598 - 'use before set' errors were too crypticKartik K. Agaram2016-10-271-2/+2
* 3576Kartik K. Agaram2016-10-231-0/+2
* 3561Kartik K. Agaram2016-10-221-1/+1
* 3522Kartik K. Agaram2016-10-191-4/+4
* 3520Kartik K. Agaram2016-10-181-1/+0
* 3390Kartik K. Agaram2016-09-171-1/+1
* 3389Kartik K. Agaram2016-09-171-3/+3
* 3381Kartik K. Agaram2016-09-171-1/+1
* 3380Kartik K. Agaram2016-09-171-19/+19
* 3309Kartik K. Agaram2016-09-091-6/+4
* 3248Kartik K. Agaram2016-08-251-1/+2
* 3247Kartik K. Agaram2016-08-251-22/+24
* 3120Kartik K. Agaram2016-07-211-3/+3
* 3096Kartik K. Agaram2016-07-031-0/+1
* 3022Kartik K. Agaram2016-05-271-12/+3
* 3020 - names in chessboard testsKartik K. Agaram2016-05-261-0/+12
* 2990Kartik K. Agaram2016-05-201-6/+6
* 2955 - back to more refcount housekeepingKartik K. Agaram2016-05-121-1/+1
* 2898 - start filling in missing refcountsKartik K. Agaram2016-05-031-1/+1
* 2891 - precompute container sizes and offsetsKartik K. Agaram2016-05-021-1/+1
* 2864 - replace all address:shared with just addressKartik K. Agaram2016-04-241-2/+1
* 2861 - 'maybe-convert' no longer returns addressKartik K. Agaram2016-04-231-2/+4
* 2859 - rename 'get-address' to 'get-location'Kartik K. Agaram2016-04-231-2/+3
* 2831 - bugfix in static arraysKartik K. Agaram2016-04-131-0/+18
* 2830 - bring back deleted test from 2829Kartik K. Agaram2016-04-101-6/+7
* 2829 - issues while switching to 'put'Kartik K. Agaram2016-04-101-5/+5
* 2804 - support stashing arraysKartik K. Agaram2016-03-211-4/+7
* 2803Kartik K. Agaram2016-03-211-3/+3
* 2799 - new approach to undoing changes in testsKartik K. Agaram2016-03-201-4/+9
* 2773 - switch to 'int'Kartik K. Agaram2016-03-131-12/+12
* 2735 - define recipes using 'def'Kartik K. Agaram2016-03-081-11/+11
* 2718 - stop crashing on unknown spaceKartik K. Agaram2016-02-261-2/+16
* 2712Kartik K. Agaram2016-02-261-8/+8
* 2709Kartik K. Agaram2016-02-251-2/+0
o">:= "gbmor" out, _, err := registry.GetTwtxt(urls) if err != nil { t.Errorf("Couldn't set up test: %v\n", err) } statusmap, err := registry.ParseUserTwtxt(out, nick, urls) if err != nil { t.Errorf("Couldn't set up test: %v\n", err) } twtxtCache.AddUser(nick, urls, "", net.ParseIP("127.0.0.1"), statusmap) t.Run("Parsing Status Query", func(t *testing.T) { data, err := twtxtCache.QueryAllStatuses() if err != nil { t.Errorf("%v\n", err) } out := parseQueryOut(data) conv := strings.Split(string(out), "\n") if !reflect.DeepEqual(data, conv) { t.Errorf("Pre- and Post- parseQueryOut data are inequal:\n%#v\n%#v\n", data, conv) } }) } func Benchmark_parseQueryOut(b *testing.B) { initTestConf() urls := "https://gbmor.dev/twtxt.txt" nick := "gbmor" out, _, err := registry.GetTwtxt(urls) if err != nil { b.Errorf("Couldn't set up test: %v\n", err) } statusmap, err := registry.ParseUserTwtxt(out, nick, urls) if err != nil { b.Errorf("Couldn't set up test: %v\n", err) } twtxtCache.AddUser(nick, urls, "", net.ParseIP("127.0.0.1"), statusmap) data, err := twtxtCache.QueryAllStatuses() if err != nil { b.Errorf("%v\n", err) } b.ResetTimer() for i := 0; i < b.N; i++ { parseQueryOut(data) } } func Test_joinQueryOuts(t *testing.T) { first := []string{ "one", "two", "three", } second := []string{ "three", "four", "five", "six", } t.Run("Joining two string slices", func(t *testing.T) { third := joinQueryOuts(first, second) if len(third) != (len(first) + len(second) - 1) { t.Errorf("Was not combined or deduplicated properly\n") } fourth := make([]string, 6) for i := 0; i < len(first); i++ { fourth[i] = first[i] } for i := 1; i < len(second); i++ { fourth[2+i] = second[i] } if !reflect.DeepEqual(fourth, third) { t.Errorf("Output not deeply equal to manual construction\n") } }) } func Benchmark_joinQueryOuts(b *testing.B) { first := []string{ "one", "two", "three", } second := []string{ "three", "four", "five", "six", } for i := 0; i < b.N; i++ { joinQueryOuts(first, second) } } func Test_compositeStatusQuery(t *testing.T) { initTestConf() mockRegistry() t.Run("Composite Query Test", func(t *testing.T) { out1, err := twtxtCache.QueryInStatus("sqlite") if err != nil { t.Errorf("%v\n", err) } out2, err := twtxtCache.QueryInStatus("Sqlite") if err != nil { t.Errorf("%v\n", err) } out3, err := twtxtCache.QueryInStatus("SQLITE") if err != nil { t.Errorf("%v\n", err) } outro := make([]string, 0) outro = append(outro, out1...) outro = append(outro, out2...) outro = append(outro, out3...) out := dedupe(outro) data := compositeStatusQuery("sqlite", nil) if !reflect.DeepEqual(out, data) { t.Errorf("Returning different data.\nManual: %v\nCompositeQuery: %v\n", out, data) } }) } func Benchmark_compositeStatusQuery(b *testing.B) { initTestConf() statuses, _, _ := registry.GetTwtxt("https://gbmor.dev/twtxt.txt") parsed, _ := registry.ParseUserTwtxt(statuses, "gbmor", "https://gbmor.dev/twtxt.txt") _ = twtxtCache.AddUser("gbmor", "https://gbmor.dev/twtxt.txt", "1", net.ParseIP("127.0.0.1"), parsed) b.ResetTimer() for i := 0; i < b.N; i++ { compositeStatusQuery("sqlite", nil) } }