コード例 #1
0
					"Bucket{name: permgen, size: <nil>, range: 10M..10M, weight: 3}",
					"Bucket{name: native, size: <nil>, range: 0.., weight: 1}",
				))
			})
		})
	})

	Context("balancing", func() {
		var (
			memLimit = memory.MEMSIZE_ZERO
			aerr     error
		)

		JustBeforeEach(func() {
			a = shouldWork(memory.NewAllocator(convertToRanges(sizes), weights))
			aerr = a.Balance(memLimit)
		})

		Context("badly", func() {

			JustBeforeEach(func() {
				Ω(aerr).Should(HaveOccurred())
			})

			Context("with no memory and one bucket", func() {
				BeforeEach(func() {
					sizes = strmap{"heap": "0.."}
					weights = floatmap{"heap": 5.0}
					memLimit = memory.MEMSIZE_ZERO
				})
				It("fails", func() {})
コード例 #2
0
	})

	Context("balancing", func() {
		var (
			memLimit   = memory.MEMSIZE_ZERO
			aerr       error
			numThreads = 0
		)

		BeforeEach(func() {
			numThreads = 0
		})

		JustBeforeEach(func() {
			a = shouldWork(memory.NewAllocator(convertToRanges(sizes), weights))
			aerr = a.Balance(memLimit, numThreads)
		})

		Context("badly", func() {

			JustBeforeEach(func() {
				Ω(aerr).Should(HaveOccurred())
			})

			Context("with no memory and one bucket", func() {
				BeforeEach(func() {
					sizes = strmap{"heap": "0.."}
					weights = floatmap{"heap": 5.0}
					memLimit = memory.MEMSIZE_ZERO
				})
				It("fails", func() {})