]> sigrok.org Git - libsigrok.git/blobdiff - tests/analog.c
tests: Fix test_analog_unit_to_string unit test.
[libsigrok.git] / tests / analog.c
index 6dd8299969e4e7425ef2e1d1cb3fcfde1a339078..22371857189e6551d4fdc89626ec3c24dd86c81a 100644 (file)
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <config.h>
@@ -198,11 +197,11 @@ START_TEST(test_analog_unit_to_string)
        struct sr_analog_encoding encoding;
        struct sr_analog_meaning meaning;
        struct sr_analog_spec spec;
-       const char *r[] = {" V RMS"};
+       const char *r[] = {"V RMS"};
 
        sr_analog_init_(&analog, &encoding, &meaning, &spec, 3);
 
-       for (i = -1; i < ARRAY_SIZE(r); i++) {
+       for (i = 0; i < ARRAY_SIZE(r); i++) {
                meaning.unit = SR_UNIT_VOLT;
                meaning.mqflags = SR_MQFLAG_RMS;
                ret = sr_analog_unit_to_string(&analog, &result);