BendTests.A03_LayerManagerTests.ValueCheckerThread.doValidate C# (CSharp) Метод

doValidate() публичный Метод

public doValidate ( ) : void
Результат void
            public void doValidate()
            {
                int count = 0;
                while (true) {
                    try {
                        RecordKey key = new RecordKey().appendParsedKey(key_to_check);
                        RecordData data;
                        num_checks++;
                        if (db.getRecord(key, out data) != GetStatus.PRESENT) {
                            num_errors++;
                            System.Console.WriteLine("!!!!! ValueCheckerThread ERROR: key(" + key_to_check + ") not present.");
                        } else {
                            if (!data.ReadDataAsString().Equals(value_to_expect)) {
                                num_errors++;
                                System.Console.WriteLine("!!!!! ValueCheckerThread ERROR: key(" + key_to_check +
                                    ") value mismatch, " + data.ReadDataAsString() + " != " + value_to_expect);
                            }
                            // check the contents
                        }
                    } catch (Exception e) {
                        System.Console.WriteLine("!!!!! Exception in ValueCheckerThread {0}, {1}", key_to_check, e.ToString());
                        num_errors++;
                    }
                    if (should_end) {
                        is_ended = true;
                        return;
                    }
                    // sleep every Nth iteration
                    if (count++ > 10) {
                        count = 0;
                        Thread.Sleep(0);
                    }
                }
            }
A03_LayerManagerTests.ValueCheckerThread