• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/uci/tests/shunit2/tests.d/070_revert

  1 revert_test_prepare() {
  2         touch ${CONFIG_DIR}/revert
  3         ${UCI} set revert.SEC0=section
  4         ${UCI} set revert.SEC0.option0=value0
  5         ${UCI} set revert.SEC0.option1='"Hello,
  6 '"  World\""
  7 }
  8 
  9 test_revert_section()
 10 {
 11         revert_test_prepare
 12         ${UCI} revert revert.SEC0
 13         assertSameFile "${REF_DIR}/revert_section.result" "$CHANGES_DIR/revert"
 14 }
 15 
 16 test_revert_option()
 17 {
 18         revert_test_prepare
 19         ${UCI} revert revert.SEC0.option0
 20         assertSameFile "${REF_DIR}/revert_option.result" "$CHANGES_DIR/revert"
 21 }
 22 
 23 test_revert_option_multiline()
 24 {
 25         revert_test_prepare
 26         ${UCI} revert revert.SEC0.option1
 27         assertSameFile "${REF_DIR}/revert_option_multiline.result" "$CHANGES_DIR/revert"
 28 }
 29 
 30 test_revert_option_long()
 31 {
 32         local val="$(head -c 8192 < /dev/zero | tr '\0' 'a')"
 33         local res
 34 
 35         touch ${CONFIG_DIR}/p
 36 
 37         ${UCI} set p.s=sec
 38         ${UCI} set p.s.o="$val"
 39 
 40         res="$(${UCI} changes)"
 41         assertEquals "p.s='sec'
 42 p.s.o='$val'" "$res"
 43 
 44         ${UCI} revert p
 45         res="$(${UCI} changes)"
 46         assertEquals "" "$res"
 47 }

This page was automatically generated by LXR 0.3.1.  •  OpenWrt