Ask me about my source port
...Which is, of course proper. But, again, if any of those tests ARE true, you definitely do not have a Doom-format map, which is what I wanted to say. I've been using these tests in a home-brew lump editor/map viewer for many years now, as a primary method of detection. The 3rd test is practically guaranteed to be right, on all but the most trivial of maps. I suppose you could contrive one, but the test is really quite reliable. If you've worked with enough WAD files, you see all manners of crazy invalid shit - lumps skewed one byte, pieces of maps cut+pasted into different WADs, etc. I though we were discussing detection, and I guess I assumed that meant "above and beyond presence/absense of the BEHAVIOR lump", cause that's what I do, but, maybe not.
You can't really reliably use lumpsize % sizeof(struct) to detect map formats because of common multiples. For either struct size there will be multiples of them that are divisible by both possible structure sizes, so for those maps you're unable to eliminate either format as a possibility.
This is why all ports to date use the presence of BEHAVIOR to detect Hexen format, and require that BEHAVIOR never be placed after a Doom-format map.
Didn't realize Hexen things were 20 bytes (are you sure? wow - a wasted clause). Then again if not divisible by 10, you'd really have a problem... I wonder about Strife things (Quasar?) I must have used that test for something. I guess the test would be better reversed - then, at least it would find 50% of them!
There was a time when I wanted a way for software to identify which game/port a map needed to run on. That involved all manners of crazy things: Checking lump sizes, line triggers, things/thing flags, BEHAVIOR, etc. Can't say I really succeeded, though I was able to sort a whole lot of maps that way. Legacy had a neat idea with the "text in map identifier lump" thing, used for FraggleScript, I think. Oh well.