std::ostream & Symbol::print (std::ostream &out, int maxvals) const { out << Symbol::symtype_shortname(symtype()) << " " << typespec().string() << " " << name(); if (everused()) out << " (used " << firstuse() << ' ' << lastuse() << " read " << firstread() << ' ' << lastread() << " write " << firstwrite() << ' ' << lastwrite(); else out << " (unused"; out << (has_derivs() ? " derivs" : "") << ")"; if (symtype() == SymTypeParam || symtype() == SymTypeOutputParam) { if (has_init_ops()) out << " init [" << initbegin() << ',' << initend() << ")"; if (connected()) out << " connected"; if (connected_down()) out << " down-connected"; if (!connected() && !connected_down()) out << " unconnected"; if (renderer_output()) out << " renderer-output"; if (symtype() == SymTypeParam && ! lockgeom()) out << " lockgeom=0"; } out << "\n"; if (symtype() == SymTypeConst) { out << "\tconst: "; print_vals (out, maxvals); out << "\n"; } else if (symtype() == SymTypeParam || symtype() == SymTypeOutputParam) { if (valuesource() == Symbol::DefaultVal && !has_init_ops()) { out << "\tdefault: "; print_vals (out, maxvals); out << "\n"; } else if (valuesource() == Symbol::InstanceVal) { out << "\tvalue: "; print_vals (out, maxvals); out << "\n"; } } return out; }
static void dotest(void) { printf("Opening directory...\n"); openit(); printf("Running tests...\n"); /* read the whole directory */ firstread(); /* make sure eof behaves right */ readateof(); /* read all the filenames again by seeking */ readallonebyone(); /* try reading at eof */ doreadateof(); /* read a bunch of the filenames over and over again */ readallrandomly(); /* rewind and read the whole thing again, to make sure that works */ doreadat0(); /* do invalid reads */ dobadreads(); /* rewind again to make sure the invalid attempts didn't break it */ doreadat0(); printf("Closing directory...\n"); closeit(); }