Add TYPE_230X to baudrate test code
[libftdi] / test / baudrate.cpp
index d0e2cc4..fe6c63a 100644 (file)
@@ -102,6 +102,7 @@ static void test_baudrates(ftdi_context *ftdi, const map<int, calc_result> &baud
         case TYPE_R:
         case TYPE_2232C:
         case TYPE_BM:
+        case TYPE_230X:
             fractional_bits |= (calc_index & 0x001) ? 4 : 0;
             break;
         default:;
@@ -124,7 +125,7 @@ BOOST_AUTO_TEST_CASE(TypeAMFixedBaudrates)
     ftdi->type = TYPE_AM;
 
     map<int, calc_result> baudrates;
-    baudrates[183] = calc_result(183, 16383, 3, 48);
+    baudrates[183] = calc_result(183, 16383, 0, 48);
     baudrates[300] = calc_result(300, 10000, 0, 48);
     baudrates[600] = calc_result(600,  5000, 0, 48);
     baudrates[1200] = calc_result(1200, 2500, 0, 48);
@@ -141,12 +142,12 @@ BOOST_AUTO_TEST_CASE(TypeAMFixedBaudrates)
     baudrates[1000000] = calc_result(1000000, 3, 0, 48);
     baudrates[1090512] = calc_result(1000000, 3, 0, 48);
     baudrates[1090909] = calc_result(1000000, 3, 0, 48);
-    baudrates[1090910] = calc_result(1200000, 2, 1, 48);
+    baudrates[1090910] = calc_result(1000000, 3, 0, 48);
     baudrates[1200000] = calc_result(1200000, 2, 1, 48);
     baudrates[1333333] = calc_result(1333333, 2, 2, 48);
     baudrates[1411764] = calc_result(1411765, 2, 3, 48);
     baudrates[1500000] = calc_result(1500000, 2, 0, 48);
-    baudrates[2000000] = calc_result(2000000, 1, 0, 48);
+    baudrates[2000000] = calc_result(1500000, 2, 0, 48);
     baudrates[3000000] = calc_result(3000000, 0, 0, 48);
 
     test_baudrates(ftdi, baudrates);
@@ -159,6 +160,7 @@ BOOST_AUTO_TEST_CASE(TypeBMFixedBaudrates)
     test_types.push_back(TYPE_BM);
     test_types.push_back(TYPE_2232C);
     test_types.push_back(TYPE_R);
+    test_types.push_back(TYPE_230X);
 
     map<int, calc_result> baudrates;
     baudrates[183] = calc_result(183, 16383, 7, 48);