aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


server/gamedata/banks_test.go (641B)


      1 package gamedata
      2 
      3 import "testing"
      4 
      5 func TestBankTerminalsMatchOriginalPlacements(t *testing.T) {
      6 	terminal, exists := BankTerminals[0xc00502c1]
      7 
      8 	if len(BankTerminals) != 201 || !exists || terminal.Playfield != 705 || terminal.Position != [3]float32{985, 20.2001, 580} {
      9 		t.Fatal("original bank-terminal placement changed")
     10 	}
     11 	for id, terminal := range BankTerminals {
     12 		if id&65535 != terminal.Playfield {
     13 			t.Fatalf("terminal %08x belongs to playfield %d", id, terminal.Playfield)
     14 		}
     15 		if _, exists := Playfields[terminal.Playfield]; !exists {
     16 			t.Fatalf("bank terminal references unknown playfield %d", terminal.Playfield)
     17 		}
     18 	}
     19 }