Project

General

Profile

Bug #88

assignement to ARRAY [] OF UNSIGNED8

Added by Patrick Hunziker 10 months ago. Updated 10 months ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Category:
-

Description

Arrays of UNSIGNED8 seem still problem-ridden.
Are they sufficiently covered by test cases?

MODULE TestU8; 

TYPE Color=ARRAY [4] OF UNSIGNED8;

PROCEDURE {TEST} Do*;
VAR a,b: Color;
BEGIN
    a:=250; (*expected result [250,250,250,250] *)
    b:=[250,250,250,250];
END Do;

END TestU8.

History

#1 Updated by Patrick Hunziker 10 months ago

also failing:

MODULE TestU8; 

TYPE Color=ARRAY [4] OF UNSIGNED8;

PROCEDURE {TEST} Do*;
VAR a,b: Color;
BEGIN
    b:=[250,250,250,250];
    c:=b DIV 2 + b DIV 2;
    ASSERT(b=c);
END Do;

END TestU8.

#2 Updated by Patrick Hunziker 10 months ago

rather

MODULE TestU8; 

TYPE Color=ARRAY [4] OF UNSIGNED8;

PROCEDURE {TEST} Do*;
VAR a,b,c: Color;
BEGIN
    b:=[250,250,250,250];
    c:=b DIV 2 + b DIV 2;
    ASSERT(b=c);
END Do;

END TestU8.

#3 Updated by Felix Friedrich 10 months ago

The problem is that the array base does not contain operations for unsigned data types at all.

The assignment a := [250,250,250,250] works because it can be handled directly by the compiler while the assignment
a := 250 requires a call to the array base library.

To solve each appearing issue separately would not be a large work. To make it right and support all operations on all unsigned data types, however, is a major issue (as long as we cannot solve this sufficiently simply with templates).

#4 Updated by Felix Friedrich 10 months ago

  • Status changed from New to Feedback

Also available in: Atom PDF