Esempio n. 1
0
 public void SymUndefinedSymbols()
 {
     SymbolTable symtab = new SymbolTable();
     Symbol foo = symtab.CreateSymbol("foo");
     Symbol bar = symtab.CreateSymbol("bar");
     Symbol fred = symtab.DefineSymbol("fred", 0x10);
     Symbol [] undef = symtab.GetUndefinedSymbols();
     Assert.AreEqual(2, undef.Length);
     Assert.AreSame(bar, undef[0]);
     Assert.AreSame(foo, undef[1]);
 }
Esempio n. 2
0
 public void SymCreateSymbol()
 {
     SymbolTable symtab = new SymbolTable();
     Symbol sym = symtab.CreateSymbol("foo");
     StringWriter writer = new StringWriter();
     symtab.Write(writer);
     Assert.AreEqual(
     @"foo: unresolved 00000000 patches: 0 (foo)
     ", writer.ToString());
 }
Esempio n. 3
0
 public void SymResolveReference()
 {
     SymbolTable symtab = new SymbolTable();
     Symbol sym = symtab.CreateSymbol("foo");
     Symbol sym2 = symtab.DefineSymbol("foo", 3);
     StringWriter writer = new StringWriter();
     symtab.Write(writer);
     Assert.AreEqual(
     @"foo: resolved 00000003 patches: 0 (foo)
     ",
         writer.ToString());
 }