Author: sebastien.lelong
Date: Sun Jun 7 02:21:42 2009
New Revision: 1035
Modified:
trunk/test/unittest/16f877_adc.jalt
Log:
unittests PCFG bits combinations for 16f877
Modified: trunk/test/unittest/16f877_adc.jalt
==============================================================================
--- trunk/test/unittest/16f877_adc.jalt (original)
+++ trunk/test/unittest/16f877_adc.jalt Sun Jun 7 02:21:42 2009
@@ -92,16 +92,6 @@
test_byte(adcon0_temp) ;@assertEquals 0 test_compute_tad_adcs
-;@jallib testcase test_combination_0vref_1an
-;@jallib use pic_20MHz
-;@jallib use self_test
-const bit ADC_HIGH_RESOLUTION = true
-const byte ADC_NCHANNEL = 5
-const byte ADC_NVREF = 1
-include adc
-adc_init()
-
-
;@jallib testcase test_right_justification
;@jallib use pic_20MHz
;@jallib use self_test
@@ -124,4 +114,112 @@
adc_init()
var byte adcon1_temp = ADCON1 & 0b_1000_0000
test_byte(adcon1_temp) ;@assertEquals 0 test_right_justified
+
+
+;@jallib testcase test_combo_0vref_1an
+;@jallib use pic_20MHz
+;@jallib use self_test
+const bit ADC_HIGH_RESOLUTION = true
+const byte ADC_NCHANNEL = 1
+const byte ADC_NVREF = 0
+include adc
+adc_init()
+var byte adcon1_temp = ADCON1 & 0b_0000_1111 -- should be 0b_1110 = 14
+test_byte(adcon1_temp) ;@assertEquals 14 test_pcfg_combo
+
+
+;@jallib testcase test_combo_0vref_3an
+;@jallib use pic_20MHz
+;@jallib use self_test
+const bit ADC_HIGH_RESOLUTION = true
+const byte ADC_NCHANNEL = 3
+const byte ADC_NVREF = 0
+include adc
+adc_init()
+var byte adcon1_temp = ADCON1 & 0b_0000_1111 -- should be 0b_0100 = 4
+test_byte(adcon1_temp) ;@assertEquals 4 test_pcfg_combo
+
+
+;@jallib testcase test_combo_0vref_5an
+;@jallib use pic_20MHz
+;@jallib use self_test
+const bit ADC_HIGH_RESOLUTION = true
+const byte ADC_NCHANNEL = 5
+const byte ADC_NVREF = 0
+include adc
+adc_init()
+var byte adcon1_temp = ADCON1 & 0b_0000_1111 -- should be 0b_0010 = 2
+test_byte(adcon1_temp) ;@assertEquals 2 test_pcfg_combo
+
+
+;@jallib testcase test_combo_0vref_6an
+;@jallib use pic_20MHz
+;@jallib use self_test
+const bit ADC_HIGH_RESOLUTION = true
+const byte ADC_NCHANNEL = 6
+const byte ADC_NVREF = 0
+include adc
+adc_init()
+var byte adcon1_temp = ADCON1 & 0b_0000_1111 -- should be 0b_1001 = 9
+test_byte(adcon1_temp) ;@assertEquals 9 test_pcfg_combo
+
+
+;@jallib testcase test_combo_0vref_8an
+;@jallib use pic_20MHz
+;@jallib use self_test
+const bit ADC_HIGH_RESOLUTION = true
+const byte ADC_NCHANNEL = 8
+const byte ADC_NVREF = 0
+include adc
+adc_init()
+var byte adcon1_temp = ADCON1 & 0b_0000_1111 -- should be 0b_0000 = 0
+test_byte(adcon1_temp) ;@assertEquals 0 test_pcfg_combo
+
+
+;@jallib testcase test_combo_1vref_6an
+;@jallib use pic_20MHz
+;@jallib use self_test
+const bit ADC_HIGH_RESOLUTION = true
+const byte ADC_NCHANNEL = 6
+const byte ADC_NVREF = 1
+include adc
+adc_init()
+var byte adcon1_temp = ADCON1 & 0b_0000_1111 -- should be 0b_1010 = 10
+test_byte(adcon1_temp) ;@assertEquals 10 test_pcfg_combo
+
+
+;@jallib testcase test_combo_1vref_8an
+;@jallib use pic_20MHz
+;@jallib use self_test
+const bit ADC_HIGH_RESOLUTION = true
+const byte ADC_NCHANNEL = 8
+const byte ADC_NVREF = 1
+include adc
+adc_init()
+var byte adcon1_temp = ADCON1 & 0b_0000_1111 -- should be 0b_0001 = 1
+test_byte(adcon1_temp) ;@assertEquals 1 test_pcfg_combo
+
+
+;@jallib testcase test_combo_2vref_3an
+;@jallib use pic_20MHz
+;@jallib use self_test
+const bit ADC_HIGH_RESOLUTION = true
+const byte ADC_NCHANNEL = 3
+const byte ADC_NVREF = 2
+include adc
+adc_init()
+var byte adcon1_temp = ADCON1 & 0b_0000_1111 -- should be 0b_1111 = 15
+test_byte(adcon1_temp) ;@assertEquals 15 test_pcfg_combo
+
+
+;@jallib testcase test_combo_2vref_8an
+;@jallib use pic_20MHz
+;@jallib use self_test
+const bit ADC_HIGH_RESOLUTION = true
+const byte ADC_NCHANNEL = 8
+const byte ADC_NVREF = 2
+include adc
+adc_init()
+var byte adcon1_temp = ADCON1 & 0b_0000_1111 -- should be 0b_0000 = 8
+test_byte(adcon1_temp) ;@assertEquals 8 test_pcfg_combo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---