Skip to content

Commit

Permalink
Change more uses of 'numFields()' in tests
Browse files Browse the repository at this point in the history
Signed-off-by: David Longnecker <[email protected]>
  • Loading branch information
dlongnecke-cray committed Jul 26, 2023
1 parent cade0f1 commit 33cf424
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion modules/standard/CommDiagnostics.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ module CommDiagnostics
var CommDiags = getCommDiagnostics();

// cache number of fields and store vector of whether field is active
param nFields = numFields(chpl_commDiagnostics);
param nFields = getNumFields(chpl_commDiagnostics);

// How wide should the column be for this field? A negative value
// indicates an unstable field. 0 indicates that the field should
Expand Down
6 changes: 3 additions & 3 deletions test/library/packages/csv/CSV.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module CSV {
if line.size == 0 then
continue;
const vals = line.split(sep);
for param i in 0..numFields(t)-1 {
for param i in 0..getNumFields(t)-1 {
getFieldRef(r, i) = vals[i]: getField(r, i).type;
}
if skipHeader {
Expand Down Expand Up @@ -158,9 +158,9 @@ module CSV {
use Reflection;
if !writing then compilerError("writing to a reading channel");

for param i in 0..<numFields(t) {
for param i in 0..<getNumFields(t) {
ch.write(getField(r, i));
if i != numFields(t)-1 then
if i != getNumFields(t)-1 then
ch.write(sep);
}
ch.writeln();
Expand Down
2 changes: 1 addition & 1 deletion test/llvm/alignment/check-align-padding.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extern proc getOffset(const ref base, const ref field): int(64);

proc printFieldOffsets(ref base: ?t) {
use Reflection;
for param i in 0..numFields(t)-1 {
for param i in 0..getNumFields(t)-1 {
writeln(getFieldName(base.type, i), ": ", getField(base, i).type:string, " = ", getOffset(base, getField(base, i)));
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/param/bharshbarg/refToGetFieldType.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const x = new R(int, real, 42);
const ref q = x.A;
writeln("q = ", q);

for param i in 0..<numFields(x.type) {
for param i in 0..<getNumFields(x.type) {
param name = getFieldName(x.type, i);
const ref val = getField(x, i);

Expand Down
2 changes: 1 addition & 1 deletion test/param/ferguson/fielderator-user-class.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class R {
}


assert(numFields(R) == 2);
assert(getNumFields(R) == 2);
assert(getFieldName(R, 0) == "x");

assert(getFieldIndex(R, "x") == 0);
Expand Down
2 changes: 1 addition & 1 deletion test/param/ferguson/fielderator-user.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ record R {
}


assert(numFields(R) == 2);
assert(getNumFields(R) == 2);
assert(getFieldName(R, 0) == "x");

assert(getFieldIndex(R, "x") == 0);
Expand Down
2 changes: 1 addition & 1 deletion test/types/partial/isFieldBound.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ record R {
proc main() {
type T = R(int, U=real, ?);

for param i in 0..<numFields(T) {
for param i in 0..<getNumFields(T) {
param name = getFieldName(T, i);
writeln("T.", name, ": ", isFieldBound(T, name));
}
Expand Down

0 comments on commit 33cf424

Please sign in to comment.