value: Number.MAX_VALUE\r
},\r
\r
+ addBeginList: function (num) {\r
+ return ( this.beginList = {\r
+ value: num,\r
+ next: this.beginList\r
+ } );\r
+ },\r
+ \r
+ addEndList: function (num) {\r
+ return ( this.endList = {\r
+ value: num,\r
+ next: this.endList\r
+ } );\r
+ },\r
+ \r
/*引数に渡された時刻リストの中から、現在フレームf以下の、最大値を求めるメソッド\r
* -1を返したときはリストの中にf以下の値がないことを示す*/\r
getMaxList: function (f, list) {\r
expect(frame.currentFrame).toBe(1);\r
\r
expect(typeof frame.addEvent).toBe("function");\r
+ expect(typeof frame.addBeginList).toBe("function");\r
+ expect(typeof frame.addEndList).toBe("function");\r
+ \r
+ expect(frame.addBeginList(1).value).toBe(1);\r
+ expect(frame.beginList.next.value).toBe(Number.MAX_VALUE);\r
+ expect(frame.addEndList(1).value).toBe(1);\r
+ expect(frame.endList.next.value).toBe(Number.MAX_VALUE);\r
+ \r
+ expect(frame.addBeginList(1).value).toBe(1);\r
+ expect(frame.beginList.next.value).toBe(1);\r
+ expect(frame.addBeginList(1).value).toBe(1);\r
+ expect(frame.beginList.next.value).toBe(1);\r
\r
} );\r
/*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
it("should be this for the value (the valid partion)", function() {\r
function appendBegin(num) {\r
frame.state = frame.WAITING;\r
- frame.beginList = {\r
- value: num,\r
- next: frame.beginList\r
- };\r
+ frame.addBeginList(num);\r
};\r
appendBegin(0);\r
expect(frame.currentFrame).toBe(0);\r
function appendEnd(num) {\r
frame.state = frame.WAITING;\r
frame.begin = 0;\r
- frame.endList = {\r
- value: num,\r
- next: frame.endList\r
- };\r
+ frame.addEndList(num);\r
};\r
\r
appendEnd(3);\r