Skip to content

Commit fe9f752

Browse files
committed
More Tests
1 parent 83c7dfc commit fe9f752

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

tests/functional/WebIfcApi.spec.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ let expressId: number = 9989; // an IFCSPACE
1919
let geometries: Vector < FlatMesh > ; // to store geometries instead of refetching them
2020
let allGeometriesSize: number = 119;
2121
let meshesCount: number = 115;
22-
let totalLineNumber : number = 6489;
22+
let totalLineNumber : number = 6490;
2323
let emptyFileModelID: number;
24-
let lastExpressId : number = 14314;
24+
let lastExpressId : number = 14315;
2525
let expectedFileDescription : string = "ViewDefinition [CoordinationView_V2.0]";
2626
let expectedFileSchema = "IFC2X3";
2727
let expectedFileName = "3458";
@@ -125,7 +125,7 @@ describe('WebIfcApi reading methods', () => {
125125
expect(ifcApi.GetNextExpressID(modelID, 9)).toBe(11);
126126
})
127127
test('returns next expressID if it is the max ID', () => {
128-
expect(ifcApi.GetNextExpressID(modelID, 14313)).toBe(14314);
128+
expect(ifcApi.GetNextExpressID(modelID, 14314)).toBe(14315);
129129
})
130130
test('Can get max expressID', () => {
131131
const maxExpressId : number = ifcApi.GetMaxExpressID(modelID);
@@ -407,6 +407,15 @@ describe('WebIfcApi writing methods', () => {
407407
expect(line.expressID).toEqual(expressId);
408408
})
409409

410+
test('Read in IFCSTyle and Check it', () => {
411+
let aProp: any = ifcApi.GetLine(modelID, 14315);
412+
aProp.expressID = 150001;
413+
ifcApi.WriteLine(emptyFileModelID, aProp);
414+
let ifcDatas = ifcApi.SaveModel(emptyFileModelID);
415+
let exportModelID = ifcApi.OpenModel(ifcDatas);
416+
console.log(ifcApi.GetLine(exportModelID,150001).Sizeable === true);
417+
})
418+
410419
});
411420

412421
describe('WebIfcApi known failures', () => {
@@ -473,7 +482,7 @@ describe('some use cases', () => {
473482
describe('creating ifc', () => {
474483
test('can create new ifc model', () => {
475484
let createdID = ifcApi.CreateModel({schema: WebIFC.Schemas.IFC2X3});
476-
expect(createdID).toBe(5);
485+
expect(createdID).toBe(6);
477486
expect(ifcApi.GetModelSchema(createdID)).toBe(WebIFC.Schemas.IFC2X3);
478487
expect(ifcApi.wasmModule.GetModelSize(createdID)).toBeGreaterThan(0);
479488
expect(ifcApi.GetHeaderLine(createdID, WebIFC.FILE_NAME)['arguments'].length).toBe(7);
@@ -484,7 +493,7 @@ describe('creating ifc', () => {
484493

485494
test('can create & save new ifc model', () => {
486495
let createdID = ifcApi.CreateModel({schema: WebIFC.Schemas.IFC2X3});
487-
expect(createdID).toBe(6);
496+
expect(createdID).toBe(7);
488497
ifcApi.SaveModel(createdID);
489498
ifcApi.CloseModel(createdID);
490499
});
@@ -525,7 +534,7 @@ describe('opening large amounts of data', () => {
525534
};
526535
const exampleIFCData = fs.readFileSync(path.join(__dirname, '../ifcfiles/public/S_Office_Integrated Design Archi.ifc'));
527536
let modelId = ifcApi.OpenModel(exampleIFCData,s);
528-
expect(modelId).toBe(7);
537+
expect(modelId).toBe(8);
529538
});
530539

531540
test("open a small model but many times", () => {
@@ -553,7 +562,7 @@ describe('function based opening', () => {
553562
}
554563
let modelId = ifcApi.OpenModelFromCallback(retriever);
555564
fs.closeSync(file);
556-
expect(ifcApi.GetAllLines(modelId).size()).toBe(6489);
565+
expect(ifcApi.GetAllLines(modelId).size()).toBe(6490);
557566
});
558567
});
559568

tests/ifcfiles/public/example.ifc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6514,6 +6514,7 @@ DATA;
65146514
#14312= IFCPRESENTATIONLAYERASSIGNMENT('S-FNDN-____-OTLN',$,(#913,#2234,#2298,#2409,#2476,#9414,#9628,#9700,#13811),$);
65156515
#14313= IFCPOSTALADDRESS($,$,$,$,(''),$,'',$,'','Unknown');
65166516
#14314=IFCPROPERTYLISTVALUE('ListValue IfcInteger multi',$,(IFCINTEGER(-200),IFCINTEGER(-100),IFCINTEGER(0),IFCINTEGER(100),IFCINTEGER(200)),$);
6517+
#14315=IFCWINDOWSTYLE('2C0fafuFn0nQji3L0rllPh',#41,'xyz',$,$,(#14688,#14744,#14747),(#14687),'4600958',.NOTDEFINED.,.NOTDEFINED.,.F.,.F.);
65176518
ENDSEC;
65186519

65196520
END-ISO-10303-21;

0 commit comments

Comments
 (0)