MCPcopy Create free account
hub / github.com/dds-bridge/dds / IsValidNodeData

Method IsValidNodeData

library/tests/trans_table/test_utilities.cpp:308–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306}
307
308bool TestDataValidator::IsValidNodeData(const NodeCards& node)
309{
310 // Check bounds are reasonable
311 if (node.upper_bound < 0 || node.upper_bound > 13 ||
312 node.lower_bound < 0 || node.lower_bound > 13 ||
313 node.lower_bound > node.upper_bound) {
314 return false;
315 }
316
317 // Check suit/rank are in valid range
318 if (node.best_move_suit < 0 || node.best_move_suit >= DDS_SUITS ||
319 node.best_move_rank < 2 || node.best_move_rank > 14) {
320 return false;
321 }
322
323 // Check least_win values
324 for (int suit = 0; suit < DDS_SUITS; suit++) {
325 if (node.least_win[suit] < 0 || node.least_win[suit] > 14) {
326 return false;
327 }
328 }
329
330 return true;
331}
332
333bool TestDataValidator::IsValidTrickHand(int trick, int hand)
334{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected