summaryrefslogtreecommitdiff
path: root/decoders/edid
diff options
context:
space:
mode:
authorBert Vermeulen <bert@biot.com>2013-12-10 17:17:38 +0100
committerBert Vermeulen <bert@biot.com>2013-12-10 17:22:24 +0100
commitfbd226c3f70f20fdf3cbfd43a671bf2bcc5d23e6 (patch)
tree7372a8e8b359b38a1a542a16fe14dd9058d5bded /decoders/edid
parent4d2c7619ec72728dd01999f20ef1004e018d18a4 (diff)
downloadlibsigrokdecode-fbd226c3f70f20fdf3cbfd43a671bf2bcc5d23e6.tar.gz
libsigrokdecode-fbd226c3f70f20fdf3cbfd43a671bf2bcc5d23e6.zip
Add protocol decoder testing framework.
This adds a tool in the tests directory, called pdtest. It uses the "test/" directory in every PD directory, if present, to run the PD against dumps found in the sigrok-dumps repository, and compares the output against ".output" files in the "test/" directory. The file "test/test.conf" is used to configure which tests to run. A separate tool (tests/runtc.c) is used to run the actual decoding and report output. To get an overview of the options, run tests/pdtest without any options.
Diffstat (limited to 'decoders/edid')
-rw-r--r--decoders/edid/config1
-rw-r--r--decoders/edid/pd.py4
-rw-r--r--decoders/edid/test/samsung_le46b620r3p_fields.output49
-rw-r--r--decoders/edid/test/samsung_le46b620r3p_sections.output3
-rw-r--r--decoders/edid/test/test.conf8
5 files changed, 62 insertions, 3 deletions
diff --git a/decoders/edid/config b/decoders/edid/config
index 3b17972..44e1f35 100644
--- a/decoders/edid/config
+++ b/decoders/edid/config
@@ -1,2 +1 @@
extra-install pnpids.txt
-
diff --git a/decoders/edid/pd.py b/decoders/edid/pd.py
index 323834b..3b3536e 100644
--- a/decoders/edid/pd.py
+++ b/decoders/edid/pd.py
@@ -87,8 +87,8 @@ class Decoder(srd.Decoder):
optional_probes = []
options = {}
annotations = [
- ['EDID fields', 'EDID structure fields'],
- ['EDID sections', 'EDID structure sections'],
+ ['fields', 'EDID structure fields'],
+ ['sections', 'EDID structure sections'],
]
def __init__(self, **kwargs):
diff --git a/decoders/edid/test/samsung_le46b620r3p_fields.output b/decoders/edid/test/samsung_le46b620r3p_fields.output
new file mode 100644
index 0000000..ec0166b
--- /dev/null
+++ b/decoders/edid/test/samsung_le46b620r3p_fields.output
@@ -0,0 +1,49 @@
+6169-6456 edid: fields: "EDID header"
+6557-7248 edid: fields: "SAM (Samsung Electric Company)"
+7350-8027 edid: fields: "Product 0x0508"
+8128-9579 edid: fields: "Serial 0"
+9681-10459 edid: fields: "Manufactured week 48, 2008"
+11005-11292 edid: fields: "EDID version: 1.3"
+11393-11680 edid: fields: "Signal level standard: 01"
+11393-11680 edid: fields: "Supported syncs: separate syncs"
+11781-12459 edid: fields: "Physical size: 88x50cm"
+12560-12847 edid: fields: "Gamma: 2.20"
+12949-13237 edid: fields: "DPMS support: active off"
+12949-13237 edid: fields: "Display type: RGB color"
+12949-13237 edid: fields: "Generalized timing formula: not supported"
+13338-17124 edid: fields: "Chromacity red: X 0.640, Y 0.330"
+13338-17124 edid: fields: "Chromacity green: X 0.297, Y 0.598"
+13338-17124 edid: fields: "Chromacity blue: X 0.150, Y 0.060"
+13338-17124 edid: fields: "Chromacity white: X 0.312, Y 0.328"
+17225-18288 edid: fields: "Supported establised modes: 720x400@70Hz, 640x480@60Hz, 640x480@67Hz, 640x480@72Hz, 640x480@75Hz, 800x600@60Hz, 800x600@72Hz, 800x600@75Hz, 832x624@75Hz, 1024x768@60Hz, 1024x768@70Hz, 1024x768@75Hz, 1280x1024@75Hz, 1152x870@75Hz"
+18389-19453 edid: fields: "Supported standard modes: 1152x864@75Hz, 1280x800@60Hz, 1280x960@60Hz, 1280x1024@60Hz, 1440x900@60Hz, 1440x900@75Hz, 1680x1050@60Hz"
+24617-25295 edid: fields: "Pixel clock: 148.50 MHz"
+25396-26459 edid: fields: "Horizontal active: 1920"
+25784-26459 edid: fields: "Horizontal blanking: 280"
+26560-27632 edid: fields: "Vertical active: 1080"
+26950-27632 edid: fields: "Vertical blanking: 45"
+27734-29185 edid: fields: "Horizontal sync offset: 88"
+28122-29185 edid: fields: "Horizontal sync pulse width: 44"
+28510-29185 edid: fields: "Vertical sync offset: 4"
+28510-29185 edid: fields: "Vertical sync pulse width: 5"
+29286-30359 edid: fields: "Physical size: 886x498mm"
+31237-31523 edid: fields: "Flags: sync type digital separate (Vsync polarity positive, Hsync polarity positive)"
+31625-32305 edid: fields: "Pixel clock: 85.50 MHz"
+32407-33475 edid: fields: "Horizontal active: 1360"
+32795-33475 edid: fields: "Horizontal blanking: 432"
+33576-34645 edid: fields: "Vertical active: 768"
+33964-34645 edid: fields: "Vertical blanking: 27"
+34746-36198 edid: fields: "Horizontal sync offset: 64"
+35134-36198 edid: fields: "Horizontal sync pulse width: 112"
+35522-36198 edid: fields: "Vertical sync offset: 3"
+35522-36198 edid: fields: "Vertical sync pulse width: 6"
+36299-37373 edid: fields: "Physical size: 886x498mm"
+38251-38538 edid: fields: "Flags: sync type digital separate (Vsync polarity positive, Hsync polarity positive)"
+40593-40880 edid: fields: "Minimum vertical rate: 60Hz"
+40981-41268 edid: fields: "Maximum vertical rate: 75Hz"
+41369-41656 edid: fields: "Minimum horizontal rate: 30kHz"
+41757-42047 edid: fields: "Maximum horizontal rate: 81kHz"
+42148-42434 edid: fields: "Maximum pixel clock: 150MHz"
+45644-52565 edid: fields: "Model name: SAMSUNG"
+52666-52953 edid: fields: "Extensions present: 0"
+53054-53341 edid: fields: "Checksum: 155 (OK)"
diff --git a/decoders/edid/test/samsung_le46b620r3p_sections.output b/decoders/edid/test/samsung_le46b620r3p_sections.output
new file mode 100644
index 0000000..0d6ed8f
--- /dev/null
+++ b/decoders/edid/test/samsung_le46b620r3p_sections.output
@@ -0,0 +1,3 @@
+24617-31911 edid: sections: "Preferred timing descriptor"
+31625-38926 edid: sections: "Detailed timing descriptor"
+38639-45543 edid: sections: "Monitor range limits"
diff --git a/decoders/edid/test/test.conf b/decoders/edid/test/test.conf
new file mode 100644
index 0000000..aff116c
--- /dev/null
+++ b/decoders/edid/test/test.conf
@@ -0,0 +1,8 @@
+test tv
+ protocol-decoder i2c probe scl=0 probe sda=1
+ protocol-decoder edid
+ stack i2c edid
+ input i2c/edid/samsung_le46b620r3p.sr
+ output edid annotation class fields match samsung_le46b620r3p_fields.output
+ output edid annotation class sections match samsung_le46b620r3p_sections.output
+