Rocks depend. Occasionally you'll find one with heavy metals in it that will leach, bigger problem is with limestone containing rocks that will essentially dissolve slowly in soft water tanks, buffers them nicely to a pH of about 8.2, but not really ideal for many fish. Generally hard slates are good, as, generally, is granite. A relatively simple test is to put some good acid on a dry bit and see if it fizzes. People often suggest vinegar, but the results are less obvious than with things like limescale cleaner.
Wood is one of those interesting issues that you see a lot of answers on, often without first hand experience. The challenge is what you count as a good test. Tried and tested woods like mopani are great. Home collected hardwoods are often fine, but some toxins may not leech in different tanks, so even 1st hand experience isn't always 100%.
Personally I've used mopani with no trouble, as expected, oak with no trouble (and people regularly use the leaves), apple and pear with no problems. Elder makes for a good show but is a pain to get it to sink, leeches like a thing gone crazy and breaks down in about 2 years, so is better for shorter term scapes. Willow also floats a bit more than I like and breaks down over a few years, but doesn't leech so much. I've heard good things about hawthorne and heather. I have access to lots of ash, which I've heard conflicting reports on the toxicity of, but to be honest I've never found any good looking bits anyway.