zoukankan      html  css  js  c++  java
  • ltp-ddt inverted_return小trick

    ./runtest/ddt/i2c_readwrite

    # @name I2C write read test on slave device
    # @desc I2C write read test on slave device
    # @notes There is a default slave device for each platform. Its address can be
    #    found in 'get_i2c_slave_addr'. If you pass slave device name, this
    #     script can return the addr for that slave device
    # @requires i2c

    I2C_S_FUNC_RW_SETGET source 'common.sh'; do_cmd i2c_setget.sh

    I2C_M_FUNC_RW_SETGET_10TIMES source 'common.sh'; do_cmd i2c_setget.sh -l '10'

    I2C_M_STRESS_RW_SETGET_100TIMES source 'common.sh'; do_cmd i2c_setget.sh -l '100'

    I2C_S_FUNC_NEG_INVALID_ADDR source 'common.sh'; invalid_addr=`get_i2c_invalid_addr.sh` && i2cbus_num=`get_i2cbus_number.sh` && i2c_reg=`get_i2c_slave_regoffset.sh` && inverted_return="true"; do_cmd i2cget -y $i2cbus_num $invalid_addr $i2c_reg

    注意:
    do_cmd i2cget -y $i2cbus_num $invalid_addr $i2c_reg 执行的结果是false,因为invalid_addr get的是invalid address

    当然,执行结果false是表示成功,所以要将return结果反向,即将inverted_return设置为true

    do_cmd function的说明如下;

    ########### FUNCTIONS #####################
    # Default value for inverted_return is "false" but can
    # be overridden by individual scripts.
    inverted_return="false"

    do_cmd() {  ......

  • 相关阅读:
    查看SQL Server被锁的表以及如何解锁【转】
    JQUERY的$(function(){})和window.onload=function(){}的区别【转】
    安装和使用Redis【转】
    RabbitMQ的简单应用【转】
    Redis集群的搭建【转】
    Spring--如何解决循环依赖
    分布式事务--2PC(两阶段提交)
    CAP理论
    JVM垃圾回收机制
    Redis面试题
  • 原文地址:https://www.cnblogs.com/idyllcheung/p/10689518.html
Copyright © 2011-2022 走看看