Skip to content

Commit

Permalink
Remove override CCSID ability
Browse files Browse the repository at this point in the history
Signed-off-by: worksofliam <[email protected]>
  • Loading branch information
worksofliam committed Apr 10, 2024
1 parent 07bd1b1 commit abf6716
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
11 changes: 2 additions & 9 deletions src/api/IBMi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ export default class IBMi {
private runtimeCcsid: number = CCSID_SYSVAL;
/** User default CCSID is job default CCSID */
private userDefaultCCSID: number = 0;
/** override allows the API to hardcode a CCSID. Usually good for testing */
private overrideCcsid: number | undefined;

client: node_ssh.NodeSSH;
currentHost: string = ``;
Expand Down Expand Up @@ -1293,13 +1291,9 @@ export default class IBMi {
}
}

setOverrideCcsid(ccsid: number | undefined) {
this.overrideCcsid = ccsid;
}

getEncoding() {
const fallback = this.overrideCcsid !== undefined || ((this.runtimeCcsid < 1 || this.runtimeCcsid === 65535) && this.userDefaultCCSID > 0 ? true : false);
const ccsid = fallback ? (this.overrideCcsid || this.userDefaultCCSID) : this.runtimeCcsid;
const fallback = ((this.runtimeCcsid < 1 || this.runtimeCcsid === 65535) && this.userDefaultCCSID > 0 ? true : false);
const ccsid = fallback ? (this.userDefaultCCSID) : this.runtimeCcsid;
return {
fallback,
ccsid,
Expand All @@ -1312,7 +1306,6 @@ export default class IBMi {
origin: this.runtimeCcsidOrigin,
runtimeCcsid: this.runtimeCcsid,
userDefaultCCSID: this.userDefaultCCSID,
overrideCcsid: this.overrideCcsid,
};
}
}
7 changes: 0 additions & 7 deletions src/testing/encoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ import { getMemberUri } from "../filesystems/qsys/QSysFs";

export const EncodingSuite: TestSuite = {
name: `Encoding tests`,
after: async () => {
const connection = instance.getConnection();
connection?.setOverrideCcsid(undefined);
},

before: async () => {
const config = instance.getConfig()!;
assert.ok(config.enableSourceDates, `Source dates must be enabled for this test.`);
Expand All @@ -32,8 +27,6 @@ export const EncodingSuite: TestSuite = {

const tempLib = config!.tempLibrary;

connection?.setOverrideCcsid(37);

const file = `TEST37`;

await connection!.runCommand({ command: `CRTSRCPF FILE(${tempLib}/${file}) RCDLEN(112) CCSID(37)`, noLibList: true });
Expand Down

0 comments on commit abf6716

Please sign in to comment.